Removed redundant functions, some Standardisation work
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Charge extends ORM_OSB implements Invoicable {
|
||||
class Model_Charge extends ORM {
|
||||
protected $_belongs_to = array(
|
||||
'account'=>array(),
|
||||
'product'=>array(),
|
||||
@@ -80,9 +80,6 @@ class Model_Charge extends ORM_OSB implements Invoicable {
|
||||
}
|
||||
|
||||
/** REQUIRED ABSTRACT METHODS **/
|
||||
public function namesub($variable=NULL) {
|
||||
return sprintf('%d@%2.2f - %s (%s)',$this->quantity,$this->amount,($this->description ? ' '.$this->description : '').($this->attributes ? ' ['.join('|',$this->attributes).']' : ''),$this->display('date_charge'));
|
||||
}
|
||||
|
||||
/** LOCAL METHODS **/
|
||||
|
||||
@@ -100,26 +97,9 @@ class Model_Charge extends ORM_OSB implements Invoicable {
|
||||
return $iio;
|
||||
}
|
||||
|
||||
public function invoice_item($item_type) {
|
||||
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.')' : '');
|
||||
}
|
||||
public function namesub($variable=NULL) {
|
||||
return sprintf('%d@%2.2f - %s (%s)',$this->quantity,$this->amount,($this->description ? ' '.$this->description : '').($this->attributes ? ' ['.join('|',$this->attributes).']' : ''),$this->display('date_charge'));
|
||||
}
|
||||
|
||||
public function xtitle() {
|
||||
return $this->invoice_item(5);
|
||||
}
|
||||
|
||||
public function total($format=FALSE) {
|
||||
$result = $this->quantity * $this->amount;
|
||||
|
||||
|
Reference in New Issue
Block a user