Minor fixes to statement, services and internal things

Many misc updates
This commit is contained in:
Deon George
2011-10-14 16:44:12 +11:00
parent 7876a16413
commit 56c11507f4
71 changed files with 2192 additions and 677 deletions

View File

@@ -11,19 +11,37 @@
* @license http://dev.osbill.net/license.html
*/
class Model_Charge extends ORMOSB {
// Charge doesnt use the update column
protected $_updated_column = FALSE;
protected $_belongs_to = array(
'account'=>array(),
);
protected $_display_filters = array(
'date_orig'=>array(
array('Config::date',array(':value')),
),
'amount'=>array(
'Currency::display',array(':value')
array('Currency::display',array(':value')),
),
);
public function rules() {
return array_merge(parent::rules(),array(
'attributes'=>array(
array('ORMOSB::serialize_array',array(':model',':field',':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));
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));