Files
pmgr/site/views/transactions/view.ctp

118 lines
3.7 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="transaction view">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Transaction Detail Main Section
*/
$account = $transaction['Account'];
$ledger = $transaction['Ledger'];
if (isset($transaction['Transaction']))
$transaction = $transaction['Transaction'];
$rows = array();
$rows[] = array('ID', $transaction['id']);
$rows[] = array('Type', $transaction['type']);
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
$rows[] = array('Amount', FormatHelper::currency($transaction['amount']));
$rows[] = array('Account', $html->link($account['name'],
array('controller' => 'accounts',
'action' => 'view',
$account['id'])));
$rows[] = array('Ledger', $html->link($ledger['name'],
array('controller' => 'ledgers',
'action' => 'view',
$ledger['id'])));
$rows[] = array('Comment', $transaction['comment']);
echo $this->element('table',
array('class' => 'item transaction detail',
'caption' => 'Transaction Detail',
'rows' => $rows,
'column_class' => array('field', 'value')));
/**********************************************************************
* Transaction Info Box
*/
echo '<div class="infobox">' . "\n";
$rows = array();
$rows[] = array('Total:', FormatHelper::currency($transaction['amount']));
echo $this->element('table',
array('class' => 'summary',
'rows' => $rows,
'column_class' => array('field', 'value'),
'suppress_alternate_rows' => true,
));
echo '</div>' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Supporting Elements Section
*/
echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Statement Entries
*/
if ($transaction['type'] === 'INVOICE' || $transaction['type'] === 'RECEIPT') {
echo $this->element('statement_entries', array
(// Grid configuration
'config' => array
(
'caption' => 'Statement Entries',
'filter' => array('Transaction.id' => $transaction['id']),
'exclude' => array('Transaction'),
)));
}
/**********************************************************************
* Ledger Entries
*/
echo $this->element('ledger_entries', array
(// Grid configuration
'config' => array
(
'caption' => 'Ledger Entries',
'filter' => array('Transaction.id' => $transaction['id'],
'Account.id !=' => $account['id']),
'exclude' => array('Transaction'),
)));
/* /\********************************************************************** */
/* * Tenders Deposited */
/* *\/ */
/* if ($transaction['type'] === 'DEPOSIT') { */
/* echo $this->element('tenders', array */
/* (// Grid configuration */
/* 'config' => array */
/* ( */
/* 'caption' => 'Deposited Items', */
/* 'filter' => array('deposit_transaction_id' => $transaction['id']), */
/* ))); */
/* } */
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";