Fixes to invoice display
This commit is contained in:
parent
3cbf48721b
commit
ec88eb6926
@ -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.')' : '');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user