element('table', array('class' => 'item transaction detail', 'caption' => 'Transaction Detail', 'rows' => $rows, 'column_class' => array('field', 'value'))); /********************************************************************** * Transaction Info Box */ ?>
Total:
$v) { $column_class[$k] = 'id'; } foreach (array_intersect($headers, array('Amount', 'Total')) AS $k => $v) { $column_class[$k] = 'currency'; } foreach (array_intersect($headers, array('Comment')) AS $k => $v) { $column_class[$k] = 'slack'; } $rows = array(); $running_total = 0; foreach($transaction['LedgerEntry'] AS $entry) { $amount = $entry['amount']; $running_total += $amount; $rows[] = array($html->link('#'.$entry['id'], array('controller' => 'ledger_entries', 'action' => 'view', $entry['id'])), ($html->link($entry['DebitLedger']['Account']['name'], array('controller' => 'accounts', 'action' => 'view', $entry['DebitLedger']['Account']['id'])) . ' (' . $html->link('#' . $entry['DebitLedger']['Account']['id'] . '-' . $entry['DebitLedger']['sequence'], array('controller' => 'ledgers', 'action' => 'view', $entry['DebitLedger']['id'])) . ')'), ($html->link($entry['CreditLedger']['Account']['name'], array('controller' => 'accounts', 'action' => 'view', $entry['CreditLedger']['Account']['id'])) . ' (' . $html->link('#' . $entry['CreditLedger']['Account']['id'] . '-' . $entry['CreditLedger']['sequence'], array('controller' => 'ledgers', 'action' => 'view', $entry['CreditLedger']['id'])) . ')'), FormatHelper::currency($entry['amount']), $entry['comment'], //FormatHelper::currency($running_total), ); } echo $this->element('table', array('class' => 'item entry list', 'caption' => 'Entries in Transaction', 'headers' => $headers, 'rows' => $rows, 'column_class' => $column_class)); /* End "detail supporting" DIV */ ?>