git-svn-id: file:///svn-source/pmgr/branches/pre_0.1_work_20090819@740 97e9348a-65ac-dc4b-aefc-98561f571b83
130 lines
4.1 KiB
PHP
130 lines
4.1 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', $html->link($account['name'],
|
|
array('controller' => 'accounts',
|
|
'action' => 'view',
|
|
$account['id'])));
|
|
$rows[] = array('Ledger', $html->link('#' . $ledger['sequence'],
|
|
array('controller' => 'ledgers',
|
|
'action' => 'view',
|
|
$ledger['id'])));
|
|
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
|
|
*/
|
|
|
|
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";
|