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 if (confirm("<?php echo htmlspecialchars(xl('Would you like to Allocate?'), ENT_QUOTES) ?>")) {
229 top
.restoreSession();
230 document
.getElementById('mode').value
= 'distribute';
231 document
.forms
[0].submit();
238 function ScreenAdjustment(PassedObject
, CountIndex
) {
239 //Called when there is change in the amount by typing.
240 //Readjusts the various values.Another function FillAmount() is also used.
241 //Ins1 case and allowed is filled means it is primary's first payment.
242 //It moves to secondary or patient balance.
243 //If primary again pays means ==>change Post For to Ins1 and do not enter any value in the allowed box.
245 let Allowed
= formatNumber(document
.getElementById('Allowed' + CountIndex
).value
);
246 if (document
.getElementById('Allowed' + CountIndex
).id
=== PassedObject
.id
) {
247 document
.getElementById('Payment' + CountIndex
).value
= Allowed
;
249 let Payment
= formatNumber(document
.getElementById('Payment' + CountIndex
).value
* 1);
250 let ChargeAmount
= formatNumber(document
.getElementById('HiddenChargeAmount' + CountIndex
).value
* 1);
251 let Remainder
= formatNumber(document
.getElementById('HiddenRemainderTd' + CountIndex
).value
* 1);
252 if (document
.getElementById('Allowed' + CountIndex
).id
=== PassedObject
.id
) {
253 if (document
.getElementById('HiddenIns' + CountIndex
).value
=== 1) {
254 document
.getElementById('AdjAmount' + CountIndex
).value
= Math
.round((ChargeAmount
- Allowed
) * 100) / 100;
256 document
.getElementById('AdjAmount' + CountIndex
).value
= Math
.round((Remainder
- Allowed
) * 100) / 100;
259 let AdjustmentAmount
= formatNumber(document
.getElementById('AdjAmount' + CountIndex
).value
* 1);
260 let CopayAmount
= formatNumber(document
.getElementById('HiddenCopayAmount' + CountIndex
).value
* 1);
261 let Takeback
= formatNumber(document
.getElementById('Takeback' + CountIndex
).value
* 1);
262 if (document
.getElementById('HiddenIns' + CountIndex
).value
=== 1 && Allowed
!== 0) {//Means it is primary's first payment.
263 document
.getElementById('RemainderTd' + CountIndex
).innerHTML
= Math
.round((ChargeAmount
- AdjustmentAmount
- CopayAmount
- Payment + Takeback
) * 100) / 100;
264 } else {//All other case.
265 document
.getElementById('RemainderTd' + CountIndex
).innerHTML
= Math
.round((Remainder
- AdjustmentAmount
- Payment + Takeback
) * 100) / 100;
270 function FillAmount() {
271 //Called when there is change in the amount by typing.
272 //Readjusts the various values.
275 if ($screen == 'new_payment') { ?
>
276 UnpostedAmt
= formatNumber(document
.getElementById('HidUnpostedAmount').value
* 1);
279 UnpostedAmt
= formatNumber(document
.getElementById('payment_amount').value
* 1);
283 let RowCount
, Takeback
, thisPayment
;
284 for (RowCount
= 1; ; RowCount++
) {
285 if (!document
.getElementById('Payment' + RowCount
))
288 Takeback
= formatNumber(document
.getElementById('Takeback' + RowCount
).value
* 1);
289 thisPayment
= formatNumber(document
.getElementById('Payment' + RowCount
).value
* 1)
290 TempTotal
= Math
.round((TempTotal + thisPayment
- Takeback
) * 100) / 100;
293 document
.getElementById('TdUnappliedAmount').innerHTML
= Math
.round((UnpostedAmt
- TempTotal
) * 100) / 100;
294 document
.getElementById('HidUnappliedAmount').value
= Math
.round((UnpostedAmt
- TempTotal
) * 100) / 100;
295 document
.getElementById('HidCurrentPostedAmount').value
= TempTotal
;
298 function ActionOnInsPat(CountIndex
) {//Called when there is onchange in the Ins/Pat drop down.
299 let InsPatDropDownValue
= document
.getElementById('payment_ins' + CountIndex
).options
[document
.getElementById('payment_ins' + CountIndex
).selectedIndex
].value
;
300 document
.getElementById('HiddenIns' + CountIndex
).value
= InsPatDropDownValue
;
301 InsPatDropDownValue
= parseInt(InsPatDropDownValue
);
302 if (InsPatDropDownValue
=== 1) {
303 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#ddddff';
304 } else if (InsPatDropDownValue
=== 2) {
305 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#ffdddd';
306 } else if (InsPatDropDownValue
=== 3) {
307 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#F2F1BC';
308 } else if (InsPatDropDownValue
=== 0) {
309 document
.getElementById('trCharges' + CountIndex
).bgColor
= '#AAFFFF';
313 function CheckPayingEntityAndDistributionPostFor() {//Ensures that Insurance payment is distributed under Ins1,Ins2,Ins3 and Patient paymentat under Pat.
314 let PayingEntity
= document
.getElementById('type_name').options ? document
.getElementById('type_name').options
[document
.getElementById('type_name').selectedIndex
].value
: document
.getElementById('type_name').value
;
315 let CountIndexAbove
= 0;
316 let InsPatDropDownValue
, RowCount
;
317 for (RowCount
= CountIndexAbove +
1; ; RowCount++
) {
318 if (!document
.getElementById('Payment' + RowCount
))
320 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) {
322 InsPatDropDownValue
= document
.getElementById('payment_ins' + RowCount
).options
[document
.getElementById('payment_ins' + RowCount
).selectedIndex
].value
;
323 if (PayingEntity
== 'patient' && InsPatDropDownValue
> 0) {
324 alert("<?php echo htmlspecialchars(xl('Cannot Post for Insurance.The Paying Entity selected is Patient.'), ENT_QUOTES) ?>");
326 } else if (PayingEntity
== 'insurance' && InsPatDropDownValue
== 0) {
327 alert("<?php echo htmlspecialchars(xl('Cannot Post for Patient.The Paying Entity selected is Insurance.'), ENT_QUOTES) ?>");
335 function FormValidations() {//Screen validations are done here.
336 if (document
.getElementById('check_date').value
== '') {
337 let message
= <?php
echo xlj('Please Fill the Date') ?
>;
338 // a good use of syncAlertMsg when a promise or an await (then({})) with actions and/or
339 // for an alert to time out, is not needed. et al validation alerts.
340 syncAlertMsg('<h4 class="bg-light text-danger">'+message+
'</h4>', 1500, 'warning', 'lg');
341 document
.getElementById('check_date').focus();
343 } else if (!ValidateDateGreaterThanNow(document
.getElementById('check_date').value
, '<?php echo DateFormatRead();?>')) {
344 let message
= <?php
echo xlj('Date Cannot be greater than Today') ?
>;
345 syncAlertMsg('<h4 class="bg-light text-danger">'+message+
'</h4>', 1500, 'warning', 'lg');
346 document
.getElementById('check_date').focus();
349 if (document
.getElementById('post_to_date').value
== '') {
350 let message
= <?php
echo xlj('Please Fill the Post To Date') ?
>;
351 (async (message
, time
) => {
352 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
353 })(message
, 1500).then(res
=> {
355 document
.getElementById('post_to_date').focus();
357 } else if (!ValidateDateGreaterThanNow(document
.getElementById('post_to_date').value
, '<?php echo DateFormatRead();?>')) {
358 let message
= <?php
echo xlj('Post To Date Cannot be greater than Today') ?
>;
359 (async (message
, time
) => {
360 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
361 })(message
, 1500).then(res
=> {
363 document
.getElementById('post_to_date').focus();
365 } 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
']));?>',
366 '<?php echo DateFormatRead();?>')) {
367 let message
= <?php
echo xlj('Post To Date must be greater than the financial close date.') ?
>;
368 (async (message
, time
) => {
369 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
370 })(message
, 1500).then(res
=> {
372 document
.getElementById('post_to_date').focus();
375 if (((document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'check_payment' ||
376 document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== 'bank_draft') &&
377 document
.getElementById('check_number').value
== '')) {
378 let message
= <?php
echo xlj('Please Fill the Check Number') ?
>;
379 (async (message
, time
) => {
380 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
381 })(message
, 1500).then(res
=> {
383 document
.getElementById('check_number').focus();
387 if ($screen == 'edit_payment') {
389 if (document
.getElementById('check_number').value
!= '' &&
390 document
.getElementById('payment_method').options
[document
.getElementById('payment_method').selectedIndex
].value
== '') {
391 let message
= <?php
echo xlj('Please Select the Payment Method') ?
>;
392 (async (message
, time
) => {
393 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
394 })(message
, 1500).then(res
=> {
396 document
.getElementById('payment_method').focus();
402 if (document
.getElementById('payment_amount').value
== '') {
403 let message
= <?php
echo xlj('Please Fill the Payment Amount') ?
>;
404 (async (message
, time
) => {
405 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
406 })(message
, 1500).then(res
=> {
408 document
.getElementById('payment_amount').focus();
411 if (document
.getElementById('payment_amount').value
!= document
.getElementById('payment_amount').value
* 1) {
412 let message
= <?php
echo xlj('Payment Amount must be Numeric') ?
>;
413 (async (message
, time
) => {
414 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
415 })(message
, 1500).then(res
=> {
417 document
.getElementById('payment_amount').focus();
421 if ($screen == 'edit_payment') {
423 if (document
.getElementById('adjustment_code').options
[document
.getElementById('adjustment_code').selectedIndex
].value
== '') {
424 let message
= <?php
echo xlj('Please Fill the Payment Category') ?
>;
425 (async (message
, time
) => {
426 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
427 })(message
, 1500).then(res
=> {
429 document
.getElementById('adjustment_code').focus();
435 if (document
.getElementById('type_code').value
== '') {
436 let message
= <?php
echo xlj('Please Fill the Payment From') ?
>;
437 (async (message
, time
) => {
438 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
439 })(message
, 1500).then(res
=> {
441 document
.getElementById('type_code').focus();
444 if (document
.getElementById('hidden_type_code').value
!= document
.getElementById('div_insurance_or_patient').innerHTML
) {
445 let message
= <?php
echo xlj('Take Payment From, from Drop Down')?
>;
446 (async (message
, time
) => {
447 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
448 })(message
, 1500).then(res
=> {
450 document
.getElementById('type_code').focus();
453 if (document
.getElementById('deposit_date').value
== '') {
454 } else if (!ValidateDateGreaterThanNow(document
.getElementById('deposit_date').value
, '<?php echo DateFormatRead();?>')) {
455 let message
= <?php
echo xlj('Deposit Date Cannot be greater than Today') ?
>;
456 (async (message
, time
) => {
457 await
asyncAlertMsg(message
, time
, 'warning', 'lg');
458 })(message
, 1500).then(res
=> {
460 document
.getElementById('deposit_date').focus();
466 //========================================================================================
467 function UpdateTotalValues(start
, count
, Payment
, PaymentTotal
) {
468 //Used in totaling the columns.
472 for (i
= start
; i
< start + count
; i++
) {
473 if (document
.getElementById(Payment + i
)) {
474 tmpVal
= formatNumber(document
.getElementById(Payment + i
).value
);
475 paymenttot
= paymenttot + tmpVal
;
478 document
.getElementById(PaymentTotal
).innerHTML
= Math
.round((paymenttot
) * 100) / 100;
482 function formatNumber(sNum
) {
485 fNum
= parseFloat(sNum
.replace(/,/g
, '')) * 1;
497 * Just to ensure our in screen calculations are up to date from value fetches.
498 * Start from AdjAmount otherwise ajustments will reset for 0 balance auto's.
500 * return awaited promise.
502 async
function ScreenAdjustmentAll($TotalRows) {
503 return await
new Promise((resolve
, reject
) => {
505 let PassedObject
, CountIndex
= 0;
506 for (CountIndex
= 1; CountIndex
<= $TotalRows; CountIndex++
) {
507 PassedObject
= document
.getElementById('AdjAmount' + CountIndex
) ??
null;
508 if (PassedObject
!== null) {
509 ScreenAdjustment(PassedObject
, CountIndex
);
520 * Recalculate totals from form items on startup
521 * Include row item calculations.
523 * This function is an async/await in case used for various billing environments.
525 async
function updateAllFormTotals($TotalRows) {
526 $TotalRows = $TotalRows * 1;
528 // ScreenAdjust must complete first for valid totals
529 await
ScreenAdjustmentAll($TotalRows).then(imFullfilled
=> {
531 if(imFullfilled
=== true) {
532 UpdateTotalValues(1, $TotalRows, 'Allowed', 'allowtotal');
533 UpdateTotalValues(1, $TotalRows, 'Payment', 'paymenttotal');
534 UpdateTotalValues(1, $TotalRows, 'AdjAmount', 'AdjAmounttotal');
535 UpdateTotalValues(1, $TotalRows, 'Deductible', 'deductibletotal');
536 UpdateTotalValues(1, $TotalRows, 'Takeback', 'takebacktotal');
538 alert("error " + e
.message
);