Local fixes to invoice display and retrieve traffic data
This commit is contained in:
@@ -416,7 +416,7 @@ class Invoice_TCPDF_Default extends Invoice_TCPDF {
|
||||
$this->SetX($x+8);
|
||||
$this->Cell(0,0,'Payments Received');
|
||||
$this->SetX($x+135);
|
||||
$this->Cell(0,0,Currency::display($this->io->payments()),0,0,'R');
|
||||
$this->Cell(0,0,$this->io->payments_total(TRUE),0,0,'R');
|
||||
}
|
||||
|
||||
if ($this->io->credit_amt) {
|
||||
|
@@ -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