Some fixes as a result of prior commit changing status to active

This commit is contained in:
Deon George 2016-09-22 10:19:19 +10:00
parent f753dfe502
commit 8bd409d86f
8 changed files with 43 additions and 6 deletions

View File

@ -455,7 +455,7 @@ class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
->join('service') ->join('service')
->on('service.id','=',$this->_table_name.'.service_id') ->on('service.id','=',$this->_table_name.'.service_id')
->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM))
->and_where('service.status','=',1) ->and_where('service.active','=',1)
->where_open() ->where_open()
->and_where($this->_table_name.'.service_number','like','%'.$term.'%') ->and_where($this->_table_name.'.service_number','like','%'.$term.'%')
->or_where($this->_table_name.'.service_address','like','%'.$term.'%') ->or_where($this->_table_name.'.service_address','like','%'.$term.'%')

View File

@ -89,7 +89,7 @@ class Model_Service_Plugin_Domain extends Model_Service_Plugin {
->join('service') ->join('service')
->on('service.id','=',$this->_table_name.'.service_id') ->on('service.id','=',$this->_table_name.'.service_id')
->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM))
->and_where('service.status','=',1) ->and_where('service.active','=',1)
->and_where($this->_table_name.'.domain_name','like','%'.$term.'%'); ->and_where($this->_table_name.'.domain_name','like','%'.$term.'%');
return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); return parent::list_autocomplete($term,$index,$value,$label,$limit,$options);

View File

@ -90,7 +90,7 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
->join('service') ->join('service')
->on('service.id','=',$this->_table_name.'.service_id') ->on('service.id','=',$this->_table_name.'.service_id')
->where('service.account_id','IN',$ao->RTM->customers($ao->RTM)) ->where('service.account_id','IN',$ao->RTM->customers($ao->RTM))
->and_where('service.status','=',1) ->and_where('service.active','=',1)
->and_where($this->_table_name.'.domain_name','like','%'.$term.'%'); ->and_where($this->_table_name.'.domain_name','like','%'.$term.'%');
return parent::list_autocomplete($term,$index,$value,$label,$limit,$options); return parent::list_autocomplete($term,$index,$value,$label,$limit,$options);

View File

@ -65,6 +65,7 @@ class Invoice {
$iio->recurring_schedule = $so->recur_schedule; $iio->recurring_schedule = $so->recur_schedule;
$iio->date_start = $pdata['start_time']; $iio->date_start = $pdata['start_time'];
$iio->date_stop = $pdata['end_time']; $iio->date_stop = $pdata['end_time'];
$iio->active = TRUE;
// Service Billing // Service Billing
$iio->item_type = 0; $iio->item_type = 0;
@ -88,6 +89,7 @@ class Invoice {
$iio->date_start = $co->date_orig; $iio->date_start = $co->date_orig;
$iio->date_stop = $co->date_orig; $iio->date_stop = $co->date_orig;
$iio->item_type = $co->type; $iio->item_type = $co->type;
$iio->active = TRUE;
$this->_io->add_sub_item($iio); $this->_io->add_sub_item($iio);
} }
@ -139,7 +141,7 @@ class Invoice {
switch ($section) { switch ($section) {
case 'all': case 'all':
$token = ORM::factory('Module_Method_Token') $token = ORM::factory('Module_Method_Token')
->method(array('invoice','user_download')) ->method(array('invoice','user:download'))
->account($this->_io->account) ->account($this->_io->account)
->expire(time()+86400*21) ->expire(time()+86400*21)
->uses(3) ->uses(3)

View File

@ -253,7 +253,7 @@ class Model_Invoice_Item extends ORM {
// This total of this item before discounts and taxes // This total of this item before discounts and taxes
public function subtotal($format=FALSE) { public function subtotal($format=FALSE) {
$result = Currency::round($this->price_base*$this->quantity); $result = $this->price_base*$this->quantity;
return $format ? Currency::display($result) : $result; return $format ? Currency::display($result) : $result;
} }

View File

@ -107,6 +107,7 @@ class Controller_Admin_Payment extends Controller_Payment {
$pio->invoice_id = $k; $pio->invoice_id = $k;
$pio = $po->add_item($pio); $pio = $po->add_item($pio);
$v = str_replace(',','',$v);
$pio->alloc_amt = is_numeric($v) ? $v : 0; $pio->alloc_amt = is_numeric($v) ? $v : 0;
} }

View File

@ -0,0 +1,34 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides Admin Product management
*
* @package Product
* @category Controllers/Admin
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Controller_Admin_Product_Category extends Controller_TemplateDefault {
protected $auth_required = TRUE;
protected $secure_actions = array(
'list'=>FALSE,
);
/**
* Show a list of products
*/
public function action_list() {
$this->meta->title = 'A|Product Category List';
$o = ORM::factory('Product_Category')->find_all()->as_array();
Sort::MASort($o,array('name()'));
Block::factory()
->title('Product Categories')
->title_icon('fa fa-list')
->body(View::factory('product/category/list')->set('o',$o));
}
}
?>

View File

@ -125,7 +125,7 @@ class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
} }
public function download_button() { public function download_button() {
if (! $this->pk OR ! $this->service->status OR ! preg_match('/client/',$this->service->product->plugin()->extensions) OR $this->valid_to() < time()) if (! $this->pk OR ! $this->service->active OR ! preg_match('/client/',$this->service->product->plugin()->extensions) OR $this->valid_to() < time())
return ''; return '';
$output = Form::open(URL::link('user','ssl/download'),array('class'=>'form-inline')); $output = Form::open(URL::link('user','ssl/download'),array('class'=>'form-inline'));