Made layout changes to invoices and receipts to use CSS instead of simple H2/H3 tags. Also, as a temporary measure, I make the lease/customer numbers hyperlink to the view page. At some point we'll figure out what should happen after entering a receipt or invoice, and this hack should go away.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@270 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -115,7 +115,16 @@ function onRowSelect(grid_id, lease_id) {
|
||||
$("#lease-id").val(lease_id);
|
||||
|
||||
// Get the item names from the grid
|
||||
$("#invoice-lease").html($(grid_id).getCell(lease_id, 'Lease-number'));
|
||||
//$("#invoice-lease").html($(grid_id).getCell(lease_id, 'Lease-number'));
|
||||
// REVISIT <AP>: 20090708
|
||||
// This is not intended as a long term solution,
|
||||
// but I need a way to enter data and then view
|
||||
// the results. This link will help.
|
||||
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' +
|
||||
$(grid_id).getCell(lease_id, 'Lease-id').replace(/^#/,'') +
|
||||
'">' +
|
||||
$(grid_id).getCell(lease_id, 'Lease-number') +
|
||||
'</A>');
|
||||
$("#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'));
|
||||
@@ -125,8 +134,8 @@ function onRowSelect(grid_id, lease_id) {
|
||||
: '-');
|
||||
|
||||
// Hide the "no lease" message and show the current lease
|
||||
$("#no-lease").hide();
|
||||
$("#current-lease").show();
|
||||
$(".lease-selection-invalid").hide();
|
||||
$(".lease-selection-valid").show();
|
||||
|
||||
// Collapse the grid now that the user has selected
|
||||
$("#leases-list .HeaderButton").click();
|
||||
@@ -134,16 +143,16 @@ function onRowSelect(grid_id, lease_id) {
|
||||
|
||||
function onGridState(grid_id, state) {
|
||||
if (state == 'visible') {
|
||||
$("#no-lease").hide();
|
||||
$("#current-lease").hide();
|
||||
$(".lease-selection-invalid").hide();
|
||||
$(".lease-selection-valid").hide();
|
||||
}
|
||||
else {
|
||||
if ($("#lease-id").val() > 0) {
|
||||
$("#current-lease").show();
|
||||
$("#no-lease").hide();
|
||||
$(".lease-selection-valid").show();
|
||||
$(".lease-selection-invalid").hide();
|
||||
} else {
|
||||
$("#current-lease").hide();
|
||||
$("#no-lease").show();
|
||||
$(".lease-selection-valid").hide();
|
||||
$(".lease-selection-invalid").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,47 +225,28 @@ echo $this->element('leases', array
|
||||
'limit' => 10,
|
||||
)));
|
||||
|
||||
echo ('<SPAN id="current-lease" style="display:none">' .
|
||||
'<DIV>' .
|
||||
'<H2>' .
|
||||
echo ('<DIV CLASS="invoice grid-selection-text">' .
|
||||
|
||||
'<DIV CLASS="lease-selection-valid" style="display:none">' .
|
||||
'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>' .
|
||||
'<DIV CLASS="supporting">' .
|
||||
'<TABLE>' .
|
||||
'<TR><TD CLASS="field">Rent:</TD><TD CLASS="value"><SPAN id="invoice-rent"></SPAN></TD></TR>' .
|
||||
'<TR><TD CLASS="field">Late Fee:</TD><TD CLASS="value"><SPAN id="invoice-late"></SPAN></TD></TR>' .
|
||||
'<TR><TD CLASS="field">Deposit:</TD><TD CLASS="value"><SPAN id="invoice-deposit"></SPAN></TD></TR>' .
|
||||
'</TABLE>' .
|
||||
'</H3>' .
|
||||
'<BR />' .
|
||||
'</DIV>' .
|
||||
|
||||
'</DIV>' .
|
||||
'</SPAN>' .
|
||||
'<SPAN id="no-lease" style="display:none">' .
|
||||
'<H2>' .
|
||||
|
||||
'<DIV CLASS="lease-selection-invalid" style="display:none">' .
|
||||
'Please select lease' .
|
||||
'</H2>' .
|
||||
'</SPAN>' .
|
||||
"\n");
|
||||
'</DIV>' .
|
||||
|
||||
'</DIV>' . "\n");
|
||||
|
||||
echo $form->create(null, array('id' => 'invoice-form',
|
||||
'url' => array('controller' => 'transactions',
|
||||
@@ -316,7 +306,12 @@ echo $form->submit('Generate Invoice') . "\n";
|
||||
|
||||
<?php if (isset($lease['Lease']['id'])): ?>
|
||||
$("#lease-id").val(<?php echo $lease['Lease']['id']; ?>);
|
||||
$("#invoice-lease").html("<?php echo '#'.$lease['Lease']['number']; ?>");
|
||||
//$("#invoice-lease").html("<?php echo '#'.$lease['Lease']['number']; ?>");
|
||||
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' +
|
||||
"<?php echo $lease['Lease']['id']; ?>" +
|
||||
'">#' +
|
||||
"<?php echo $lease['Lease']['number']; ?>" +
|
||||
'</A>');
|
||||
$("#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']); ?>");
|
||||
|
||||
Reference in New Issue
Block a user