git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@430 97e9348a-65ac-dc4b-aefc-98561f571b83
79 lines
3.0 KiB
PHP
79 lines
3.0 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
echo '<div class="tender deposit">' . "\n";
|
|
echo '<H2>Perform Bank Deposit</H2>' . "\n";
|
|
echo '<P>Make sure to select the checkboxes below for only those types of currency (Cash, Check, etc) which you intend to actually deposit (you can see all the individual items by dropping down the list below the checkbox). Then, select the Deposit Account where you will make the deposit, and click "Perform Deposit" to close the books on the selected currency types and reset them to a zero balance. On the next page, you will be provided with a deposit slip to prepare the actual deposit.' . "\n";
|
|
echo '<P><BR>' . "\n";
|
|
|
|
//pr(compact('depositTypes', 'depositAccounts'));
|
|
|
|
echo $form->create(null, array('id' => 'deposit-form',
|
|
'url' => array('controller' => 'transactions',
|
|
'action' => 'postDeposit')));
|
|
|
|
foreach ($depositTypes AS $type) {
|
|
//$acct = $acct['Account'];
|
|
|
|
echo "\n";
|
|
echo $form->input("TenderType.{$type['id']}.checked",
|
|
array(//'label' => $type['name'],
|
|
'type' => 'checkbox',
|
|
'checked' => $type['stats']['undeposited'] > 0 ? true : false,
|
|
'disabled' => $type['stats']['undeposited'] > 0 ? false : true,
|
|
'value' => true,
|
|
'label' => (" I have exactly " .
|
|
FormatHelper::currency($type['stats']['undeposited']) .
|
|
" in " . Inflector::pluralize($type['name']) .
|
|
" 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' => true,
|
|
));
|
|
|
|
echo "\n";
|
|
echo $form->input("TenderType.{$type['id']}.amount",
|
|
array('type' => 'hidden',
|
|
'value' => $type['stats']['undeposited'],
|
|
));
|
|
echo "\n";
|
|
echo $form->input("TenderType.{$type['id']}.id",
|
|
array('type' => 'hidden',
|
|
'value' => $type['id'],
|
|
));
|
|
echo "\n";
|
|
echo $form->input("TenderType.{$type['id']}.name",
|
|
array('type' => 'hidden',
|
|
'value' => $type['name'],
|
|
));
|
|
echo "\n";
|
|
|
|
$grid_div_id = "tenders-{$type['id']}-list";
|
|
echo $this->element('tenders', array
|
|
(// Grid configuration
|
|
'config' => array
|
|
(
|
|
'grid_div_id' => $grid_div_id,
|
|
'grid_setup' => array('hiddengrid' => true),
|
|
'caption' => ('<A HREF="#" ONCLICK="$(\'#'.$grid_div_id.' .HeaderButton\').click();'.
|
|
' return false;">Items in '.$type['name'].' Ledger</A>'),
|
|
'filter' => array('deposit_transaction_id' => null,
|
|
'TenderType.id' => $type['id']),
|
|
'exclude' => array('Type'),
|
|
),
|
|
));
|
|
}
|
|
|
|
echo $form->input('Deposit.Account.id', array('label' => 'Deposit Account ',
|
|
'options' => $depositAccounts));
|
|
echo $form->end('Perform Deposit');
|
|
|
|
/* End page div */
|
|
echo '</div>' . "\n";
|