element('table',
array('class' => 'item transaction detail',
'caption' => 'Transaction Info',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* Transaction Info Box
*/
?>
$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']['name'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['DebitLedger']['id'])),
$html->link($entry['CreditLedger']['name'],
array('controller' => 'ledgers',
'action' => 'view',
$entry['CreditLedger']['id'])),
$entry['comment'],
FormatHelper::currency($entry['amount']),
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 */ ?>