Fixed url generation since it was not propogating the admin/dev routing items. Also modified the invoice at move in to exclude the customer list, and to transition directly to the receipt page afterwards.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@556 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-14 21:05:36 +00:00
parent 4472a124f5
commit 90bf9bac0a
2 changed files with 58 additions and 25 deletions

View File

@@ -91,7 +91,10 @@ function onRowSelect(grid_id, customer_id) {
// 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.
$("#receipt-customer-id").html('<A HREF="/pmgr/site/customers/view/' +
$("#receipt-customer-id").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" +
$(grid_id).getCell(customer_id, 'Customer-id').replace(/^#/,'') +
'">' +
$(grid_id).getCell(customer_id, 'Customer-id') +
@@ -406,7 +409,10 @@ Configure::write('debug', '0');
<?php if (isset($customer['id'])): ?>
$("#customer-id").val(<?php echo $customer['id']; ?>);
//$("#receipt-customer-id").html("<?php echo '#'.$customer['id']; ?>");
$("#receipt-customer-id").html('<A HREF="/pmgr/site/customers/view/' +
$("#receipt-customer-id").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" +
"<?php echo $customer['id']; ?>" +
'">#' +
"<?php echo $customer['id']; ?>" +
@@ -421,6 +427,11 @@ Configure::write('debug', '0');
resetForm();
datepickerNow('TransactionStamp');
<?php if ($this->params['dev']): ?>
$('#output-debug').html('Post Output');
$('#output-debug').show();
<?php endif; ?>
});
--></script>

View File

@@ -64,9 +64,15 @@ function showResponse(responseText, statusText) {
if (!$("#repeat").attr("checked")) {
window.location.href =
<?php if (empty($movein)): ?>
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" + $("#lease-id").val();
<?php else: ?>
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'receipt')); ?>"
+ "/" + $("#lease-id").val();
<?php endif; ?>
return;
}
@@ -99,7 +105,10 @@ function onRowSelect(grid_id, lease_id) {
// 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/' +
$("#invoice-lease").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" +
$(grid_id).getCell(lease_id, 'Lease-id').replace(/^#/,'') +
'">' +
$(grid_id).getCell(lease_id, 'Lease-number') +
@@ -198,6 +207,7 @@ function addChargeSource(flash) {
// Re-Enable warnings
Configure::write('debug', $saved_debug_state);
if (empty($movein))
echo $this->element('leases', array
('config' => array
('grid_div_id' => 'leases-list',
@@ -266,10 +276,13 @@ echo $this->element('form_table',
/* echo '</fieldset>' . "\n"; */
if (empty($movein)) {
echo "<BR>\n";
echo $form->input('repeat', array('type' => 'checkbox',
'id' => 'repeat',
'label' => 'Enter Multiple Invoices')) . "\n";
}
echo $form->submit('Generate Invoice') . "\n";
?>
@@ -386,7 +399,10 @@ Configure::write('debug', '0');
<?php if (isset($lease['id'])): ?>
$("#lease-id").val(<?php echo $lease['id']; ?>);
//$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>");
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' +
$("#invoice-lease").html('<A HREF="' +
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" +
"<?php echo $lease['id']; ?>" +
'">#' +
"<?php echo $lease['number']; ?>" +
@@ -400,6 +416,12 @@ Configure::write('debug', '0');
<?php else: ?>
onGridState(null, 'visible');
<?php endif; ?>
<?php if ($this->params['dev']): ?>
$('#output-debug').html('Post Output');
$('#output-debug').show();
<?php endif; ?>
});
--></script>