Added mechanism for user to know the rent amount on the invoice screen.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@250 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-07 09:00:54 +00:00
parent 54ded6173a
commit f4319364f2
3 changed files with 54 additions and 14 deletions

View File

@@ -256,14 +256,6 @@ class LeasesController extends AppController {
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
$this->sidemenu_links[] =
array('name' => 'Assess Rent', 'url' => array('action' => 'invoice',
$id, 'rent'));
$this->sidemenu_links[] =
array('name' => 'Assess Late Charge', 'url' => array('action' => 'invoice',
$id, 'late'));
if (!isset($lease['Lease']['moveout_date'])) {
$this->sidemenu_links[] =
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
@@ -271,9 +263,13 @@ class LeasesController extends AppController {
}
$this->sidemenu_links[] =
array('name' => 'Payment', 'url' => array('controller' => 'customers',
'action' => 'receipt',
$lease['Customer']['id']));
array('name' => 'Charges', 'url' => array('action' => 'invoice',
$id));
$this->sidemenu_links[] =
array('name' => 'Payments', 'url' => array('controller' => 'customers',
'action' => 'receipt',
$id));
}
// Prepare to render

View File

@@ -6,6 +6,8 @@ $cols['LeaseID'] = array('index' => 'Lease.id', 'hidden' => true);
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
$cols['Unit'] = array('index' => 'Unit.name', 'width' => '50', 'align' => 'center');
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency', 'hidden' => true);
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency', 'hiddenz' => true);
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');

View File

@@ -101,6 +101,9 @@ function resetForm() {
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");
$("#invoice-rent").html("INTERNAL ERROR");
$("#invoice-late").html("INTERNAL ERROR");
$("#invoice-deposit").html("INTERNAL ERROR");
addChargeSource(false);
datepickerNow('charge_date');
@@ -116,6 +119,11 @@ function onRowSelect(grid_id, lease_id) {
$("#invoice-lease").html($(grid_id).getCell(lease_id, 'Lease-number'));
$("#invoice-unit").html($(grid_id).getCell(lease_id, 'Unit-name'));
$("#invoice-customer").html($(grid_id).getCell(lease_id, 'Customer-name'));
$("#invoice-rent").html($(grid_id).getCell(lease_id, 'Lease-rent'));
$("#invoice-late").html('$10.00');
$("#invoice-deposit").html($(grid_id).getCell(lease_id, 'Lease-deposit')
? $(grid_id).getCell(lease_id, 'Lease-deposit')
: '-');
// Hide the "no lease" message and show the current lease
$("#no-lease").hide();
@@ -185,16 +193,47 @@ echo $this->element('leases',
'limit' => 10,
));
echo ('<H2>' .
'<SPAN id="current-lease" style="display:none">' .
echo ('<SPAN id="current-lease" style="display:none">' .
'<DIV>' .
'<H2>' .
'Lease <SPAN id="invoice-lease"></SPAN>' . ' / ' .
'Unit: <SPAN id="invoice-unit"></SPAN>' . ' / ' .
'Customer: <SPAN id="invoice-customer"></SPAN>' .
'</H2>' .
'</DIV>' .
'<DIV>' .
/* '<H3>' . */
/* 'Rent: <SPAN id="invoice-rent"></SPAN>' . */
/* '<BR>' . */
/* 'Late Fee: <SPAN id="invoice-late"></SPAN>' . */
/* '<BR>' . */
/* 'Deposit: <SPAN id="invoice-deposit"></SPAN>' . */
/* '</H3>' . */
/* '<H3>' . */
/* 'Rent: <SPAN id="invoice-rent"></SPAN>' . ' / ' . */
/* 'Late Fee: <SPAN id="invoice-late"></SPAN>' . ' / ' . */
/* 'Deposit: <SPAN id="invoice-deposit"></SPAN>' . */
/* '</H3>' . */
'<H3>' .
'<TABLE BORDER=0>' .
'<TR><TD style="width:5em;">Rent:</TD><TD><SPAN id="invoice-rent"></SPAN></TD></TR>' .
'<TR><TD>Late Fee:</TD><TD><SPAN id="invoice-late"></SPAN></TD></TR>' .
'<TR><TD>Deposit:</TD><TD><SPAN id="invoice-deposit"></SPAN></TD></TR>' .
'</TABLE>' .
'</H3>' .
'<BR />' .
'</DIV>' .
'</SPAN>' .
'<SPAN id="no-lease" style="display:none">' .
'<H2>' .
'Please select lease' .
'</H2>' .
'</SPAN>' .
'</H2>' . "\n");
"\n");
echo $form->create(null, array('id' => 'invoice-form',
'url' => array('controller' => 'transactions',
@@ -270,6 +309,9 @@ echo $form->submit('Generate Invoice') . "\n";
$("#invoice-lease").html("<?php echo '#'.$lease['Lease']['number']; ?>");
$("#invoice-unit").html("<?php echo $lease['Unit']['name']; ?>");
$("#invoice-customer").html("<?php echo $lease['Customer']['name']; ?>");
$("#invoice-rent").html("<?php echo FormatHelper::currency($lease['Lease']['rent']); ?>");
$("#invoice-late").html('$10.00');
$("#invoice-deposit").html("<?php echo FormatHelper::currency($lease['Lease']['deposit']); ?>");
onGridState(null, 'hidden');
<?php else: ?>
onGridState(null, 'visible');