Files
pmgr/site/views/transactions/view.ctp
abijah 99a98cbc7d Added some minor view tweaks
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1018 97e9348a-65ac-dc4b-aefc-98561f571b83
2012-11-17 18:18:36 +00:00

131 lines
4.0 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="transaction view">' . "\n";
/**********************************************************************
**********************************************************************
**********************************************************************
**********************************************************************
* Transaction Detail Main Section
*/
$account = $transaction['Account'];
$ledger = $transaction['Ledger'];
$nsf_tender = $transaction['NsfTender'];
if (isset($transaction['Transaction']))
$transaction = $transaction['Transaction'];
$rows = array();
$rows[] = array('ID', $transaction['id']);
$rows[] = array('Type', str_replace('_', ' ', $transaction['type']));
$rows[] = array('Timestamp', FormatHelper::datetime($transaction['stamp']));
$rows[] = array('Amount', FormatHelper::currency($transaction['amount']));
$rows[] = array('Account', ($account['link']
? $html->link($account['name'],
array('controller' => 'accounts',
'action' => 'view',
$account['id']))
: $account['name']));
if (!empty($nsf_tender['id']))
$rows[] = array('NSF Tender', $html->link($nsf_tender['name'],
array('controller' => 'tenders',
'action' => 'view',
$nsf_tender['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' ||
$transaction['type'] === 'CREDIT_NOTE' ||
$transaction['type'] === 'PAYMENT'
) {
echo $this->element('statement_entries', array
(// Grid configuration
'config' => array
(
'caption' => 'Statement Entries',
'filter' => array('Transaction.id' => $transaction['id'],
'type !=' => 'VOID'),
'exclude' => array('Transaction', 'Debit', 'Credit'),
'include' => array('Amount'),
)));
}
/**********************************************************************
* Ledger Entries
*/
if (0) {
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";