Fix to not record /bin/bash allocation

This commit is contained in:
Deon George 2013-02-02 17:35:21 +11:00
parent 8b88cd9fdf
commit 133ae4d5c6

View File

@ -191,8 +191,12 @@ class Model_Payment extends ORM_OSB {
parent::save($validation); parent::save($validation);
// Need to save the associated items and their taxes // Need to save the associated items and their taxes
if ($this->saved()) { if (! $this->changed() OR $this->saved()) {
foreach ($items as $pio) { foreach ($items as $pio) {
// Skip applying 0 payments to invoices.
if (Currency::round($pio->alloc_amt) == 0 AND ! $pio->loaded())
continue;
$pio->payment_id = $this->id; $pio->payment_id = $this->id;
if (! $pio->check()) { if (! $pio->check()) {
@ -208,8 +212,9 @@ class Model_Payment extends ORM_OSB {
} }
} }
} else } else {
throw new Kohana_Exception('Couldnt save payment for some reason?'); throw new Kohana_Exception('Couldnt save payment for some reason?');
}
return TRUE; return TRUE;
} }