Some cleanup, setup improvements and other misc items

This commit is contained in:
Deon George
2013-10-09 16:43:41 +11:00
parent 638d123739
commit c473bf6e7d
54 changed files with 477 additions and 3991 deletions

View File

@@ -657,7 +657,7 @@ class Model_Invoice extends ORM_OSB implements Cartable {
static $result = array();
if (! $result)
foreach ($this->_where_active()->_where_unprocessed()->find_all() as $io)
foreach ($this->_where_active()->_where_unprocessed()->where_authorised()->find_all() as $io)
if ($io->due())
array_push($result,$io);
@@ -713,12 +713,12 @@ class Model_Invoice extends ORM_OSB implements Cartable {
public function list_due($time=NULL) {
$result = array();
if (is_null($time))
$time = time();
foreach ($this->_list_due() as $io)
if (is_null($time) OR $io->due_date > time())
if (is_null($time))
array_push($result,$io);
elseif ($io->due_date <= $time)
array_push($result,$io);
if ($io->due_date > $time)
array_push($result,$io);
return $result;
}