Some cleanup, setup improvements and other misc items

This commit is contained in:
Deon George
2013-10-09 16:43:41 +11:00
parent 638d123739
commit c473bf6e7d
54 changed files with 477 additions and 3991 deletions

View File

@@ -13,6 +13,9 @@ class Model_Charge extends ORM_OSB {
protected $_belongs_to = array(
'account'=>array(),
);
protected $_has_one = array(
'invoice_item'=>array('far_key'=>'id'),
);
protected $_nullifempty = array(
'attributes',
@@ -23,14 +26,23 @@ class Model_Charge extends ORM_OSB {
);
protected $_display_filters = array(
'amount'=>array(
array('Currency::display',array(':value')),
),
'date_orig'=>array(
array('Config::date',array(':value')),
),
'date_charge'=>array(
array('Config::date',array(':value')),
),
'amount'=>array(
array('Currency::display',array(':value')),
'processed'=>array(
array('StaticList_YesNo::get',array(':value')),
),
'sweep_type'=>array(
array('StaticList_SweepType::get',array(':value')),
),
'void'=>array(
array('StaticList_YesNo::get',array(':value')),
),
);
@@ -47,6 +59,10 @@ class Model_Charge extends ORM_OSB {
}
}
public function processed($render=FALSE) {
return $this->label_bool('processed',$render);
}
public function total($format=FALSE) {
$result = $this->quantity * $this->amount;