Files
pmgr/views/accounts/deposit.ctp
abijah ea1ad4764f Implemented a bank deposit routine, to transfer funds out of the till and into the bank.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@196 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-07-01 11:10:57 +00:00

59 lines
2.0 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="account deposit">' . "\n";
echo '<H2>Perform Bank Deposit</H2>' . "\n";
//pr(compact('tillableAccount', 'depositableAccount'));
echo $form->create(null, array('id' => 'deposit-form',
'url' => array('controller' => 'accounts',
'action' => 'deposit')));
$grid_setup = array();
$grid_setup['hiddengrid'] = true;
foreach ($tillableAccount AS $acct) {
//$acct = $acct['Account'];
echo ('<INPUT type="checkbox"' .
' name="data[Tillable][Ledger][id][]"' .
' value="'.$acct['CurrentLedger']['id'].'"' .
' CHECKED> ');
echo ("I have exactly " .
FormatHelper::currency($acct['Account']['stats']['Ledger']['balance']) .
" in " . ($acct['Account']['name'] === 'Cash'
? 'Cash'
: Inflector::pluralize($acct['Account']['name'])) .
" and will be depositing it all." .
"" . "\n");
echo ('<INPUT type="hidden"' .
' name="data[Tillable][Ledger]['.$acct['CurrentLedger']['id'].'][amount]"' .
' value="'.$acct['Account']['stats']['Ledger']['balance'].'"' .
'> ');
$grid_div_id = 'ledger_entries'.$acct['CurrentLedger']['id'].'-list';
echo $this->element('ledger_entries',
array('grid_div_id' => $grid_div_id,
'caption' => ('<A HREF="#" ONCLICK="$(\'#'.$grid_div_id.' .HeaderButton\').click();'.
' return false;">Items in '.$acct['Account']['name'].' Ledger</A>'),
'ledger_id' => $acct['CurrentLedger']['id'],
'no_account' => true,
'grid_setup' => $grid_setup,
//'account_id' => $acct['Account']['id'],
//'account_type' => $acct['Account']['type'],
//'account_ftype' => 'debit',
));
}
$options = array();
foreach ($depositableAccount AS $acct) {
$options[$acct['Account']['id']] = $acct['Account']['name'];
}
echo $form->input('Deposit.Account.id', array('label' => 'Deposit Account ',
'options' => $options));
echo $form->end('Perform Deposit');
/* End page div */
echo '</div>' . "\n";