Minor updatess
This commit is contained in:
@@ -503,12 +503,10 @@ class Model_Invoice extends ORM_OSB implements Cartable {
|
||||
if ($this->loaded() AND ! count($this->items()))
|
||||
$this->_load_sub_items();
|
||||
|
||||
// This will include charges and credits
|
||||
foreach ($this->items() as $ito)
|
||||
$result += $ito->total();
|
||||
|
||||
// Reduce by any credits
|
||||
$result -= $this->credit_amt;
|
||||
|
||||
return $format ? Currency::display($result) : Currency::round($result);
|
||||
}
|
||||
|
||||
@@ -524,17 +522,13 @@ class Model_Invoice extends ORM_OSB implements Cartable {
|
||||
public function total_credits($format=FALSE) {
|
||||
$result = 0;
|
||||
|
||||
// @todo Remove when credit_amt is dropped.
|
||||
if ($this->credit_amt)
|
||||
$result = $this->credit_amt;
|
||||
|
||||
foreach ($this->items('CREDIT') as $ito)
|
||||
$result += ($ito->subtotal()+$ito->tax())*-1;
|
||||
|
||||
return $format ? Currency::display($result) : Currency::round($result);
|
||||
}
|
||||
|
||||
public function total_discount($format=FALSE) {
|
||||
public function total_discounts($format=FALSE) {
|
||||
$result = 0;
|
||||
|
||||
foreach ($this->items() as $ito)
|
||||
|
Reference in New Issue
Block a user