This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/adsl/classes/Model/Adsl/Supplier/Plan.php

40 lines
972 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class supports ADSL Plans
*
* @package OSB
* @subpackage ADSL
* @category Models
* @author Deon George
* @copyright (c) 2010 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('far_key'=>'id'),
);
protected $_belongs_to = array(
'adsl_supplier'=>array('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;
}
}
?>