The only functional change was to start payment numbers at 1 instead of zero. All other changes are just white space and code movement.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@241 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -104,7 +104,7 @@ $grid_setup['onHeaderClick'] = array
|
|||||||
|
|
||||||
// Reset the form
|
// Reset the form
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
$('#payment-entry-id').val(0);
|
$('#payment-entry-id').val(1);
|
||||||
$('#payments').html('');
|
$('#payments').html('');
|
||||||
|
|
||||||
$("#receipt-customer-id").html("INTERNAL ERROR");
|
$("#receipt-customer-id").html("INTERNAL ERROR");
|
||||||
@@ -114,6 +114,45 @@ $grid_setup['onHeaderClick'] = array
|
|||||||
datepickerNow('TransactionStamp');
|
datepickerNow('TransactionStamp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onRowSelect(grid_id, customer_id) {
|
||||||
|
// Set the customer id that will be returned with the form
|
||||||
|
$("#customer-id").val(customer_id);
|
||||||
|
|
||||||
|
// Get the item names from the grid
|
||||||
|
$("#receipt-customer-id").html($(grid_id).getCell(customer_id, 'Customer-id'));
|
||||||
|
$("#receipt-customer-name").html($(grid_id).getCell(customer_id, 'Customer-name'));
|
||||||
|
|
||||||
|
// Make sure the redirect is up to date, if necessary
|
||||||
|
if ($("#redirectController").val() == 'customers')
|
||||||
|
$("#redirect0").val(customer_id);
|
||||||
|
|
||||||
|
// Hide the "no customer" message and show the current customer
|
||||||
|
$("#no-customer").hide();
|
||||||
|
$("#current-customer").show();
|
||||||
|
|
||||||
|
// Update the charges grid to reflect this customer
|
||||||
|
updateCharges(customer_id);
|
||||||
|
|
||||||
|
// Collapse the grid now that the user has selected
|
||||||
|
$("#customers-list .HeaderButton").click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onGridState(grid_id, state) {
|
||||||
|
if (state == 'visible') {
|
||||||
|
$("#no-customer").hide();
|
||||||
|
$("#current-customer").hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($("#customer-id").val() > 0) {
|
||||||
|
$("#current-customer").show();
|
||||||
|
$("#no-customer").hide();
|
||||||
|
} else {
|
||||||
|
$("#current-customer").hide();
|
||||||
|
$("#no-customer").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function addPaymentSource(flash) {
|
function addPaymentSource(flash) {
|
||||||
addDiv('payment-entry-id', 'payment', 'payments', flash,
|
addDiv('payment-entry-id', 'payment', 'payments', flash,
|
||||||
// HTML section
|
// HTML section
|
||||||
@@ -163,8 +202,6 @@ $grid_setup['onHeaderClick'] = array
|
|||||||
|
|
||||||
'</FIELDSET>'
|
'</FIELDSET>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchPaymentType(paymentid, type) {
|
function switchPaymentType(paymentid, type) {
|
||||||
@@ -283,44 +320,6 @@ function updateCharges(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onRowSelect(grid_id, customer_id) {
|
|
||||||
// Set the customer id that will be returned with the form
|
|
||||||
$("#customer-id").val(customer_id);
|
|
||||||
|
|
||||||
// Get the item names from the grid
|
|
||||||
$("#receipt-customer-id").html($(grid_id).getCell(customer_id, 'Customer-id'));
|
|
||||||
$("#receipt-customer-name").html($(grid_id).getCell(customer_id, 'Customer-name'));
|
|
||||||
|
|
||||||
// Make sure the redirect is up to date, if necessary
|
|
||||||
if ($("#redirectController").val() == 'customers')
|
|
||||||
$("#redirect0").val(customer_id);
|
|
||||||
|
|
||||||
// Hide the "no customer" message and show the current customer
|
|
||||||
$("#no-customer").hide();
|
|
||||||
$("#current-customer").show();
|
|
||||||
|
|
||||||
// Update the charges grid to reflect this customer
|
|
||||||
updateCharges(customer_id);
|
|
||||||
|
|
||||||
// Collapse the grid now that the user has selected
|
|
||||||
$("#customers-list .HeaderButton").click();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onGridState(grid_id, state) {
|
|
||||||
if (state == 'visible') {
|
|
||||||
$("#no-customer").hide();
|
|
||||||
$("#current-customer").hide();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($("#customer-id").val() > 0) {
|
|
||||||
$("#current-customer").show();
|
|
||||||
$("#no-customer").hide();
|
|
||||||
} else {
|
|
||||||
$("#current-customer").hide();
|
|
||||||
$("#no-customer").show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--></script>
|
--></script>
|
||||||
|
|
||||||
@@ -398,8 +397,7 @@ echo $form->submit('Generate Receipt') . "\n";
|
|||||||
<div><H4>Response</H4><div id="response-debug"></div></div>
|
<div><H4>Response</H4><div id="response-debug"></div></div>
|
||||||
<div><H4>Output</H4><div id="output-debug"></div></div>
|
<div><H4>Output</H4><div id="output-debug"></div></div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript"><!--
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#TransactionStamp")
|
$("#TransactionStamp")
|
||||||
.attr('autocomplete', 'off')
|
.attr('autocomplete', 'off')
|
||||||
@@ -451,9 +449,7 @@ echo $form->submit('Generate Receipt') . "\n";
|
|||||||
/* }); */
|
/* }); */
|
||||||
|
|
||||||
});
|
});
|
||||||
|
--></script>
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user