Improvements to invoice display and other misc items

This commit is contained in:
Deon George
2013-12-20 10:00:32 +11:00
parent 778eada7f0
commit e19518c505
43 changed files with 1122 additions and 887 deletions

View File

@@ -12,7 +12,7 @@
* Column Definitions:
* + price_type: 0=One Time, 1=Recurring, 2=Trial
*/
class Model_Product extends ORM_OSB {
class Model_Product extends ORM_OSB implements Invoicable {
protected $_has_many = array(
'invoice'=>array('through'=>'invoice_item'),
'service'=>array('far_key'=>'id'),
@@ -48,6 +48,24 @@ class Model_Product extends ORM_OSB {
protected $_save_message = TRUE;
// Our required Interface Methods
public function invoice_item($item_type) {
switch ($item_type) {
case 0:
case 7:
return 'Service';
default:
return 'Product Charge';
}
}
public function invoice_title() {
return $this->title();
}
// Our local methods
// Our database index for pricing values
private $_price_options = array(
'base'=>'price_base',