Added list_expiring to show services expiring
This commit is contained in:
@@ -19,6 +19,7 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
'listbycheckout'=>TRUE,
|
||||
'listadslbilling'=>TRUE,
|
||||
'listadslservices'=>TRUE,
|
||||
'listexpiring'=>TRUE,
|
||||
'listdomainservices'=>TRUE,
|
||||
'listdomainservicesbysupplier'=>TRUE,
|
||||
'listdomainservicesbydnshost'=>TRUE,
|
||||
@@ -212,6 +213,32 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a list of services that are expiring or have expired
|
||||
*/
|
||||
public function action_listexpiring() {
|
||||
$svs = ORM::factory('service')->list_expiring();
|
||||
|
||||
Sort::MAsort($svs,'expire()');
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('ADSL Services'),
|
||||
'body'=>Table::display(
|
||||
$svs,
|
||||
NULL,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>'user/service/view/'),
|
||||
'service_name()'=>array('label'=>'Service'),
|
||||
'expire(TRUE)'=>array('label'=>'Expires'),
|
||||
'due(TRUE)'=>array('label'=>'Due'),
|
||||
),
|
||||
array(
|
||||
'type'=>'select',
|
||||
'form'=>'user/service/view',
|
||||
)),
|
||||
));
|
||||
}
|
||||
|
||||
public function action_listhspaservices() {
|
||||
$svs = ORM::factory('service')->list_bylistgroup('HSPA');
|
||||
$data = $this->consoltraffic($svs,time());
|
||||
@@ -560,7 +587,13 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
continue;
|
||||
}
|
||||
|
||||
list($id,$ref,$unknown,$linedata,$q,$cost,$total) = explode(',',$line);
|
||||
// @todo This is to workaround SEP2012 CSV invoice which had extra columns.
|
||||
if (count(explode(',',$line)) == 9)
|
||||
list($id,$ref,$unknown,$unknown,$unknown,$linedata,$q,$cost,$total) = explode(',',$line);
|
||||
elseif (count(explode(',',$line)) == 10)
|
||||
list($id,$ref,$unknown,$unknown,$unknown,$unknown,$linedata,$q,$cost,$total) = explode(',',$line);
|
||||
else
|
||||
list($id,$ref,$unknown,$linedata,$q,$cost,$total) = explode(',',$line);
|
||||
|
||||
// Extract the phone number from the $linedata
|
||||
@list($service,$description) = explode(':',(preg_replace('/([0-9]+)\s+-\s+(.*)$/',"$1:$2",$linedata)));
|
||||
|
Reference in New Issue
Block a user