Moved deposit creation to the transactions controller. Added the ability to view prior deposit slips.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@418 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
67
views/transactions/deposit_slip.ctp
Normal file
67
views/transactions/deposit_slip.ctp
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
//style="display:inline;
|
||||
echo('<H2 style="display:inline;">Deposit Slip: ' .
|
||||
FormatHelper::datetime($deposit['Transaction']['stamp'])
|
||||
. '</H2>' . "\n");
|
||||
/* echo('(' . */
|
||||
/* FormatHelper::age($deposit['Transaction']['stamp'], 60) */
|
||||
/* . ')<BR>' . "\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($type['count'], 'Item'),
|
||||
FormatHelper::currency($type['total'], true));
|
||||
}
|
||||
$row_class[] = 'grand';
|
||||
$rows[] = array('Deposit Total:',
|
||||
null,
|
||||
FormatHelper::currency($deposit['Transaction']['amount'], 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
|
||||
if (0) {
|
||||
foreach ($deposit['types'] AS $type) {
|
||||
echo $this->element('tenders', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'grid_div_id' => "tenders-{$type['id']}-list",
|
||||
'caption' => $type['name'] . ' Items',
|
||||
'filter' => array('Tender.deposit_transaction_id'
|
||||
=> $deposit['Transaction']['id'],
|
||||
'Tender.tender_type_id'
|
||||
=> $type['id'],
|
||||
),
|
||||
'exclude' => array('Type'),
|
||||
)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo $this->element('tenders', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' => 'Deposited Items',
|
||||
'filter' => array('Tender.deposit_transaction_id'
|
||||
=> $deposit['Transaction']['id'],
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
/* End page div */
|
||||
//echo '</div>' . "\n";
|
||||
@@ -94,19 +94,19 @@ echo $this->element('ledger_entries', array
|
||||
)));
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Tenders Deposited
|
||||
*/
|
||||
/* /\********************************************************************** */
|
||||
/* * Tenders Deposited */
|
||||
/* *\/ */
|
||||
|
||||
if ($transaction['type'] === 'DEPOSIT') {
|
||||
echo $this->element('tenders', array
|
||||
(// Grid configuration
|
||||
'config' => array
|
||||
(
|
||||
'caption' => 'Deposited Items',
|
||||
'filter' => array('Tender.deposit_transaction_id' => $transaction['id']),
|
||||
)));
|
||||
}
|
||||
/* if ($transaction['type'] === 'DEPOSIT') { */
|
||||
/* echo $this->element('tenders', array */
|
||||
/* (// Grid configuration */
|
||||
/* 'config' => array */
|
||||
/* ( */
|
||||
/* 'caption' => 'Deposited Items', */
|
||||
/* 'filter' => array('Tender.deposit_transaction_id' => $transaction['id']), */
|
||||
/* ))); */
|
||||
/* } */
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user