Standardisation work, changed accnum() to refnum()
This commit is contained in:
@@ -137,33 +137,12 @@ $(document).ready(function() {
|
||||
* Show a list of invoices
|
||||
*/
|
||||
public function action_list() {
|
||||
$this->meta->title = 'Customer Charges';
|
||||
$this->meta->title = 'R|Customer Charges';
|
||||
|
||||
Block::factory()
|
||||
->title('Customer Charges')
|
||||
->title_icon('fa fa-list')
|
||||
->body(Table::factory()
|
||||
->page_items(50)
|
||||
->data(ORM::factory('Charge')->where_authorised($this->ao)->where('void','is',NULL)->order_by('id','DESC')->find_all())
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_charge'=>'Date',
|
||||
'processed'=>'Processed',
|
||||
'invoice_item->invoice_id'=>'Invoice',
|
||||
'sweep_type'=>'Sweep',
|
||||
'quantity'=>'Quantity',
|
||||
'amount'=>'Amount',
|
||||
'total(TRUE)'=>'Total',
|
||||
'description'=>'Description',
|
||||
'service_id'=>'Service',
|
||||
'account->accnum()'=>'Cust ID',
|
||||
'account->name()'=>'Customer',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('reseller','charge/edit/')),
|
||||
'invoice_item->invoice_id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
))
|
||||
);
|
||||
->body(View::factory('charge/list')->set('o',ORM::factory('Charge')->where_authorised($this->ao)->where('void','is',NULL)->order_by('id','DESC')->find_all()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -15,9 +15,6 @@ class Model_Charge extends ORM_OSB implements Invoicable {
|
||||
'product'=>array(),
|
||||
'service'=>array(),
|
||||
);
|
||||
protected $_has_one = array(
|
||||
'invoice_item'=>array('far_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_compress_column = array(
|
||||
'attributes',
|
||||
@@ -82,6 +79,20 @@ class Model_Charge extends ORM_OSB implements Invoicable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Invoice Item object for this charge
|
||||
*/
|
||||
public function iio() {
|
||||
$iio = ORM::factory('Invoice_Item');
|
||||
if ($this->processed) {
|
||||
$iio->where('module_id','=',$this->mid())
|
||||
->where('module_ref','=',$this->id)
|
||||
->find();
|
||||
}
|
||||
|
||||
return $iio;
|
||||
}
|
||||
|
||||
public function invoice_item($item_type) {
|
||||
switch ($item_type) {
|
||||
case 5:
|
||||
|
24
modules/charge/views/charge/list.php
Normal file
24
modules/charge/views/charge/list.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<!-- o = Array of Model_Charge -->
|
||||
<?php echo Table::factory()
|
||||
->page_items(50)
|
||||
->data($o)
|
||||
->columns(array(
|
||||
'id'=>'ID',
|
||||
'date_charge'=>'Date',
|
||||
'processed'=>'Processed',
|
||||
'iio()->invoice_id'=>'Invoice',
|
||||
'sweep_type'=>'Sweep',
|
||||
'quantity'=>'Quantity',
|
||||
'amount'=>'Amount',
|
||||
'total(TRUE)'=>'Total',
|
||||
'description'=>'Description',
|
||||
'service_id'=>'Service',
|
||||
'account->refnum()'=>'Cust ID',
|
||||
'account->name()'=>'Customer',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('reseller','charge/edit/')),
|
||||
'service_id'=>array('url'=>URL::link('user','service/view/')),
|
||||
'iio()->invoice_id'=>array('url'=>URL::link('user','invoice/view/')),
|
||||
));
|
||||
?>
|
Reference in New Issue
Block a user