Fixes for ADSL traffic collection and other ADSL items

This commit is contained in:
Deon George
2013-01-11 21:51:37 +11:00
parent 94b7b4bcd4
commit 7819a05515
16 changed files with 38 additions and 36 deletions

View File

@@ -10,7 +10,7 @@
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_ADSL_Plan extends ORM_OSB {
class Model_Adsl_Plan extends ORM_OSB {
// Relationships
// @todo This model should probably be joined with product_plugin_adsl
protected $_belongs_to = array(

View File

@@ -10,10 +10,10 @@
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_ADSL_Supplier extends ORM_OSB {
class Model_Adsl_Supplier extends ORM_OSB {
// Relationships
protected $_has_many = array(
'ADSL_supplier_plan'=>array('foreign_key'=>'supplier_id','far_key'=>'id'),
'adsl_supplier_plan'=>array('foreign_key'=>'supplier_id','far_key'=>'id'),
);
protected $_updated_column = FALSE;
@@ -22,7 +22,7 @@ class Model_ADSL_Supplier extends ORM_OSB {
* Return a list of plans that this supplier makes available
*/
public function plans($active=TRUE) {
$a = $this->ADSL_supplier_plan;
$a = $this->adsl_supplier_plan;
if ($active)
$a->where_active();
@@ -37,7 +37,7 @@ class Model_ADSL_Supplier extends ORM_OSB {
$return = array();
foreach ($this->plans($active)->find_all() as $po)
foreach ($po->ADSL_plan->find_all() as $apo)
foreach ($po->adsl_plan->find_all() as $apo)
$return[$apo->id] = $apo;
return $return;

View File

@@ -10,13 +10,13 @@
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_ADSL_Supplier_Plan extends ORM_OSB {
class Model_Adsl_Supplier_Plan extends ORM_OSB {
// Relationships
protected $_has_many = array(
'ADSL_plan'=>array('far_key'=>'id'),
'adsl_plan'=>array('far_key'=>'id'),
);
protected $_belongs_to = array(
'ADSL_supplier'=>array('foreign_key'=>'supplier_id'),
'adsl_supplier'=>array('foreign_key'=>'supplier_id'),
);
/**

View File

@@ -10,7 +10,7 @@
* @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Model_Service_Plugin_ADSL_Traffic extends ORM_OSB {
class Model_Service_Plugin_Adsl_Traffic extends ORM_OSB {
protected $_table_name = 'service__adsl_traffic';
protected $_primary_key = 'service';
protected $_disable_wild_select = TRUE;
@@ -27,7 +27,7 @@ class Model_Service_Plugin_ADSL_Traffic extends ORM_OSB {
return $result;
}
public function traffic(Model_Product_Plugin_ADSL $plan) {
public function traffic(Model_Product_Plugin_Adsl $plan) {
// Roll up the charges according to the product plan configuration
return ADSL::allowance(array(
'base_down_peak'=>is_null($plan->base_down_peak) ? NULL : $this->down_peak,