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/charge/classes/model/charge.php

47 lines
1.1 KiB
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?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 {
// Charge doesnt use the update column
protected $_updated_column = FALSE;
protected $_serialize_column = array(
'attributes',
);
protected $_belongs_to = array(
'account'=>array(),
);
2011-07-14 09:09:03 +00:00
protected $_display_filters = array(
'date_orig'=>array(
array('Config::date',array(':value')),
),
2011-07-14 09:09:03 +00:00
'amount'=>array(
array('Currency::display',array(':value')),
2011-07-14 09:09:03 +00:00
),
2010-11-29 22:41:08 +00:00
);
/**
* Render some details for specific calls, eg: invoice
*/
public function details($type) {
switch ($type) {
case 'invoice_detail_items':
return array('Other Charge'=>sprintf('%s (%s@%s)',$this->description,$this->quantity,Currency::display($this->amount)));
default:
throw new Kohana_Exception('Unkown detail request :type',array(':type'=>$type));
}
}
2010-11-29 22:41:08 +00:00
}
?>