visolveemr wrote on Thursday, April 23, 2015:
Hello Arnab Naha,
After line $var_index=0;
add,
$tot_charges=0;
replace the line global $var_index;
with
global $var_index,$tot_charges;
$tot_charges += $ptpaid;
After the line 1238 with calctotal();
add
$(document).ready(function() {
$('#tot_char').val(<?php echo $tot_charges ?>);
});
After line 1223 with <input type='text' name='form_paytotal' value='' style='color:#00aa00;width:50px' readonly />
add
<input type="hidden" name="tot_char" id="tot_char" value=0 />
Change the already added lines
$tot = sqlQuery("select sum(pay_amount) as tot from ar_activity where pid=?", array($form_pid));
$fe = sqlQuery("select sum(fee) as fees from billing where pid=?", array($form_pid));
$due = $fe['fees'] - ($_POST['form_paytotal'] + $_POST['tot_char']);
and
<tr>
<td><?php echo xlt('Total Amount Paid'); ?>:</td>
<td><?php echo text($_POST['form_paytotal'] + $_POST['tot_char']) ?></td>
</tr>
<tr>
<td><?php echo xlt('Due Amount'); ?>:</td>
<td><?php echo ($due) ?></td>
</tr>
Thanks
OpenEMR Customization/Support Team,
ViSolve Inc
services@visolve.com | Phone: 408-850-2243
Demo’s @ ViSolve Demo Library