34 lines
799 B
PHP
34 lines
799 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class provides charge item capabilities.
|
|
*
|
|
* @package OSB
|
|
* @subpackage Charge
|
|
* @category Models
|
|
* @author Deon George
|
|
* @copyright (c) 2010 Open Source Billing
|
|
* @license http://dev.osbill.net/license.html
|
|
*/
|
|
class Model_Charge extends ORMOSB {
|
|
protected $_display_filters = array(
|
|
'amount'=>array(
|
|
'Currency::display',array(':value')
|
|
),
|
|
);
|
|
|
|
/**
|
|
* Render some details for specific calls, eg: invoice
|
|
*/
|
|
public function details($type) {
|
|
switch ($type) {
|
|
case 'invoice':
|
|
return sprintf('%s (%s@%s)',$this->description,$this->quantity,Currency::display($this->amount));
|
|
|
|
default:
|
|
throw new Kohana_Exception('Unkown detail request :type',array(':type'=>$type));
|
|
}
|
|
}
|
|
}
|
|
?>
|