fix: Update patient_tracker.php (#6595)
[openemr.git] / library / payment_jav.inc.php
blobecbf53abe129a536b14a951e460127d51c630856
1 <?php
2 // +-----------------------------------------------------------------------------+
3 // Copyright (C) 2010 Z&H Consultancy Services Private Limited <sam@zhservices.com>
4 //
5 //
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 //===============================================================================
31 <script>
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 = '';
38 } else {
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 = '&nbsp;';
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.
93 let ValueToPut = "";
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 = '';
130 } else {
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)
168 return true;
169 else
170 return false;
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();
184 } else {
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) {
192 return 1;
193 } else if (UnappliedAmount > 0) {
194 return 2;
195 } else {
196 return 3;
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) ?>");
205 TheObject.focus();
206 return false;
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();
217 } else {
218 return false;
220 } else {
221 return false;
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();
231 } else {
232 return false;
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;
253 } else {
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;
265 FillAmount();
268 function FillAmount() {
269 //Called when there is change in the amount by typing.
270 //Readjusts the various values.
271 let UnpostedAmt = 0;
272 <?php
273 if (!empty($screen) && ($screen == 'new_payment')) { ?>
274 UnpostedAmt = formatNumber(document.getElementById('HidUnpostedAmount').value * 1);
275 <?php
276 } else { ?>
277 UnpostedAmt = formatNumber(document.getElementById('payment_amount').value * 1);
278 <?php } ?>
280 let TempTotal = 0;
281 let RowCount, Takeback, thisPayment;
282 for (RowCount = 1; ; RowCount++) {
283 if (!document.getElementById('Payment' + RowCount))
284 break;
285 else {
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))
317 break;
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) {
319 } else {
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) ?>");
323 return false;
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) ?>");
326 return false;
330 return true;
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();
340 return false;
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();
345 return false;
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();
354 return false;
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();
362 return false;
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();
371 return false;
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();
382 return false;
384 <?php
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();
395 return false;
397 <?php
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();
407 return false;
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();
416 return false;
418 <?php
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();
428 return false;
430 <?php
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();
440 return false;
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();
449 return false;
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();
459 return false;
461 return true;
464 //========================================================================================
465 function UpdateTotalValues(start, count, Payment, PaymentTotal) {
466 //Used in totaling the columns.
467 var paymenttot = 0;
468 if (count > 0) {
469 let tmpVal = 0.00;
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) {
481 let fNum = 0.00;
482 if (isNaN(sNum)) {
483 fNum = parseFloat(sNum.replace(/,/g, '')) * 1;
484 } else {
485 fNum = (sNum * 1);
488 if(isNaN(fNum)) {
489 return fNum;
492 return fNum;
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.
499 * */
500 async function ScreenAdjustmentAll($TotalRows) {
501 return await new Promise((resolve, reject) => {
502 try {
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);
510 resolve(true);
511 } catch (e) {
512 reject(e.message);
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.
522 * */
523 async function updateAllFormTotals($TotalRows) {
524 $TotalRows = $TotalRows * 1;
525 // Do our row items.
526 // ScreenAdjust must complete first for valid totals
527 await ScreenAdjustmentAll($TotalRows).then(imFullfilled => {
528 // Now our totals..
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');
535 } else {
536 alert("error " + e.message);
540 return false;
543 </script>