Removed the use of TemplateDefault::filter()
This commit is contained in:
@@ -10,22 +10,31 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Reseller_Invoice extends Controller_Invoice {
|
||||
protected $secure_actions = array(
|
||||
'list'=>TRUE,
|
||||
);
|
||||
|
||||
public function action_list() {
|
||||
list($id,$output) = Table::page(__METHOD__);
|
||||
|
||||
$ao = ORM::factory('Account',$id);
|
||||
|
||||
if (! $ao->loaded() OR ! Auth::instance()->authorised($ao))
|
||||
throw HTTP_Exception::factory(403,'Unauthorised or doesnt exist?');
|
||||
|
||||
Block::add(array(
|
||||
'body'=>$output,
|
||||
));
|
||||
|
||||
$this->ao = $ao;
|
||||
|
||||
// @todo Our pagination is broken if we select multiple accounts, and those accounts have multiple invoices.
|
||||
return parent::action_list();
|
||||
Block::factory()
|
||||
->title('Customer Invoices')
|
||||
->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())
|
||||
->page_items(25)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_orig'=>'Date Created',
|
||||
'due_date'=>'Date Due',
|
||||
'total(TRUE)'=>'Total',
|
||||
'due(TRUE)'=>'Due',
|
||||
'account->accnum()'=>'Cust ID',
|
||||
'account->name()'=>'Customer',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user