TRUE, 'revenue'=>TRUE, ); public function action_index() { $t = time(); Block::factory() ->title('Invoices Overdue - No Auto Billing') ->title_icon('fa fa-pencil-square-o') ->span(6) ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_overdue_billing($t))); Block::factory() ->title('Invoices Overdue - Auto Billing') ->title_icon('fa fa-pencil-square-o') ->span(6) ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_overdue_billing($t,TRUE))); Block::factory() ->title('Upcoming Invoices') ->title_icon('fa fa-pencil-square-o') ->span(6) ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_due($t))); /* Block::factory() ->title('Un-applied payments') ->title_icon('fa fa-money') ->span(6) ->body(View::factory('payment/list')->set('o',ORM::factory('Payment')->where_authorised()->list_unapplied())); */ } /** * Show Revenue Summary Information */ public function action_revenue() { $result = array(); // ADSL $svs = ORM::factory('Service')->where_authorised()->list_active(); foreach ($svs as $so) { if (! isset($result[$so->product->prod_plugin_file][$so->product->supplier()])) { $result[$so->product->prod_plugin_file][$so->product->supplier()]['count'] = 0; $result[$so->product->prod_plugin_file][$so->product->supplier()]['cost'] = 0; $result[$so->product->prod_plugin_file][$so->product->supplier()]['revenue'] = 0; } $result[$so->product->prod_plugin_file][$so->product->supplier()]['count']++; $result[$so->product->prod_plugin_file][$so->product->supplier()]['cost'] += $so->product->cost(TRUE); $result[$so->product->prod_plugin_file][$so->product->supplier()]['revenue'] += $so->revenue(TRUE); } Block::factory() ->title('Revenue / Cost Analysis') ->title_icon('icon-info-sign') ->span(6) ->body(View::factory('summary/reseller/index')->set('o',$result)); } } ?>