git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605/site@81 97e9348a-65ac-dc4b-aefc-98561f571b83
89 lines
2.7 KiB
PHP
89 lines
2.7 KiB
PHP
<?php /* -*- mode:PHP -*- */ ?>
|
|
|
|
<div class="transaction view">
|
|
|
|
<?php
|
|
; // Editor alignment
|
|
|
|
/**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
* Transaction Detail Main Section
|
|
*/
|
|
|
|
$rows = array(array('ID', $transaction['Transaction']['id']),
|
|
array('Timestamp', FormatHelper::datetime($transaction['Transaction']['stamp'])),
|
|
array('Comment', $transaction['Transaction']['comment']));
|
|
|
|
echo $this->element('table',
|
|
array('class' => 'item transaction detail',
|
|
'caption' => 'Transaction Info',
|
|
'rows' => $rows,
|
|
'column_class' => array('field', 'value')));
|
|
|
|
|
|
/**********************************************************************
|
|
* Transaction Info Box
|
|
*/
|
|
|
|
?>
|
|
<DIV CLASS="infobox">
|
|
<DIV CLASS="summary grand debit">
|
|
Debits: <?php echo FormatHelper::currency($debitAmount); ?>
|
|
</DIV>
|
|
<DIV CLASS="summary grand credit">
|
|
Credits: <?php echo FormatHelper::currency($creditAmount); ?>
|
|
</DIV>
|
|
</DIV>
|
|
|
|
<DIV CLASS="detail supporting">
|
|
<?php
|
|
; // Editor alignment
|
|
|
|
/**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
**********************************************************************
|
|
* Supporting Elements Section
|
|
*/
|
|
|
|
|
|
/**********************************************************************
|
|
* Entries
|
|
*/
|
|
|
|
$headers = array('Name', 'Debit', 'Credit', 'Comment', 'Amount', 'Total');
|
|
$rows = array();
|
|
$running_total = 0;
|
|
foreach($transaction['LedgerEntry'] AS $entry) {
|
|
$amount = $entry['amount'];
|
|
$running_total += $amount;
|
|
$rows[] = array($entry['name'],
|
|
$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' => $headers));
|
|
|
|
|
|
/* End "detail supporting" DIV */ ?>
|
|
</DIV>
|
|
|
|
</div>
|