Some cleanup, setup improvements and other misc items
This commit is contained in:
@@ -20,7 +20,7 @@ class Controller_Reseller_Invoice extends Controller_Invoice {
|
||||
->title_icon('icon-th-list')
|
||||
->body(Table::factory()
|
||||
->jssort('invoices')
|
||||
->data(ORM::factory('Invoice')->where('account_id','IN',$this->ao->RTM->customers($this->ao->RTM))->where_active()->find_all())
|
||||
->data(ORM::factory('Invoice')->where_authorised('account_id',$this->ao)->where_active()->find_all())
|
||||
->page_items(25)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
class Task_Invoice_Complete extends Minion_Task {
|
||||
protected function _execute(array $params) {
|
||||
$c = 0;
|
||||
$c = array();
|
||||
|
||||
$o = ORM::factory('Invoice')
|
||||
->where_unprocessed();
|
||||
@@ -23,10 +23,10 @@ class Task_Invoice_Complete extends Minion_Task {
|
||||
$io->save();
|
||||
|
||||
if ($io->saved())
|
||||
$c++;
|
||||
array_push($c,$io->id);
|
||||
}
|
||||
|
||||
return sprintf('%s invoices updated',$c);
|
||||
return sprintf('%s invoices updated (%s)',count($c),join('|',$c));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
class Task_Invoice_Service extends Minion_Task {
|
||||
protected $_options = array(
|
||||
'days'=>1, // Days in advance to generate for
|
||||
'days'=>0, // Days in advance to generate for
|
||||
'id'=>NULL, // Service invoice to generate for
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user