Files
pmgr/views/leases/refund.ctp

107 lines
3.0 KiB
PHP

<?php /* -*- mode:PHP -*- */
echo '<div class="refund input">' . "\n";
echo '<H2>Issue Refund</H2>' . "\n";
echo '<P>Enter the amount to refund, and the account to pay it from.' . "\n";
echo '<P><BR>' . "\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="refund 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;">Refundable Balance:</TD>' .
' <TD>' . FormatHelper::currency($balance) . '</TD>' .
'</TR>' . "\n");
echo ('</TABLE>' .
'</DIV>' . "\n");
echo $form->create(null, array('id' => 'refund-form',
'url' => array('controller' => 'transactions',
'action' => 'postRefund')));
// REVISIT <AP>: 20090805
// Add Tender information to log specifically _how_ refund was paid.
echo $this->element('form_table',
array('class' => "item refund 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>',
),
"amount" => array('prefix' => 'Entry.0',
'opts' =>
array('value' =>
FormatHelper::currency($balance, false, ''),
),
),
"account_id" => array('prefix' => 'Entry.0',
'name' => 'Account',
'opts' =>
array('options' => $refundAccounts,
'value' => $defaultAccount,
),
),
"comment" => array('opts' => array('size' => 50),
),
))) . "\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->end('Issue Refund');
?>
<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>