Local fixes to invoice display and retrieve traffic data
This commit is contained in:
@@ -21,6 +21,7 @@ class Model_Invoice extends ORMOSB {
|
||||
'invoice_item_tax'=>array(),
|
||||
'service'=>array('through'=>'invoice_item'),
|
||||
'payment'=>array('through'=>'payment_item'),
|
||||
'payment_item'=>array('far_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
@@ -132,14 +133,14 @@ class Model_Invoice extends ORMOSB {
|
||||
}
|
||||
|
||||
public function payments() {
|
||||
return ($this->loaded() AND ! $this->_changed) ? $this->payments->find_all() : NULL;
|
||||
return ($this->loaded() AND ! $this->_changed) ? $this->payment_item->find_all() : NULL;
|
||||
}
|
||||
|
||||
public function payments_total($format=FALSE) {
|
||||
$result = 0;
|
||||
|
||||
foreach ($this->payments() as $po)
|
||||
$result += $po->total_amt;
|
||||
$result += $po->alloc_amt;
|
||||
|
||||
return $format ? Currency::display($result) : $result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user