TRUE, ); /** * Show a payments received */ public function action_show() { $result = array(); $total = 0; foreach ($this->ao->payment->find_all() as $o) { $key = $o->date_payment; while (isset($result[$key])) $key += 1; $result[$key] = $o; $total -= Currency::round($o->total()); } foreach ($this->ao->invoice->list_active() as $o) { $key = $o->date_orig; while (isset($result[$key])) $key += 1; $result[$key] = $o; $total += Currency::round($o->total()); } krsort($result); Block::factory() ->title(sprintf('%s: %s - %s',_('Transactions For'),$this->ao->accnum(),$this->ao->name(TRUE))) ->title_icon('icon-tasks') ->body(View::factory('statement/user/show')->set('result',$result)->set('total',$total)); } } ?>