Added confirmation to the NSF functionality, as well as a timestamp field instead of forcing time=now.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@513 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
74
views/tenders/nsf.ctp
Normal file
74
views/tenders/nsf.ctp
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<div class="nsf input">' . "\n";
|
||||
|
||||
$customer = $tender['Customer'];
|
||||
$entry = $tender['LedgerEntry'];
|
||||
$transaction = $entry['Transaction'];
|
||||
|
||||
if (isset($tender['Tender']))
|
||||
$tender = $tender['Tender'];
|
||||
|
||||
// We're not actually using a grid to select the customer,
|
||||
// but selection-text makes for reasonable formatting
|
||||
echo ('<DIV CLASS="nsf grid-selection-text">' .
|
||||
'<TABLE>' . "\n");
|
||||
|
||||
echo ('<TR><TD style="padding-right: 1em;">' . $customer['name'] . '</TD>' .
|
||||
' <TD>' . '(Customer #' . $customer['id'] . ')' . '</TD>' .
|
||||
'</TR>' . "\n");
|
||||
|
||||
echo ('<TR><TD style="padding-right: 1em;">' . $tender['name'] . '</TD>' .
|
||||
' <TD>' . '(Tender #' . $tender['id'] . ')' . '</TD>' .
|
||||
'</TR>' . "\n");
|
||||
|
||||
echo ('<TR><TD style="padding-right: 1em;">Amount:</TD>' .
|
||||
' <TD>' . FormatHelper::currency($entry['amount']) . '</TD>' .
|
||||
'</TR>' . "\n");
|
||||
|
||||
echo ('</TABLE>' .
|
||||
'</DIV>' . "\n");
|
||||
|
||||
|
||||
echo $form->create(null, array('id' => 'nsf-form',
|
||||
'url' => array('action' => 'nsf'))) . "\n";
|
||||
|
||||
echo $form->input("Tender.id",
|
||||
array('type' => 'hidden',
|
||||
'value' => $tender['id'])) . "\n";
|
||||
|
||||
echo $this->element('form_table',
|
||||
array('class' => "item receipt transaction entry",
|
||||
//'with_name_after' => ':',
|
||||
'field_prefix' => 'Transaction',
|
||||
'fields' => array
|
||||
("stamp" => array('opts' => array('type' => 'text'),
|
||||
'between' => '<A HREF="#" ONCLICK="datepickerNow(\'TransactionStamp\'); return false;">Now</A>',
|
||||
),
|
||||
"comment" => array('opts' => array('size' => 50),
|
||||
),
|
||||
))) . "\n";
|
||||
|
||||
echo $form->end('Record Item as NSF');
|
||||
?>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
|
||||
// Reset the form
|
||||
function resetForm() {
|
||||
datepickerNow('TransactionStamp');
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#TransactionStamp")
|
||||
.attr('autocomplete', 'off')
|
||||
.datepicker({ constrainInput: true,
|
||||
numberOfMonths: [1, 1],
|
||||
showCurrentAtPos: 0,
|
||||
dateFormat: 'mm/dd/yy' });
|
||||
|
||||
resetForm();
|
||||
});
|
||||
--></script>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user