' . "\n"; // The two entries, debit and credit, are actually individual // entries in separate accounts (each make up one of the two // entries required for "double entry"). /********************************************************************** ********************************************************************** ********************************************************************** ********************************************************************** * DoubleEntry Detail Main Section */ $transaction = $entry['Transaction']; $ledgers = array('debit' => $entry['DebitLedger'], 'credit' => $entry['CreditLedger']); $entries = array('debit' => $entry['DebitEntry'], 'credit' => $entry['CreditEntry']); $entry = $entry['DoubleEntry']; $rows = array(); $rows[] = array('Transaction', $html->link('#'.$transaction['id'], array('controller' => 'transactions', 'action' => 'view', $transaction['id']))); $rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp'])); $rows[] = array('Comment', $entry['comment']); echo $this->element('table', array('class' => 'item double-entry detail', 'caption' => 'Double Ledger Entry', 'rows' => $rows, 'column_class' => array('field', 'value'))); /********************************************************************** * Debit/Credit Entries */ echo ('
' . "\n"); foreach ($ledgers AS $type => $ledger) { $rows = array(); // REVISIT : 20090816 // Due to low priority, the ledger_entry/double_entry stuff // is a bit piecemeal at the moment (trying to reuse old // code as much as possible). So, LedgerEntry view is just // redirecting here. Of course, presenting a link for the // LedgerEntry then is, well, quite pointless. $rows[] = array('ID', '#' . $entries[$type]['id']); /* $rows[] = array('ID', $html->link('#' . $entries[$type]['id'], */ /* array('controller' => 'entries', */ /* 'action' => 'view', */ /* $entries[$type]['id']))); */ $rows[] = array('Account', ($ledger['link'] ? $html->link($ledger['Account']['name'], array('controller' => 'accounts', 'action' => 'view', $ledger['Account']['id'])) : $ledger['Account']['name'])); $rows[] = array('Ledger', ($ledger['link'] ? $html->link('#' . $ledger['sequence'], array('controller' => 'ledgers', 'action' => 'view', $ledger['id'])) : '#' . $ledger['sequence'])); $rows[] = array('Amount', FormatHelper::currency($entries[$type]['amount'])); //$rows[] = array('Effect', $ledger['Account']['ftype'] == $type ? 'INCREASE' : 'DECREASE'); echo $this->element('table', array('class' => array('item', $type, 'detail'), 'caption' => ucfirst($type) . ' Entry', 'rows' => $rows, 'column_class' => array('field', 'value'))); } echo ('
' . "\n"); /********************************************************************** ********************************************************************** ********************************************************************** ********************************************************************** * Supporting Elements Section */ echo '
' . "\n"; /* End "detail supporting" div */ echo '
' . "\n"; /* End page div */ echo '' . "\n";