diff --git a/modules/charge/classes/Model/Charge.php b/modules/charge/classes/Model/Charge.php index 283fffa5..89650a26 100644 --- a/modules/charge/classes/Model/Charge.php +++ b/modules/charge/classes/Model/Charge.php @@ -79,7 +79,19 @@ class Model_Charge extends ORM_OSB implements Invoicable { } public function invoice_item($item_type) { - return sprintf('%s %s',StaticList_ItemType::get($item_type),$this->display('date_charge')); + switch ($item_type) { + case 5: + return sprintf('%s (%s x %s%s%s) %s', + StaticList_ItemType::get($item_type), + $this->quantity, + $this->display('amount'), + ($this->description ? ' '.$this->description : ''), + ($this->attributes ? ' ['.join('|',$this->attributes).']' : ''), + $this->display('date_charge')); + + default: + return sprintf('%s %s',StaticList_ItemType::get($item_type),$this->display('date_charge')).($this->description ? ' ('.$this->description.')' : ''); + } } /** diff --git a/modules/export/classes/Export/Plugin/Quicken.php b/modules/export/classes/Export/Plugin/Quicken.php index 9cdb1e94..e814dcfa 100644 --- a/modules/export/classes/Export/Plugin/Quicken.php +++ b/modules/export/classes/Export/Plugin/Quicken.php @@ -100,7 +100,7 @@ class Export_Plugin_Quicken extends Export_Plugin { $items[$c]['INVITEM'] = $edo->map_data['item']; } else { - throw HTTP_Exception::factory(501,'Missing product map data for :product (:id)',array(':product'=>$iio->product->title(),':id'=>$iio->product_id)); + throw HTTP_Exception::factory(501,'Missing product map data for :product (:id)',array(':product'=>$iio->module()->title(),':id'=>$iio->module_ref)); } $items[$c]['MEMO'] = sprintf('%s (%s)',$iio->module()->title(),$iio->period()); @@ -133,13 +133,13 @@ class Export_Plugin_Quicken extends Export_Plugin { $items[$c]['TAXAMOUNT'] = 0; } + // @todo This rounding should be a system config. if ($iio->module() instanceof Model_Charge) { $items[$c]['QNTY'] *= $iio->module()->quantity; - $items[$c]['PRICE'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2)); - $items[$c]['AMOUNT'] = sprintf('%3.2f',round($iio->module()->amount-$iio->discount(),2)*-1); + $items[$c]['PRICE'] = sprintf('%3.2f',round($iio->module()->amount-$iio->discount(),2)); + $items[$c]['AMOUNT'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2)*-1); } else { - // @todo This rounding should be a system config. $items[$c]['PRICE'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2)); $items[$c]['AMOUNT'] = sprintf('%3.2f',round($iio->subtotal()-$iio->discount(),2)*-1); } diff --git a/modules/invoice/classes/Model/Invoice/Item.php b/modules/invoice/classes/Model/Invoice/Item.php index fd0e2959..bbbf2c2c 100644 --- a/modules/invoice/classes/Model/Invoice/Item.php +++ b/modules/invoice/classes/Model/Invoice/Item.php @@ -56,9 +56,7 @@ class Model_Invoice_Item extends ORM_OSB { switch ($this->item_type) { // Service Charges case 0: - case 7: return ((! $this->service_id OR $this->product_id OR $this->charge_id OR $this->product_name OR ! $this->recurring_schedule OR ! $this->date_start OR ! $this->date_stop) ? '+ ' : '').$ii.' '.$this->period(); - case 1: // @todo return $this->product_name; @@ -70,6 +68,9 @@ class Model_Invoice_Item extends ORM_OSB { case 6: return ((! $this->service_id OR $this->product_id OR $this->charge_id OR $this->product_name OR $this->recurring_schedule OR ! $this->date_start OR ! $this->date_stop) ? '+ ' : '').$ii; + case 7: + return ((! $this->service_id OR $this->product_id OR $this->charge_id OR $this->product_name OR ! $this->date_start OR ! $this->date_stop) ? '+ ' : '').$ii.' '.$this->period(); + case 8: return $this->product_name;