Minor updatess
This commit is contained in:
@@ -68,10 +68,17 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
* Show a list of services
|
||||
*/
|
||||
public function action_list() {
|
||||
$id = $this->request->param('id');
|
||||
|
||||
$svs = ORM::factory('Service');
|
||||
|
||||
if ($id)
|
||||
$svs->where_active()->and_where('account_id','=',$id);
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Customer Services'),
|
||||
'body'=>Table::display(
|
||||
ORM::factory('Service')->find_all(),
|
||||
$svs->find_all(),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
|
||||
@@ -195,7 +202,16 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
}
|
||||
|
||||
public function action_listadslservices() {
|
||||
$svs = ORM::factory('Service')->list_bylistgroup('ADSL');
|
||||
$id = $this->request->param('id');
|
||||
|
||||
$svs = $list = ORM::factory('Service')->list_bylistgroup('ADSL');
|
||||
|
||||
if ($id) {
|
||||
$svs = array();
|
||||
foreach ($list as $so)
|
||||
if ($so->account_id == $id)
|
||||
array_push($svs,$so);
|
||||
}
|
||||
|
||||
$google = GoogleChart::factory('ComboChart')
|
||||
->dataurl(URL::link('admin','service/ajaxjson_traffic',TRUE))
|
||||
@@ -732,6 +748,8 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
|
||||
$save = (isset($_REQUEST['go']) && $_REQUEST['go']=1) ? 1 : 0;
|
||||
$xsid=197;
|
||||
foreach ($so->transactions()->where('item_type','=',0)->find_all() as $iio) {
|
||||
if (! $iio->invoice->status) continue;
|
||||
// @todo This hard coding of 3070 should be removed.
|
||||
if ($iio->service_id == $xsid AND $iio->invoice_id < 3070) continue;
|
||||
if ($iio->quantity < 0 OR $iio->price_base < 0)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user