diff --git a/application/classes/staticlist/recurschedule.php b/application/classes/staticlist/recurschedule.php index 424bd007..8a38469c 100644 --- a/application/classes/staticlist/recurschedule.php +++ b/application/classes/staticlist/recurschedule.php @@ -44,10 +44,10 @@ class StaticList_RecurSchedule extends StaticList { $table = static::factory()->table(); foreach ($product->get_price_array() as $term => $price) { - $x[$term] = sprintf('%s %s',Currency::display($price['price_base']),$table[$term]); + $x[$term] = sprintf('%s %s',Currency::display(Tax::add($price['price_base'])),$table[$term]); if ($price['price_setup'] > 0) - $x[$term] .= sprintf(' + %s %s',Currency::display($price['price_setup']),_('Setup')); + $x[$term] .= sprintf(' + %s %s',Currency::display(Tax::add($price['price_setup'])),_('Setup')); } return Form::select($name,$x,$default); diff --git a/modules/email/classes/controller/admin/email.php b/modules/email/classes/controller/admin/email.php index 96098f12..62862e2c 100644 --- a/modules/email/classes/controller/admin/email.php +++ b/modules/email/classes/controller/admin/email.php @@ -1,10 +1,10 @@ _('System Emails Sent'), 'body'=>Table::display( - $elo->find_all(), + ORM::factory('email_log')->find_all(), 25, array( 'id'=>array('label'=>'ID','url'=>'user/email/view/'), diff --git a/modules/invoice/classes/controller/task/invoice.php b/modules/invoice/classes/controller/task/invoice.php index 3ff0e68c..3be12342 100644 --- a/modules/invoice/classes/controller/task/invoice.php +++ b/modules/invoice/classes/controller/task/invoice.php @@ -116,7 +116,7 @@ class Controller_Task_Invoice extends Controller_Task { case 3: // @todo This should go in a config somewhere - $days = 21; + $days = 13; break; default: diff --git a/modules/product/classes/model/product.php b/modules/product/classes/model/product.php index 0ba9c0aa..774e0660 100644 --- a/modules/product/classes/model/product.php +++ b/modules/product/classes/model/product.php @@ -15,6 +15,7 @@ class Model_Product extends ORMOSB { protected $_has_many = array( 'product_translate'=>array('far_key'=>'id'), 'service'=>array('far_key'=>'id'), + 'invoice'=>array('through'=>'invoice_item'), ); protected $_sorting = array( @@ -26,9 +27,16 @@ class Model_Product extends ORMOSB { 'active'=>array( array('StaticList_YesNo::display',array(':value')), ), + 'price_base'=>array( + array('Tax::add',array(':value')), + array('Currency::display',array(':value')), + ), 'price_type'=>array( array('StaticList_PriceType::display',array(':value')), ), + 'taxable'=>array( + array('StaticList_YesNo::display',array(':value')), + ), ); /** @@ -116,6 +124,20 @@ class Model_Product extends ORMOSB { echo HTML::image($thumb,array('alt'=>_('Thumb Nail'))); } + /** + * List the number of services using this product + */ + public function services_count() { + return $this->service->find_all()->count(); + } + + /** + * List the number of invoices using this product + */ + public function invoices_count() { + return $this->invoice->find_all()->count(); + } + /** * Return the products for a given category * @todo This shouldnt be here. diff --git a/modules/product/views/product/category/view.php b/modules/product/views/product/category/view.php index c32386ba..e5fa767e 100644 --- a/modules/product/views/product/category/view.php +++ b/modules/product/views/product/category/view.php @@ -19,7 +19,7 @@
name; ?> (price_base); ?>/mth) | +name; ?> (display('price_base'); ?>/mth) |