Added Revenue information
This commit is contained in:
@@ -203,6 +203,15 @@ class Model_Service extends ORM_OSB {
|
||||
return $type ? $o->$type : $o;
|
||||
}
|
||||
|
||||
public function revenue($annual=FALSE) {
|
||||
$multiple = $annual ? Period::multiple($this->recur_schedule) : 1;
|
||||
|
||||
if ($this->suspend_billing)
|
||||
$multiple = 0;
|
||||
|
||||
return $this->price(TRUE)*$multiple;
|
||||
}
|
||||
|
||||
public function service_change() {
|
||||
return $this->service_change->where_active()->where_open()->and_where('complete','!=',1)->or_where('complete','IS',null)->where_close()->find();
|
||||
}
|
||||
@@ -258,7 +267,7 @@ class Model_Service extends ORM_OSB {
|
||||
}
|
||||
|
||||
public function transactions() {
|
||||
return $this->invoice_item->order_by('date_start,date_stop');
|
||||
return $this->invoice_item->order_by('date_start')->order_by('date_stop');
|
||||
}
|
||||
|
||||
/** LIST FUNCTIONS **/
|
||||
|
Reference in New Issue
Block a user