Misc fixes and new function service_change
This commit is contained in:
@@ -22,6 +22,7 @@ class Model_Service extends ORM_OSB {
|
||||
protected $_has_many = array(
|
||||
'invoice_item'=>array('far_key'=>'id'),
|
||||
'invoice'=>array('through'=>'invoice_item'),
|
||||
'service_change'=>array('far_key'=>'id'),
|
||||
);
|
||||
protected $_belongs_to = array(
|
||||
'product'=>array(),
|
||||
@@ -75,6 +76,10 @@ class Model_Service extends ORM_OSB {
|
||||
return is_null($plugin=$this->plugin()) ? $this->product->name() : $plugin->name();
|
||||
}
|
||||
|
||||
public function pending_change() {
|
||||
return count($this->service_change->where_active()->where_open()->and_where('complete','!=',1)->or_where('complete','IS',null)->where_close()->find_all()->as_array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Display how much is due on this service
|
||||
*/
|
||||
|
Reference in New Issue
Block a user