Re-implemented the deposit functionality. This is mostly working, although I'd like to get customer added to the tenders table, and probably change to a single deposit ledger entry for each tender type. A single entry would require that all tender types have been recorded to the same account, something that isn't mandated at the present, but is likely to be true most of the time. Perhaps they could just be grouped by account id, which should work in all cases and yet align with tender type 99% of the time. I'll have to think about it.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@412 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
51
site/views/tenders/deposit_slip.ctp
Normal file
51
site/views/tenders/deposit_slip.ctp
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<H2>Deposit Slip: ' . date('l, F jS, Y, g:ia') . '</H2>' . "\n";
|
||||
|
||||
//pr(compact('deposit'));
|
||||
|
||||
// Handle account summaries
|
||||
$rows = array();
|
||||
$row_class = array();
|
||||
foreach ($deposit['types'] AS $type) {
|
||||
$row_class[] = array();
|
||||
$rows[] = array($type['name'].':',
|
||||
FormatHelper::_n(count($type['entries']), 'Item'),
|
||||
FormatHelper::currency($type['total'], true));
|
||||
}
|
||||
$row_class[] = 'grand';
|
||||
$rows[] = array('Deposit Total:',
|
||||
null,
|
||||
FormatHelper::currency($deposit['total'], true));
|
||||
echo $this->element('table',
|
||||
array('class' => 'deposit-summary',
|
||||
'rows' => $rows,
|
||||
'row_class' => $row_class,
|
||||
'column_class' => array('account', 'quantity', 'total'),
|
||||
'suppress_alternate_rows' => true,
|
||||
));
|
||||
|
||||
|
||||
// Print out the items of each ledger
|
||||
foreach ($deposit['types'] AS $type) {
|
||||
if (count($type['entries']) == 0)
|
||||
continue;
|
||||
|
||||
$rows = array();
|
||||
foreach ($type['entries'] AS $entry) {
|
||||
$rows[] = array($entry['customer'],
|
||||
$entry['name'],
|
||||
$entry['amount']);
|
||||
}
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item deposit-slip list',
|
||||
'caption' => $type['name'] . ' Items',
|
||||
'rows' => $rows,
|
||||
'headers' => array('Customer', 'Item', 'Amount'),
|
||||
'column_class' => array('customer', 'item', 'amount'),
|
||||
));
|
||||
}
|
||||
|
||||
/* End page div */
|
||||
//echo '</div>' . "\n";
|
||||
Reference in New Issue
Block a user