array('through'=>'invoice_item'), 'adsl_plan'=>array('through'=>'service__adsl'), ); protected $_has_one = array( 'service_adsl'=>array(), ); protected $_belongs_to = array( 'product'=>array(), 'account'=>array(), ); /** * Filters used to format the display of values into friendlier values */ protected $_display_filters = array( 'active'=>array( array('StaticList_YesNo::display',array(':value')), ), 'date_next_invoice'=>array( array('Config::date',array(':value')), ), 'recur_schedule'=>array( array('StaticList_RecurSchedule::display',array(':value')), ), 'price'=>array( array('Tax::add',array(':value')), array('Currency::display',array(':value')), ), ); /** * Display the service number */ public function svcnum() { return sprintf('%05s',$this->id); } // Nothing to directly display on invoices for this module. public function invoice_display() { if ($this->sku) return sprintf('%s: %s',_('Service'),$this->sku); else return ''; } public function name() { return $this->product->product_translate->find()->name; } // @todo To implement /** * Calculate the tax for this item */ public function tax() { return $this->price * .1; } } ?>