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:
@@ -8,8 +8,8 @@ echo '<P><BR>' . "\n";
|
|||||||
//pr(compact('depositTypes', 'depositAccounts'));
|
//pr(compact('depositTypes', 'depositAccounts'));
|
||||||
|
|
||||||
echo $form->create(null, array('id' => 'deposit-form',
|
echo $form->create(null, array('id' => 'deposit-form',
|
||||||
'url' => array(//'controller' => 'accounts',
|
'url' => array('controller' => 'transactions',
|
||||||
'action' => 'deposit_slip')));
|
'action' => 'postDeposit')));
|
||||||
|
|
||||||
foreach ($depositTypes AS $type) {
|
foreach ($depositTypes AS $type) {
|
||||||
//$acct = $acct['Account'];
|
//$acct = $acct['Account'];
|
||||||
@@ -25,6 +25,17 @@ foreach ($depositTypes AS $type) {
|
|||||||
" in " . Inflector::pluralize($type['name']) .
|
" in " . Inflector::pluralize($type['name']) .
|
||||||
" and will be depositing it all.")
|
" and will be depositing it all.")
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// REVISIT <AP>: 20090729
|
||||||
|
// Would like to present an option for the user to close the ledger
|
||||||
|
// associated with the form of tender, or to just leave it open.
|
||||||
|
// For now, just leave it open
|
||||||
|
echo "\n";
|
||||||
|
echo $form->input("TenderType.{$type['id']}.close",
|
||||||
|
array('type' => 'hidden',
|
||||||
|
'value' => false,
|
||||||
|
));
|
||||||
|
|
||||||
echo "\n";
|
echo "\n";
|
||||||
echo $form->input("TenderType.{$type['id']}.amount",
|
echo $form->input("TenderType.{$type['id']}.amount",
|
||||||
array('type' => 'hidden',
|
array('type' => 'hidden',
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
<?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";
|
|
||||||
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') {
|
/* if ($transaction['type'] === 'DEPOSIT') { */
|
||||||
echo $this->element('tenders', array
|
/* echo $this->element('tenders', array */
|
||||||
(// Grid configuration
|
/* (// Grid configuration */
|
||||||
'config' => array
|
/* 'config' => array */
|
||||||
(
|
/* ( */
|
||||||
'caption' => 'Deposited Items',
|
/* 'caption' => 'Deposited Items', */
|
||||||
'filter' => array('Tender.deposit_transaction_id' => $transaction['id']),
|
/* 'filter' => array('Tender.deposit_transaction_id' => $transaction['id']), */
|
||||||
)));
|
/* ))); */
|
||||||
}
|
/* } */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user