Changed the invoice page to redirect back to the customer view, which is typically more of interest than the lease view

git-svn-id: file:///svn-source/pmgr/branches/v0.3_work/site@980 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2010-04-02 12:24:34 +00:00
parent 45ed9bd7a3
commit 65b6d582d9
2 changed files with 12 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
$cols = array();
$cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id');
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname', 'align' => 'center');
$cols['Customer id'] = array('index' => 'Customer.id', 'hidden' => true);
$cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname');
$cols['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency');
$cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency');

View File

@@ -111,13 +111,13 @@ function showResponse(responseText, statusText) {
if (!$("#repeat").attr("checked")) {
window.location.href =
<?php if (empty($movein)): ?>
"<?php echo $html->url(array('controller' => 'leases',
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" + $("#lease-id").val();
+ "/" + $("#customer-id").val();
<?php else: ?>
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'receipt')); ?>"
+ "/" + "<?php echo $customer['id']; ?>";
+ "/" + $("#customer-id").val();
<?php endif; ?>
return;
}
@@ -144,6 +144,7 @@ function resetForm(nocharge) {
function onRowSelect(grid_id, lease_id) {
// Set the item id that will be returned with the form
$("#lease-id").val(lease_id);
$("#customer-id").val($(grid_id).getCell(lease_id, 'Customer-id'));
$("#invoice-lease").html($(grid_id).getCell(lease_id, 'Lease-number'));
$("#invoice-unit").html($(grid_id).getCell(lease_id, 'Unit-name'));
@@ -362,11 +363,10 @@ echo $form->input("Lease.id",
'type' => 'hidden',
'value' => 0));
if (!empty($movein))
echo $form->input("Customer.id",
array('id' => 'customer-id',
'type' => 'hidden',
'value' => $customer['id']));
echo $form->input("Customer.id",
array('id' => 'customer-id',
'type' => 'hidden',
'value' => 0));
/* echo '<fieldset CLASS="invoice">' . "\n"; */
/* echo ' <legend>Invoice</legend>' . "\n"; */
@@ -433,6 +433,8 @@ Configure::write('debug', '0');
<?php if (isset($lease['id'])): ?>
$("#lease-id").val(<?php echo $lease['id']; ?>);
$("#customer-id").val(<?php echo $customer['id']; ?>);
$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>");
$("#invoice-unit").html("<?php echo $unit['name']; ?>");
$("#invoice-customer").html("<?php echo $customer['name']; ?>");
@@ -450,6 +452,7 @@ Configure::write('debug', '0');
<?php else: ?>
$("#lease-id").val(0);
$("#customer-id").val(<?php echo empty($movein) ? 0 : $customer['id']; ?>);
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");