593
//PATIENT BALANCE,INS BALANCE naina@capminds.com
594
$patientbalance = get_patient_balance($pid, false);
595
//Debit the patient balance from insurance balance
596
$insurancebalance = get_patient_balance($pid, true) - $patientbalance;
597
$totalbalance=$patientbalance + $insurancebalance;
592
598
if ($GLOBALS['oer_config']['ws_accounting']['enabled']) {
593
599
// Show current balance and billing note, if any.
594
echo " <div style='margin-left: 10px; margin-right: 10px'>" .
595
"<span class='bold'><font color='#ee6600'>" .
596
htmlspecialchars(xl('Balance Due'),ENT_NOQUOTES) .
597
": " . htmlspecialchars(oeFormatMoney(get_patient_balance($pid)),ENT_NOQUOTES) .
598
"</font></span><br>";
600
echo "<table border='0'><tr><td>" .
601
"<table ><tr><td><span class='bold'><font color='red' size='3pt'>" .
602
xlt('Patient Balance Due') .
603
" : " . text(oeFormatMoney($patientbalance)) .
604
"</font></span></td></tr>".
605
"<tr><td><span class='bold'><font color='red' size='3pt'>" .
606
xlt('Insurance Balance Due') .
607
" : " . text(oeFormatMoney($insurancebalance)) .
608
"</font></span></td></tr>".
609
"<tr><td><span class='bold'><font color='red' size='3pt'>" .
610
xlt('Total Balance Due').
611
" : " . text(oeFormatMoney($totalbalance)) .
612
"</font></span></td></td></tr>";
599
613
if ($result['genericname2'] == 'Billing') {
600
echo "<span class='bold'><font color='red'>" .
601
htmlspecialchars(xl('Billing Note'),ENT_NOQUOTES) . ":" .
602
htmlspecialchars($result['genericval2'],ENT_NOQUOTES) .
603
"</font></span><br>";
614
echo "<tr><td><span class='bold'><font color='red'>" .
615
xlt('Billing Note') . ":" .
616
text($result['genericval2']) .
617
"</font></span></td></tr>";
605
619
if ($result3['provider']) { // Use provider in case there is an ins record w/ unassigned insco
606
echo "<span class='bold'>" .
607
htmlspecialchars(xl('Primary Insurance'),ENT_NOQUOTES) . ': ' . htmlspecialchars($insco_name,ENT_NOQUOTES) .
620
echo "<tr><td><span class='bold'>" .
621
xlt('Primary Insurance') . ': ' . text($insco_name) .
608
622
"</span> ";
609
623
if ($result3['copay'] > 0) {
610
624
echo "<span class='bold'>" .
611
htmlspecialchars(xl('Copay'),ENT_NOQUOTES) . ': ' . htmlspecialchars($result3['copay'],ENT_NOQUOTES) .
625
xlt('Copay') . ': ' . text($result3['copay']) .
612
626
"</span> ";
614
628
echo "<span class='bold'>" .
615
htmlspecialchars(xl('Effective Date'),ENT_NOQUOTES) . ': ' . htmlspecialchars(oeFormatShortDate($result3['effdate'],ENT_NOQUOTES)) .
629
xlt('Effective Date') . ': ' . text(oeFormatShortDate($result3['effdate'])) .
632
echo "</table></td></tr></td></tr></table><br>";
621
635
</div> <!-- required for expand_collapse_widget -->