Export fixes and updates from live

This commit is contained in:
Deon George
2013-10-09 23:26:59 +11:00
parent c473bf6e7d
commit 317cc331ae
5 changed files with 23 additions and 9 deletions

View File

@@ -231,16 +231,20 @@ class Model_Invoice extends ORM_OSB implements Cartable {
$result = array();
foreach ($this->_sub_items as $ito) {
// Ignore voided items
if ($ito->void)
continue;
$return = FALSE;
switch ($type) {
case 'CHARGE':
if ($ito->quantity > 0)
if ($ito->product_id OR $ito->quantity > 0)
$return = TRUE;
break;
case 'CREDIT':
if ($ito->quantity < 0)
if (! $ito->product_id AND $ito->quantity < 0)
$return = TRUE;
break;