git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@486 97e9348a-65ac-dc4b-aefc-98561f571b83
90 lines
2.5 KiB
PHP
90 lines
2.5 KiB
PHP
<?php /* -*- mode:PHP -*- */
|
|
|
|
echo '<div class="bad-debt input">' . "\n";
|
|
|
|
if (isset($lease)) {
|
|
$customer = $lease['Customer'];
|
|
$unit = $lease['Unit'];
|
|
}
|
|
|
|
if (isset($customer['Customer']))
|
|
$customer = $customer['Customer'];
|
|
|
|
if (isset($lease['Lease']))
|
|
$lease = $lease['Lease'];
|
|
|
|
// We're not actually using a grid to select the customer / lease
|
|
// but we could/should be, and the result would be selection-text
|
|
echo ('<DIV CLASS="bad-debt grid-selection-text">' .
|
|
'<TABLE>' . "\n");
|
|
|
|
echo ('<TR><TD style="padding-right: 1em;">' . $customer['name'] . '</TD>' .
|
|
' <TD>' . '(Customer #' . $customer['id'] . ')' . '</TD>' .
|
|
'</TR>' . "\n");
|
|
|
|
if (isset($lease))
|
|
echo ('<TR><TD style="padding-right: 1em;">' . 'Unit ' . $unit['name'] . '</TD>' .
|
|
' <TD>' . '(Lease #' . $lease['number'] . ')' . '</TD>' .
|
|
'</TR>' . "\n");
|
|
|
|
echo ('<TR><TD style="padding-right: 1em;">Remaining Balance:</TD>' .
|
|
' <TD>' . FormatHelper::currency($balance) . '</TD>' .
|
|
'</TR>' . "\n");
|
|
|
|
echo ('</TABLE>' .
|
|
'</DIV>' . "\n");
|
|
|
|
|
|
echo $form->create(null, array('id' => 'receipt-form',
|
|
'url' => array('controller' => 'transactions',
|
|
'action' => 'postWriteOff'))) . "\n";
|
|
|
|
echo $form->input("Customer.id",
|
|
array('type' => 'hidden',
|
|
'value' => $customer['id'])) . "\n";
|
|
|
|
if (isset($lease['id']))
|
|
echo $form->input("Lease.id",
|
|
array('type' => 'hidden',
|
|
'value' => $lease['id'])) . "\n";
|
|
|
|
echo $form->input("Entry.0.amount",
|
|
array('type' => 'hidden',
|
|
'value' => $balance)) . "\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('Write Off Remaining Balance');
|
|
?>
|
|
|
|
<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>
|