2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2010 Z&H Consultancy Services Private Limited <sam@zhservices.com>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
18 // A copy of the GNU General Public License is included along with this program:
19 // openemr/interface/login/GnuGPL.html
20 // For more information write to the Free Software
21 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // Author: Eldho Chacko <eldho@zhservices.com>
24 // Paul Simon K <paul@zhservices.com>
26 // +------------------------------------------------------------------------------+
27 //===============================================================================
28 //This section handles payment related javascript functios.Add, Search and Edit screen uses these functions.
29 //===============================================================================
32 function CheckVisible(MakeBlank
) {//Displays and hides the check number text box.Add and edit page uses the same function.
33 //In edit its value should not be lost on just a change.It is controlled be the 'MakeBlank' argument.
34 if (document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'check_payment' ||
35 document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'bank_draft') {
36 document
.getElementById('div_check_number').style
.display
= 'none';
37 document
.getElementById('check_number').style
.display
= '';
39 document
.getElementById('div_check_number').style
.display
= '';
40 if (MakeBlank
== 'yes') {//In Add page clearing the field is done.
41 document
.getElementById('check_number').value
= '';
43 document
.getElementById('check_number').style
.display
= 'none';
47 function PayingEntityAction() {
48 //Which ajax is to be active(patient,insurance), is decided by the 'Paying Entity' drop down, where this function is called.
49 //So on changing some initialization is need.Done below.
50 document
.getElementById('type_code').value
= '';
51 document
.getElementById('hidden_ajax_close_value').value
= '';
52 document
.getElementById('hidden_type_code').value
= '';
53 document
.getElementById('div_insurance_or_patient').innerHTML
= ' ';
54 document
.getElementById('description').value
= '';
55 if (document
.getElementById('ajax_div_insurance')) {
56 $
("#ajax_div_patient_error").empty();
57 $
("#ajax_div_patient").empty();
58 $
("#ajax_div_insurance_error").empty();
59 $
("#ajax_div_insurance").empty();
60 $
("#ajax_div_insurance").hide();
61 document
.getElementById('payment_method').style
.display
= '';
63 //As per the selected value, one value is selected in the 'Payment Category' drop down.
64 if (document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
== 'patient') {
65 document
.getElementById('adjustment_code').value
= 'patient_payment';
66 } else if (document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
== 'insurance') {
67 document
.getElementById('adjustment_code').value
= 'insurance_payment';
69 //As per the selected value, certain values are not selectable in the 'Payment Category' drop down.They are greyed out.
70 var list = document
.getElementById('type_name');
71 var newValue
= (list.options
[list.selectedIndex
].value
);
72 if (newValue
== 'patient') {
73 if (document
.getElementById('option_insurance_payment'))
74 document
.getElementById('option_insurance_payment').style
.backgroundColor
= '#DEDEDE';
75 if (document
.getElementById('option_family_payment'))
76 document
.getElementById('option_family_payment').style
.backgroundColor
= 'var(--white)';
77 if (document
.getElementById('option_patient_payment'))
78 document
.getElementById('option_patient_payment').style
.backgroundColor
= 'var(--white)';
80 if (newValue
== 'insurance') {
81 if (document
.getElementById('option_family_payment'))
82 document
.getElementById('option_family_payment').style
.backgroundColor
= '#DEDEDE';
83 if (document
.getElementById('option_patient_payment'))
84 document
.getElementById('option_patient_payment').style
.backgroundColor
= '#DEDEDE';
85 if (document
.getElementById('option_insurance_payment'))
86 document
.getElementById('option_insurance_payment').style
.backgroundColor
= 'var(--white)';
90 function FilterSelection(listSelected
) {
91 //function PayingEntityAction() greyed out certain values as per the selection in the 'Paying Entity' drop down.
92 //When the same are selected in the 'Payment Category' drop down, this function reverts back to the old value.
94 if (document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
== 'patient') {
95 ValueToPut
= 'patient_payment';
96 } else if (document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
== 'insurance') {
97 ValueToPut
= 'insurance_payment';
100 let newValueSelected
= (listSelected
.options
[listSelected
.selectedIndex
].value
);
102 let
list = document
.getElementById('type_name');
103 let newValue
= (list.options
[list.selectedIndex
].value
);
104 if (newValue
== 'patient') {
105 if (newValueSelected
== 'insurance_payment')
106 listSelected
.value
= ValueToPut
;//Putting values back
108 if (newValue
== 'insurance') {
109 if (newValueSelected
== 'family_payment')
110 listSelected
.value
= ValueToPut
;
111 if (newValueSelected
== 'patient_payment')
112 listSelected
.value
= ValueToPut
;//Putting values back
116 function RestoreValues(CountIndex
) {
117 //old remainder is restored back
118 if (document
.getElementById('Allowed' + CountIndex
).value
* 1 === 0 &&
119 document
.getElementById('Payment' + CountIndex
).value
* 1 === 0 &&
120 document
.getElementById('AdjAmount' + CountIndex
).value
* 1 === 0 &&
121 document
.getElementById('Takeback' + CountIndex
).value
* 1 === 0) {
122 document
.getElementById('RemainderTd' + CountIndex
).innerHTML
= document
.getElementById('HiddenRemainderTd' + CountIndex
).value
* 1
126 function ActionFollowUp(CountIndex
) {//Activating or deactivating the FollowUpReason text box.
127 if (document
.getElementById('FollowUp' + CountIndex
).checked
) {
128 document
.getElementById('FollowUpReason' + CountIndex
).readOnly
= false;
129 document
.getElementById('FollowUpReason' + CountIndex
).value
= '';
131 document
.getElementById('FollowUpReason' + CountIndex
).value
= '';
132 document
.getElementById('FollowUpReason' + CountIndex
).readOnly
= true;
136 function ValidateDateGreaterThanNow(DateValue
, DateFormat
) {//Validate whether the date is greater than now.The 3 formats of date is taken care of.
137 let DateValueArray
= [];
138 if (DateFormat
== '%Y-%m-%d') {
139 DateValueArray
= DateValue
.split('-');
140 DateValue
= DateValueArray
[1] +
'/' + DateValueArray
[2] +
'/' + DateValueArray
[0];
141 } else if (DateFormat
== '%m/%d/%Y') {
142 } else if (DateFormat
== '%d/%m/%Y') {
143 DateValueArray
= DateValue
.split('/');
144 DateValue
= DateValueArray
[1] +
'/' + DateValueArray
[0] +
'/' + DateValueArray
[2];
146 let PassedDate
= new Date(DateValue
);
147 let Now
= new Date();
148 return PassedDate
<= Now
;
151 function DateCheckGreater(DateValue1
, DateValue2
, DateFormat
) {//Checks which date is greater.The 3 formats of date is taken care of.
152 let DateValueArray
= [];
153 if (DateFormat
== '%Y-%m-%d') {
154 DateValueArray
= DateValue1
.split('-');
155 DateValue1
= DateValueArray
[1] +
'/' + DateValueArray
[2] +
'/' + DateValueArray
[0];
156 DateValueArray
= DateValue2
.split('-');
157 DateValue2
= DateValueArray
[1] +
'/' + DateValueArray
[2] +
'/' + DateValueArray
[0];
158 } else if (DateFormat
== '%m/%d/%Y') {
159 } else if (DateFormat
== '%d/%m/%Y') {
160 DateValueArray
= DateValue1
.split('/');
161 DateValue1
= DateValueArray
[1] +
'/' + DateValueArray
[0] +
'/' + DateValueArray
[2];
162 DateValueArray
= DateValue2
.split('/');
163 DateValue2
= DateValueArray
[1] +
'/' + DateValueArray
[0] +
'/' + DateValueArray
[2];
165 let PassedDateValue1
= new Date(DateValue1
);
166 let PassedDateValue2
= new Date(DateValue2
);
167 if (PassedDateValue1
<= PassedDateValue2
)
173 function ConvertToUpperCase(ObjectPassed
) {//Convert To Upper Case.Example:- onKeyUp="ConvertToUpperCase(this)".
174 ObjectPassed
.value
= ObjectPassed
.value
.toUpperCase();
177 //--------------------------------
178 function SearchOnceMore() {//Used in the option buttons,listing the charges.
179 //'Non Paid', 'Show Primary Complete', 'Show All Transactions' uses this when a patient is selected through ajax.
180 if (document
.getElementById('hidden_patient_code').value
* 1 > 0) {
181 document
.getElementById('mode').value
= 'search';
182 top
.restoreSession();
183 document
.forms
[0].submit();
185 alert("<?php echo htmlspecialchars(xl('Please Select a Patient.'), ENT_QUOTES) ?>")
189 function CheckUnappliedAmount() {//The value retured from here decides whether Payments can be posted/modified or not.
190 let UnappliedAmount
= document
.getElementById('TdUnappliedAmount').innerHTML
* 1;
191 if (UnappliedAmount
< 0) {
193 } else if (UnappliedAmount
> 0) {
200 function ValidateNumeric(TheObject
) {
201 //Numeric validations, used while typing numbers.
202 // Take into account comma currency numbers and allow.
203 if (isNaN(formatNumber(TheObject
.value
))) {
204 alert("<?php echo htmlspecialchars(xl('Value Should be Numeric'), ENT_QUOTES) ?>");
210 function SavePayment() {//Used before saving.
211 if (FormValidations())//FormValidations contains the form checks
213 if (confirm("<?php echo htmlspecialchars(xl('Would you like to save?'), ENT_QUOTES) ?>")) {
214 top
.restoreSession();
215 document
.getElementById('mode').value
= 'new_payment';
216 document
.forms
[0].submit();
225 function OpenEOBEntry() {//Used before allocating the recieved amount.
226 if (FormValidations())//FormValidations contains the form checks
228 top
.restoreSession();
229 document
.getElementById('mode').value
= 'distribute';
230 document
.forms
[0].submit();
236 function ScreenAdjustment(PassedObject
, CountIndex
) {
237 //Called when there is change in the amount by typing.
238 //Readjusts the various values.Another function FillAmount() is also used.
239 //Ins1 case and allowed is filled means it is primary's first payment.
240 //It moves to secondary or patient balance.
241 //If primary again pays means ==>change Post For to Ins1 and do not enter any value in the allowed box.
243 let Allowed
= formatNumber(document
.getElementById('Allowed' + CountIndex
).value
);
244 if (document
.getElementById('Allowed' + CountIndex
).id
=== PassedObject
.id
) {
245 document
.getElementById('Payment' + CountIndex
).value
= Allowed
;
247 let Payment
= formatNumber(document
.getElementById('Payment' + CountIndex
).value
* 1);
248 let ChargeAmount
= formatNumber(document
.getElementById('HiddenChargeAmount' + CountIndex
).value
* 1);
249 let Remainder
= formatNumber(document
.getElementById('HiddenRemainderTd' + CountIndex
).value
* 1);
250 if (document
.getElementById('Allowed' + CountIndex
).id
=== PassedObject
.id
) {
251 if (document
.getElementById('HiddenIns' + CountIndex
).value
=== 1) {
252 document
.getElementById('AdjAmount' + CountIndex
).value
= Math
.round((ChargeAmount
- Allowed
) * 100) / 100;
254 document
.getElementById('AdjAmount' + CountIndex
).value
= Math
.round((Remainder
- Allowed
) * 100) / 100;
257 let AdjustmentAmount
= formatNumber(document
.getElementById('AdjAmount' + CountIndex
).value
* 1);
258 let CopayAmount
= formatNumber(document
.getElementById('HiddenCopayAmount' + CountIndex
).value
* 1);
259 let Takeback
= formatNumber(document
.getElementById('Takeback' + CountIndex
).value
* 1);
260 if (document
.getElementById('HiddenIns' + CountIndex
).value
=== 1 && Allowed
!== 0) {//Means it is primary's first payment.
261 document
.getElementById('RemainderTd' + CountIndex
).innerHTML
= Math
.round((ChargeAmount
- AdjustmentAmount
- CopayAmount
- Payment + Takeback
) * 100) / 100;
262 } else {//All other case.
263 document
.getElementById('RemainderTd' + CountIndex
).innerHTML
= Math
.round((Remainder
- AdjustmentAmount
- Payment + Takeback
) * 100) / 100;
268 function FillAmount() {
269 //Called when there is change in the amount by typing.
270 //Readjusts the various values.
273 if (!empty($screen) && ($screen == 'new_payment')) { ?
>
274 UnpostedAmt
= formatNumber(document
.getElementById('HidUnpostedAmount').value
* 1);
277 UnpostedAmt
= formatNumber(document
.getElementById('payment_amount').value
* 1);
281 let RowCount
, Takeback
, thisPayment
;
282 for (RowCount
= 1; ; RowCount++
) {
283 if (!document
.getElementById('Payment' + RowCount
))
286 Takeback
= formatNumber(document
.getElementById('Takeback' + RowCount
).value
* 1);
287 thisPayment
= formatNumber(document
.getElementById('Payment' + RowCount
).value
* 1)
288 TempTotal
= Math
.round((TempTotal + thisPayment
- Takeback
) * 100) / 100;
291 document
.getElementById('TdUnappliedAmount').innerHTML
= Math
.round((UnpostedAmt
- TempTotal
) * 100) / 100;
292 document
.getElementById('HidUnappliedAmount').value
= Math
.round((UnpostedAmt
- TempTotal
) * 100) / 100;
293 document
.getElementById('HidCurrentPostedAmount').value
= TempTotal
;
296 function ActionOnInsPat(CountIndex
) {//Called when there is onchange in the Ins/Pat drop down.
297 let InsPatDropDownValue
= document
.getElementById('payment_ins' + CountIndex
).options
[document
.getElementById('payment_ins' + CountIndex
).selectedIndex
].value
;
298 document
.getElementById('HiddenIns' + CountIndex
).value
= InsPatDropDownValue
;
299 InsPatDropDownValue
= parseInt(InsPatDropDownValue
);
300 if (InsPatDropDownValue
=== 1) {
301 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#ddddff';
302 } else if (InsPatDropDownValue
=== 2) {
303 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#ffdddd';
304 } else if (InsPatDropDownValue
=== 3) {
305 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#F2F1BC';
306 } else if (InsPatDropDownValue
=== 0) {
307 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#AAFFFF';
311 function CheckPayingEntityAndDistributionPostFor() {//Ensures that Insurance payment is distributed under Ins1,Ins2,Ins3 and Patient paymentat under Pat.
312 let PayingEntity
= document
.getElementById('type_name').options ? document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
: document
.getElementById('type_name').value
;
313 let CountIndexAbove
= 0;
314 let InsPatDropDownValue
, RowCount
;
315 for (RowCount
= CountIndexAbove +
1; ; RowCount++
) {
316 if (!document
.getElementById('Payment' + RowCount
))
318 else if (document
.getElementById('Allowed' + RowCount
).value
=== '' && document
.getElementById('Payment' + RowCount
).value
=== '' && document
.getElementById('AdjAmount' + RowCount
).value
=== '' && document
.getElementById('Deductible' + RowCount
).value
=== '' && document
.getElementById('Takeback' + RowCount
).value
=== '' && document
.getElementById('FollowUp' + RowCount
).checked
=== false) {
320 InsPatDropDownValue
= document
.getElementById('payment_ins' + RowCount
).options
[document
.getElementById('payment_ins' + RowCount
).selectedIndex
].value
;
321 if (PayingEntity
== 'patient' && InsPatDropDownValue
> 0) {
322 alert("<?php echo htmlspecialchars(xl('Cannot Post for Insurance.The Paying Entity selected is Patient.'), ENT_QUOTES) ?>");
324 } else if (PayingEntity
== 'insurance' && InsPatDropDownValue
== 0) {
325 alert("<?php echo htmlspecialchars(xl('Cannot Post for Patient.The Paying Entity selected is Insurance.'), ENT_QUOTES) ?>");
333 function FormValidations() {//Screen validations are done here.
334 if (document
.getElementById('check_date').value
== '') {
335 let message
= <?php
echo xlj('Please Fill the Date') ?
>;
336 // a good use of syncAlertMsg when a promise or an await (then({})) with actions and/or
337 // for an alert to time out, is not needed. et al validation alerts.
338 syncAlertMsg('<h4 class="bg-light text-danger">'+message+
'</h4>', 1500, 'warning', 'lg');
339 document
.getElementById('check_date').focus();
341 } else if (!ValidateDateGreaterThanNow(document
.getElementById('check_date').value
, '<?php echo DateFormatRead();?>')) {
342 let message
= <?php
echo xlj('Date Cannot be greater than Today') ?
>;
343 syncAlertMsg('<h4 class="bg-light text-danger">'+message+
'</h4>', 1500, 'warning', 'lg');
344 document
.getElementById('check_date').focus();
347 if (document
.getElementById('post_to_date').value
== '') {
348 let message
= <?php
echo xlj('Please Fill the Post To Date') ?
>;
349 (async (message
, time
) => {
350 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
351 })(message
, 1500).then(res
=> {
353 document
.getElementById('post_to_date').focus();
355 } else if (!ValidateDateGreaterThanNow(document
.getElementById('post_to_date').value
, '<?php echo DateFormatRead();?>')) {
356 let message
= <?php
echo xlj('Post To Date Cannot be greater than Today') ?
>;
357 (async (message
, time
) => {
358 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
359 })(message
, 1500).then(res
=> {
361 document
.getElementById('post_to_date').focus();
363 } else if (DateCheckGreater(document
.getElementById('post_to_date').value
, '<?php echo $GLOBALS['post_to_date_benchmark
'] == '' ? date('Y
-m
-d
', time() - (10 * 24 * 60 * 60)) : htmlspecialchars(oeFormatShortDate($GLOBALS['post_to_date_benchmark
']));?>',
364 '<?php echo DateFormatRead();?>')) {
365 let message
= <?php
echo xlj('Post To Date must be greater than the financial close date.') ?
>;
366 (async (message
, time
) => {
367 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
368 })(message
, 1500).then(res
=> {
370 document
.getElementById('post_to_date').focus();
373 if (((document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'check_payment' ||
374 document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'bank_draft') &&
375 document
.getElementById('check_number').value
== '')) {
376 let message
= <?php
echo xlj('Please Fill the Check Number') ?
>;
377 (async (message
, time
) => {
378 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
379 })(message
, 1500).then(res
=> {
381 document
.getElementById('check_number').focus();
385 if (!empty($screen) && ($screen == 'edit_payment')) {
387 if (document
.getElementById('check_number').value
!= '' &&
388 document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== '') {
389 let message
= <?php
echo xlj('Please Select the Payment Method') ?
>;
390 (async (message
, time
) => {
391 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
392 })(message
, 1500).then(res
=> {
394 document
.getElementById('payment_method').focus();
400 if (document
.getElementById('payment_amount').value
== '') {
401 let message
= <?php
echo xlj('Please Fill the Payment Amount') ?
>;
402 (async (message
, time
) => {
403 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
404 })(message
, 1500).then(res
=> {
406 document
.getElementById('payment_amount').focus();
409 if (document
.getElementById('payment_amount').value
!= document
.getElementById('payment_amount').value
* 1) {
410 let message
= <?php
echo xlj('Payment Amount must be Numeric') ?
>;
411 (async (message
, time
) => {
412 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
413 })(message
, 1500).then(res
=> {
415 document
.getElementById('payment_amount').focus();
419 if (!empty($screen) && ($screen == 'edit_payment')) {
421 if (document
.getElementById('adjustment_code').options
[document
.getElementById('adjustment_code').selectedIndex
].value
== '') {
422 let message
= <?php
echo xlj('Please Fill the Payment Category') ?
>;
423 (async (message
, time
) => {
424 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
425 })(message
, 1500).then(res
=> {
427 document
.getElementById('adjustment_code').focus();
433 if (document
.getElementById('type_code').value
== '') {
434 let message
= <?php
echo xlj('Please Fill the Payment From') ?
>;
435 (async (message
, time
) => {
436 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
437 })(message
, 1500).then(res
=> {
439 document
.getElementById('type_code').focus();
442 if (document
.getElementById('hidden_type_code').value
!= document
.getElementById('div_insurance_or_patient').innerHTML
) {
443 let message
= <?php
echo xlj('Take Payment From, from Drop Down')?
>;
444 (async (message
, time
) => {
445 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
446 })(message
, 1500).then(res
=> {
448 document
.getElementById('type_code').focus();
451 if (document
.getElementById('deposit_date').value
== '') {
452 } else if (!ValidateDateGreaterThanNow(document
.getElementById('deposit_date').value
, '<?php echo DateFormatRead();?>')) {
453 let message
= <?php
echo xlj('Deposit Date Cannot be greater than Today') ?
>;
454 (async (message
, time
) => {
455 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
456 })(message
, 1500).then(res
=> {
458 document
.getElementById('deposit_date').focus();
464 //========================================================================================
465 function UpdateTotalValues(start
, count
, Payment
, PaymentTotal
) {
466 //Used in totaling the columns.
470 for (i
= start
; i
< start + count
; i++
) {
471 if (document
.getElementById(Payment + i
)) {
472 tmpVal
= formatNumber(document
.getElementById(Payment + i
).value
);
473 paymenttot
= paymenttot + tmpVal
;
476 document
.getElementById(PaymentTotal
).innerHTML
= Math
.round((paymenttot
) * 100) / 100;
480 function formatNumber(sNum
) {
483 fNum
= parseFloat(sNum
.replace(/,/g
, '')) * 1;
495 * Just to ensure our in screen calculations are up to date from value fetches.
496 * Start from AdjAmount otherwise ajustments will reset for 0 balance auto's.
498 * return awaited promise.
500 async
function ScreenAdjustmentAll($TotalRows) {
501 return await
new Promise((resolve
, reject
) => {
503 let PassedObject
, CountIndex
= 0;
504 for (CountIndex
= 1; CountIndex
<= $TotalRows; CountIndex++
) {
505 PassedObject
= document
.getElementById('AdjAmount' + CountIndex
) ??
null;
506 if (PassedObject
!== null) {
507 ScreenAdjustment(PassedObject
, CountIndex
);
518 * Recalculate totals from form items on startup
519 * Include row item calculations.
521 * This function is an async/await in case used for various billing environments.
523 async
function updateAllFormTotals($TotalRows) {
524 $TotalRows = $TotalRows * 1;
526 // ScreenAdjust must complete first for valid totals
527 await
ScreenAdjustmentAll($TotalRows).then(imFullfilled
=> {
529 if(imFullfilled
=== true) {
530 UpdateTotalValues(1, $TotalRows, 'Allowed', 'allowtotal');
531 UpdateTotalValues(1, $TotalRows, 'Payment', 'paymenttotal');
532 UpdateTotalValues(1, $TotalRows, 'AdjAmount', 'AdjAmounttotal');
533 UpdateTotalValues(1, $TotalRows, 'Deductible', 'deductibletotal');
534 UpdateTotalValues(1, $TotalRows, 'Takeback', 'takebacktotal');
536 alert("error " + e
.message
);