Status updates, SSL updates

This commit is contained in:
Deon George
2013-11-08 22:02:32 +11:00
parent 28ea1ac613
commit 2d9d7f383c
31 changed files with 688 additions and 299 deletions

View File

@@ -39,11 +39,14 @@ class Model_Service extends ORM_OSB {
'date_next_invoice'=>array(
array('Config::date',array(':value')),
),
'price_override'=>array(
array('Currency::display',array(':value')),
),
'recur_schedule'=>array(
array('StaticList_RecurSchedule::get',array(':value')),
),
'status'=>array(
array('StaticList_YesNo::get',array(':value')),
array('StaticList_YesNo::get',array(':value',TRUE)),
),
);
@@ -226,12 +229,15 @@ class Model_Service extends ORM_OSB {
/**
* Return the service charge
*/
public function price($tax=FALSE,$format=FALSE) {
public function price($tax=FALSE,$format=FALSE,$original=FALSE) {
$x = $this->product->keyget('price_group',$this->recur_schedule);
// @todo This index shouldnt be hard coded.
$p = ! is_null($this->price) ? $this->price : $x[$this->price_group]['price_base'];
if (! $original AND ! is_null($this->price_override))
$p = $this->price_override;
if ($tax)
$p = Tax::add($p);