Fixes to invoice display

This commit is contained in:
Deon George
2014-01-08 15:48:42 +11:00
parent 3cbf48721b
commit ec88eb6926
3 changed files with 20 additions and 7 deletions

View File

@@ -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.')' : '');
}
}
/**