39 lines
1004 B
PHP
39 lines
1004 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class supports ADSL Plans
|
|
*
|
|
* @package ADSL
|
|
* @category Models
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Open Source Billing
|
|
* @license http://dev.osbill.net/license.html
|
|
*/
|
|
class Model_ADSL_Supplier_Plan extends ORM_OSB {
|
|
// Relationships
|
|
protected $_has_many = array(
|
|
'adsl_plan'=>array('model'=>'ADSL_Plan','far_key'=>'id'),
|
|
);
|
|
protected $_belongs_to = array(
|
|
'adsl_supplier'=>array('model'=>'ADSL_Supplier','foreign_key'=>'supplier_id'),
|
|
);
|
|
|
|
/**
|
|
* Show the ADSL allowance as a peak/offpeak metric
|
|
*/
|
|
public function allowance() {
|
|
return sprintf('%s/%s',$this->base_down_peak+$this->base_up_peak,$this->base_down_offpeak+$this->base_up_offpeak);
|
|
}
|
|
|
|
public function tax() {
|
|
// @todo This should be taken from the users session
|
|
// @todo rounding should be a system default
|
|
return round($this->base_cost*.1,2);
|
|
}
|
|
|
|
public function name() {
|
|
return $this->product_id;
|
|
}
|
|
}
|
|
?>
|