Password Reset Validation, Removal of unnessary files, Service display updates
This commit is contained in:
@@ -90,7 +90,7 @@ class Model_Service extends ORM_OSB {
|
||||
$expire = (is_null($plugin=$this->plugin()) ? NULL : $plugin->expire());
|
||||
|
||||
// If $expire is NULL, we'll use the next invoice date
|
||||
$expire = is_null($expire) ? $this->date_next_invoice-86400 : $expire;
|
||||
$expire = is_null($expire) ? $this->paid_to() : $expire;
|
||||
|
||||
return $format ? Config::date($expire) : $expire;
|
||||
}
|
||||
@@ -128,6 +128,15 @@ class Model_Service extends ORM_OSB {
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the date we are invoiced to
|
||||
*/
|
||||
public function invoiced_to($format=FALSE) {
|
||||
$x = $this->invoice_item->order_by('date_stop','DESC')->limit(1)->find();
|
||||
|
||||
return $format ? $x->display('date_stop') : $x->date_stop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the service product name
|
||||
*/
|
||||
@@ -136,7 +145,22 @@ class Model_Service extends ORM_OSB {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns TRUE of this service has a planend change
|
||||
* Returns the date that an item has been paid to
|
||||
*/
|
||||
public function paid_to($format=FALSE) {
|
||||
$x = NULL;
|
||||
|
||||
foreach ($this->invoice_item->order_by('date_stop','DESC')->order_by('date_orig','DESC')->find_all() as $iio)
|
||||
if ($iio->invoice->due() == 0) {
|
||||
$x = $iio;
|
||||
break;
|
||||
}
|
||||
|
||||
return $format ? ($x ? $x->display('date_stop') : ' ') : ($x ? $x->date_stop : NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns TRUE of this service has a planned change
|
||||
*/
|
||||
public function pending_change() {
|
||||
return $this->service_change()->loaded() ? TRUE : FALSE;
|
||||
@@ -219,18 +243,13 @@ class Model_Service extends ORM_OSB {
|
||||
return $this->invoice_item->order_by('date_start,date_stop');
|
||||
}
|
||||
|
||||
// @todo To implement
|
||||
public function charges_new() {
|
||||
return $this->charges();
|
||||
}
|
||||
|
||||
/** LIST FUNCTIONS **/
|
||||
|
||||
/**
|
||||
* Search for services matching a term
|
||||
*/
|
||||
public function list_autocomplete($term,$index,$value,array $label,array $limit=array(),array $options=NULL) {
|
||||
// We only show invoice numbers.
|
||||
// We only show service numbers.
|
||||
if (! is_numeric($term))
|
||||
return array();
|
||||
|
||||
|
Reference in New Issue
Block a user