Removed redundant functions, some Standardisation work

This commit is contained in:
Deon George
2016-08-15 21:23:18 +10:00
parent 24bb4a701b
commit 07de13f678
82 changed files with 367 additions and 590 deletions

View File

@@ -12,7 +12,7 @@
* Fields:
* + queue: PROVISION (to be provisioned)
*/
class Model_Service extends ORM_OSB {
class Model_Service extends ORM {
private $_plugin = NULL;
// Relationships
@@ -88,24 +88,6 @@ class Model_Service extends ORM_OSB {
/** REQUIRED ABSTRACT METHODS **/
/**
* Display the service product name
*/
public function name($variable=NULL) {
if (! $variable instanceOf Model_Language)
$variable = Company::instance()->language();
return $this->product->name($variable).(($x=$this->namesub($variable)) ? ': '.$x : '');
}
public function namesub($variable=NULL) {
return is_null($plugin=$this->_plugin()) ? '' : $plugin->name($variable);
}
public function refnum($short=FALSE) {
return ($short ? '' : sprintf('%02s-',Site::id())).sprintf('%05s',$this->id);
}
/** LOCAL METHODS **/
private function _plugin() {
@@ -234,6 +216,20 @@ class Model_Service extends ORM_OSB {
->order_by('date_stop','DESC');
}
/**
* Display the service product name
*/
public function name($variable=NULL) {
if (! $variable instanceOf Model_Language)
$variable = Company::instance()->language();
return $this->product->name($variable).(($x=$this->namesub($variable)) ? ': '.$x : '');
}
public function namesub($variable=NULL) {
return is_null($plugin=$this->_plugin()) ? '' : $plugin->name($variable);
}
/**
* Returns the date that an item has been paid to
*/
@@ -284,6 +280,10 @@ class Model_Service extends ORM_OSB {
return (is_null($x = $this->plugin())) ? NULL : $x->render_edit();
}
public function refnum($short=FALSE) {
return ($short ? '' : sprintf('%02s-',Site::id())).sprintf('%05s',$this->id);
}
public function revenue($annual=FALSE) {
$multiple = $annual ? Period::multiple($this->recur_schedule) : 1;