Fixes for export

This commit is contained in:
Deon George
2012-08-01 22:34:59 +10:00
parent f1f28cd746
commit 5697e7985b
3 changed files with 43 additions and 4 deletions

View File

@@ -117,6 +117,19 @@ class Model_Invoice extends ORMOSB {
return $format ? Currency::display($result) : Currency::round($result);
}
public function credits() {
return array($this);
}
public function credits_total($format=FALSE) {
$result = 0;
foreach ($this->credits() as $po)
$result += $po->credit_amt;
return $format ? Currency::display($result) : Currency::round($result);
}
public function discount($format=FALSE) {
$result = 0;

View File

@@ -39,6 +39,10 @@
<td>Payments Received to Date</td>
<td class="bold-right"><?php echo $io->payments_total(TRUE); ?></td>
</tr>
<tr>
<td>Credits Applied to Date</td>
<td class="bold-right"><?php echo $io->credits_total(TRUE); ?></td>
</tr>
<tr>
<td>Total Charges Due This Invoice</td>
<td class="bold-right"><?php echo $io->due(TRUE); ?></td>