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;