3 * This the first of two pages to support posting of EOBs.
4 * The second is sl_eob_invoice.php.
5 * Windows compatibility and statement downloading:
6 * 2009 Bill Cernansky and Tony McCormick [mi-squared.com]
8 * Copyright (C) 2005-2010 Rod Roark <rod@sunsetsystems.com>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @author Rod Roark <rod@sunsetsystems.com>
23 * @author Roberto Vasquez <robertogagliotta@gmail.com>
24 * @link http://www.open-emr.org
27 require_once("../globals.php");
28 require_once("$srcdir/patient.inc");
29 require_once("$srcdir/invoice_summary.inc.php");
30 require_once("$srcdir/appointments.inc.php");
31 require_once($GLOBALS['OE_SITE_DIR'] . "/statement.inc.php");
32 require_once("$srcdir/parse_era.inc.php");
33 require_once("$srcdir/sl_eob.inc.php");
34 require_once("$srcdir/formatting.inc.php");
36 $DEBUG = 0; // set to 0 for production, 1 to test
44 // This is called back by parse_era() if we are processing X12 835's.
46 function era_callback(&$out) {
47 global $where, $eracount, $eraname;
48 // print_r($out); // debugging
50 // $eraname = $out['isa_control_number'];
51 $eraname = $out['gs_date'] . '_' . ltrim($out['isa_control_number'], '0') .
52 '_' . ltrim($out['payer_id'], '0');
53 list($pid, $encounter, $invnumber) = slInvoiceNumber($out);
55 if ($pid && $encounter) {
56 if ($where) $where .= ' OR ';
57 $where .= "( f.pid = '$pid' AND f.encounter = '$encounter' )";
61 function bucks($amount) {
62 if ($amount) echo oeFormatMoney($amount);
65 // Upload a file to the client's browser
67 function upload_file_to_client($file_to_send) {
68 header("Pragma: public");
70 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
71 header("Content-Type: application/force-download");
72 header("Content-Length: " . filesize($file_to_send));
73 header("Content-Disposition: attachment; filename=" . basename($file_to_send));
74 header("Content-Description: File Transfer");
75 readfile($file_to_send);
76 // flush the content to the browser. If you don't do this, the text from the subsequent
77 // output from this script will be in the file instead of sent to the browser.
79 exit(); //added to exit from process properly in order to stop bad html code -ehrlive
80 // sleep one second to ensure there's no follow-on.
83 function upload_file_to_client_pdf($file_to_send) {
84 //Function reads a text file and converts to pdf.
86 global $STMT_TEMP_FILE_PDF;
87 $pdf = new Cezpdf('LETTER');//pdf creation starts
88 $pdf->ezSetMargins(36,0,36,0);
89 $pdf->selectFont('Courier');
90 $pdf->ezSetY($pdf->ez
['pageHeight'] - $pdf->ez
['topMargin']);
92 $file = fopen($file_to_send, "r");//this file contains the text to be converted to pdf.
95 $OneLine=fgets($file);//one line is read
96 if(stristr($OneLine, "\014") == true && !feof($file))//form feed means we should start a new page.
99 $pdf->ezSetY($pdf->ez
['pageHeight'] - $pdf->ez
['topMargin']);
100 str_replace("\014", "", $OneLine);
103 if(stristr($OneLine, 'REMIT TO') == true ||
stristr($OneLine, 'Visit Date') == true ||
stristr($OneLine, 'Future Appointments') == true ||
stristr($OneLine, 'Current') == true)//lines are made bold when 'REMIT TO' or 'Visit Date' is there.
104 $pdf->ezText('<b>'.$OneLine.'</b>', 12, array('justification' => 'left', 'leading' => 6));
106 $pdf->ezText($OneLine, 12, array('justification' => 'left', 'leading' => 6));
111 $fh = @fopen
($STMT_TEMP_FILE_PDF, 'w');//stored to a pdf file
113 fwrite($fh, $pdf->ezOutput());
116 header("Pragma: public");//this section outputs the pdf file to browser
117 header("Expires: 0");
118 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
119 header("Content-Type: application/force-download");
120 header("Content-Length: " . filesize($STMT_TEMP_FILE_PDF));
121 header("Content-Disposition: attachment; filename=" . basename($STMT_TEMP_FILE_PDF));
122 header("Content-Description: File Transfer");
123 readfile($STMT_TEMP_FILE_PDF);
124 // flush the content to the browser. If you don't do this, the text from the subsequent
125 // output from this script will be in the file instead of sent to the browser.
127 exit(); //added to exit from process properly in order to stop bad html code -ehrlive
128 // sleep one second to ensure there's no follow-on.
133 $today = date("Y-m-d");
136 // Print or download statements if requested.
138 if (($_POST['form_print'] ||
$_POST['form_download'] ||
$_POST['form_pdf']) && $_POST['form_cb']) {
140 $fhprint = fopen($STMT_TEMP_FILE, 'w');
141 $sqlBindArray = array();
143 foreach ($_POST['form_cb'] as $key => $value) {
144 $where .= " OR f.id = ?";
145 array_push($sqlBindArray, $key);
147 $where = substr($where, 4);
149 $res = sqlStatement("SELECT " .
150 "f.id, f.date, f.pid, f.encounter, f.stmt_count, f.last_stmt_date, f.last_level_closed, f.last_level_billed, f.billing_note as enc_billing_note, " .
151 "p.fname, p.mname, p.lname, p.street, p.city, p.state, p.postal_code, p.billing_note as pat_billing_note " .
152 "FROM form_encounter AS f, patient_data AS p " .
153 "WHERE ( $where ) AND " .
155 "ORDER BY p.lname, p.fname, f.pid, f.date, f.encounter", $sqlBindArray);
160 // This loops once for each invoice/encounter.
162 while ($row = sqlFetchArray($res)) {
163 $svcdate = substr($row['date'], 0, 10);
164 $duedate = $svcdate; // TBD?
165 $duncount = $row['stmt_count'];
166 $enc_note = $row['enc_billing_note'];
168 // If this is a new patient then print the pending statement
169 // and start a new one. This is an associative array:
172 // pid = OpenEMR patient ID
173 // patient = patient name
174 // amount = total amount due
175 // adjust = adjustments (already applied to amount)
176 // duedate = due date of the oldest included invoice
177 // age = number of days from duedate to today
178 // to = array of addressee name/address lines
180 // dos = date of service "yyyy-mm-dd"
181 // desc = description
182 // amount = charge less adjustments
183 // paid = amount paid
184 // notice = 1 for first notice, 2 for second, etc.
185 // detail = array of details, see invoice_summary.inc.php
187 if ($stmt['cid'] != $row['pid']) {
188 if (!empty($stmt)) ++
$stmt_count;
189 fwrite($fhprint, create_statement($stmt));
190 $stmt['cid'] = $row['pid'];
191 $stmt['pid'] = $row['pid'];
192 $stmt['dun_count'] = $row['stmt_count'];
193 $stmt['bill_note'] = $row['pat_billing_note'];
194 $stmt['enc_bill_note'] = $row['enc_billing_note'];
195 $stmt['bill_level'] = $row['last_level_billed'];
196 $stmt['level_closed'] = $row['last_level_closed'];
197 $stmt['patient'] = $row['fname'] . ' ' . $row['lname'];
198 #If you use the field in demographics layout called
199 #guardiansname this will allow you to send statements to the parent
200 #of a child or a guardian etc
201 if(strlen($row['guardiansname']) == 0) {
202 $stmt['to'] = array($row['fname'] . ' ' . $row['lname']);
206 $stmt['to'] = array($row['guardiansname']);
208 if ($row['street']) $stmt['to'][] = $row['street'];
209 $stmt['to'][] = $row['city'] . ", " . $row['state'] . " " . $row['postal_code'];
210 $stmt['lines'] = array();
211 $stmt['amount'] = '0.00';
212 $stmt['ins_paid'] = 0;
213 $stmt['today'] = $today;
214 $stmt['duedate'] = $duedate;
216 // Report the oldest due date.
217 if ($duedate < $stmt['duedate']) {
218 $stmt['duedate'] = $duedate;
222 // Recompute age at each invoice.
223 $stmt['age'] = round((strtotime($today) - strtotime($stmt['duedate'])) /
226 $invlines = ar_get_invoice_summary($row['pid'], $row['encounter'], true);
227 foreach ($invlines as $key => $value) {
229 $line['dos'] = $svcdate;
230 if ($GLOBALS['use_custom_statement']) {
231 $line['desc'] = ($key == 'CO-PAY') ?
"Patient Payment" : $value['code_text'];
235 $line['desc'] = ($key == 'CO-PAY') ?
"Patient Payment" : "Procedure $key";
237 $line['amount'] = sprintf("%.2f", $value['chg']);
238 $line['adjust'] = sprintf("%.2f", $value['adj']);
239 $line['paid'] = sprintf("%.2f", $value['chg'] - $value['bal']);
240 $line['notice'] = $duncount +
1;
241 $line['detail'] = $value['dtl'];
242 $stmt['lines'][] = $line;
243 $stmt['amount'] = sprintf("%.2f", $stmt['amount'] +
$value['bal']);
244 $stmt['ins_paid'] = $stmt['ins_paid'] +
$value['ins'];
247 // Record that this statement was run.
248 if (! $DEBUG && ! $_POST['form_without']) {
249 sqlStatement("UPDATE form_encounter SET " .
250 "last_stmt_date = '$today', stmt_count = stmt_count + 1 " .
251 "WHERE id = " . $row['id']);
255 if (!empty($stmt)) ++
$stmt_count;
256 fwrite($fhprint, create_statement($stmt));
260 // Download or print the file, as selected
261 if ($_POST['form_download']) {
262 upload_file_to_client($STMT_TEMP_FILE);
263 } elseif ($_POST['form_pdf']) {
264 upload_file_to_client_pdf($STMT_TEMP_FILE);
265 } else { // Must be print!
267 $alertmsg = xl("Printing skipped; see test output in") .' '. $STMT_TEMP_FILE;
269 exec("$STMT_PRINT_CMD $STMT_TEMP_FILE");
270 if ($_POST['form_without']) {
271 $alertmsg = xl('Now printing') .' '. $stmt_count .' '. xl('statements; invoices will not be updated.');
273 $alertmsg = xl('Now printing') .' '. $stmt_count .' '. xl('statements and updating invoices.');
276 } // end not form_download
277 } // end statements requested
281 <?php
html_header_show(); ?
>
282 <link rel
=stylesheet href
="<?php echo $css_header;?>" type
="text/css">
283 <title
><?php
xl('EOB Posting - Search','e'); ?
></title
>
284 <script type
="text/javascript" src
="../../library/textformat.js"></script
>
286 <script language
="JavaScript">
290 function checkAll(checked
) {
291 var f
= document
.forms
[0];
292 for (var i
= 0; i
< f
.elements
.length
; ++i
) {
293 var ename
= f
.elements
[i
].name
;
294 if (ename
.indexOf('form_cb[') == 0)
295 f
.elements
[i
].checked
= checked
;
299 function npopup(pid
) {
300 window
.open('sl_eob_patient_note.php?patient_id=' + pid
, '_blank', 'width=500,height=250,resizable=1');
308 <body leftmargin
='0' topmargin
='0' marginwidth
='0' marginheight
='0'>
311 <form method
='post' action
='sl_eob_search.php' enctype
='multipart/form-data'>
313 <table border
='0' cellpadding
='5' cellspacing
='0'>
317 // Identify the payer to support resumable posting sessions.
319 echo " " . xl('Payer') . ":\n";
322 $insurancei = getInsuranceProviders();
323 echo " <select name='form_payer_id'>\n";
324 echo " <option value='0'>-- " . xl('Patient') . " --</option>\n";
325 foreach ($insurancei as $iid => $iname) {
326 echo "<option value='$iid'";
327 if ($iid == $_POST['form_payer_id']) echo " selected";
328 echo ">" . $iname . "</option>\n";
335 <?php
xl('Source:','e'); ?
>
338 <input type
='text' name
='form_source' size
='10' value
='<?php echo $_POST['form_source
']; ?>'
339 title
='<?php xl("A check number or claim number to identify the payment","e"); ?>'>
342 <?php
xl('Pay Date:','e'); ?
>
345 <input type
='text' name
='form_paydate' size
='10' value
='<?php echo $_POST['form_paydate
']; ?>'
346 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
347 title
='<?php xl("Date of payment yyyy-mm-dd","e"); ?>'>
351 <?php
xl('Deposit Date:','e'); ?
>
354 <input type
='text' name
='form_deposit_date' size
='10' value
='<?php echo $_POST['form_deposit_date
']; ?>'
355 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
356 title
='<?php xl("Date of bank deposit yyyy-mm-dd","e"); ?>'>
360 <?php
xl('Amount:','e'); ?
>
363 <input type
='text' name
='form_amount' size
='10' value
='<?php echo $_POST['form_amount
']; ?>'
364 title
='<?php xl("Paid amount that you will allocate","e"); ?>'>
367 <a href
='sl_eob_help.php' target
='_blank'><?php
xl('Help','e'); ?
></a
>
373 <table border
='0' cellpadding
='5' cellspacing
='0'>
375 <tr bgcolor
='#ddddff'>
377 <?php
xl('Name:','e'); ?
>
380 <input type
='text' name
='form_name' size
='10' value
='<?php echo $_POST['form_name
']; ?>'
381 title
='<?php xl("Any part of the patient name, or \"last,first\", or \"X-Y\"","e"); ?>'>
384 <?php
xl('Chart ID:','e'); ?
>
387 <input type
='text' name
='form_pid' size
='10' value
='<?php echo $_POST['form_pid
']; ?>'
388 title
='<?php xl("Patient chart ID","e"); ?>'>
391 <?php
xl('Encounter:','e'); ?
>
394 <input type
='text' name
='form_encounter' size
='10' value
='<?php echo $_POST['form_encounter
']; ?>'
395 title
='<?php xl("Encounter number","e"); ?>'>
398 <?php
xl('Svc Date:','e'); ?
>
401 <input type
='text' name
='form_date' size
='10' value
='<?php echo $_POST['form_date
']; ?>'
402 title
='<?php xl("Date of service mm/dd/yyyy","e"); ?>'>
405 <?php
xl('To:','e'); ?
>
408 <input type
='text' name
='form_to_date' size
='10' value
='<?php echo $_POST['form_to_date
']; ?>'
409 title
='<?php xl("Ending DOS mm/dd/yyyy if you wish to enter a range","e"); ?>'>
412 <select name
='form_category'>
414 foreach (array(xl('Open'), xl('All'), xl('Due Pt'), xl('Due Ins')) as $value) {
415 echo " <option value='$value'";
416 if ($_POST['form_category'] == $value) echo " selected";
417 echo ">$value</option>\n";
423 <input type
='submit' name
='form_search' value
='<?php xl("Search","e"); ?>'>
427 <!-- Support
for X12
835 upload
-->
428 <tr bgcolor
='#ddddff'>
430 <?php
xl('Or upload ERA file:','e'); ?
>
431 <input type
="hidden" name
="MAX_FILE_SIZE" value
="5000000" />
432 <input name
="form_erafile" type
="file" />
437 <td height
="1" colspan
="10">
444 if ($_POST['form_search'] ||
$_POST['form_print']) {
445 $form_name = trim($_POST['form_name']);
446 $form_pid = trim($_POST['form_pid']);
447 $form_encounter = trim($_POST['form_encounter']);
448 $form_date = fixDate($_POST['form_date'], "");
449 $form_to_date = fixDate($_POST['form_to_date'], "");
453 // Handle X12 835 file upload.
455 if ($_FILES['form_erafile']['size']) {
456 $tmp_name = $_FILES['form_erafile']['tmp_name'];
458 // Handle .zip extension if present. Probably won't work on Windows.
459 if (strtolower(substr($_FILES['form_erafile']['name'], -4)) == '.zip') {
460 rename($tmp_name, "$tmp_name.zip");
461 exec("unzip -p $tmp_name.zip > $tmp_name");
462 unlink("$tmp_name.zip");
465 echo "<!-- Notes from ERA upload processing:\n";
466 $alertmsg .= parse_era($tmp_name, 'era_callback');
468 $erafullname = $GLOBALS['OE_SITE_DIR'] . "/era/$eraname.edi";
470 if (is_file($erafullname)) {
471 $alertmsg .= "Warning: Set $eraname was already uploaded ";
472 if (is_file($GLOBALS['OE_SITE_DIR'] . "/era/$eraname.html"))
473 $alertmsg .= "and processed. ";
475 $alertmsg .= "but not yet processed. ";
477 rename($tmp_name, $erafullname);
481 // Note that parse_era() modified $eracount and $where.
482 if (! $where) $where = '1 = 2';
486 if ($where) $where .= " AND ";
487 // Allow the last name to be followed by a comma and some part of a first name.
488 if (preg_match('/^(.*\S)\s*,\s*(.*)/', $form_name, $matches)) {
489 $where .= "p.lname LIKE '" . $matches[1] . "%' AND p.fname LIKE '" . $matches[2] . "%'";
490 // Allow a filter like "A-C" on the first character of the last name.
491 } else if (preg_match('/^(\S)\s*-\s*(\S)$/', $form_name, $matches)) {
493 while (ord($matches[1]) <= ord($matches[2])) {
494 $tmp .= " OR p.lname LIKE '" . $matches[1] . "%'";
495 $matches[1] = chr(ord($matches[1]) +
1);
497 $where .= "( $tmp ) ";
499 $where .= "p.lname LIKE '%$form_name%'";
503 if ($where) $where .= " AND ";
504 $where .= "f.pid = '$form_pid'";
506 if ($form_encounter) {
507 if ($where) $where .= " AND ";
508 $where .= "f.encounter = '$form_encounter'";
511 if ($where) $where .= " AND ";
513 $where .= "f.date >= '$form_date' AND f.date <= '$form_to_date'";
516 $where .= "f.date = '$form_date'";
520 if ($_POST['form_category'] == 'All') {
521 die(xl("At least one search parameter is required if you select All."));
528 // Notes that as of release 4.1.1 the copays are stored
529 // in the ar_activity table marked with a PCP in the account_code column.
530 $query = "SELECT f.id, f.pid, f.encounter, f.date, " .
531 "f.last_level_billed, f.last_level_closed, f.last_stmt_date, f.stmt_count, " .
532 "p.fname, p.mname, p.lname, p.pubpid, p.billing_note, " .
533 "( SELECT SUM(b.fee) FROM billing AS b WHERE " .
534 "b.pid = f.pid AND b.encounter = f.encounter AND " .
535 "b.activity = 1 AND b.code_type != 'COPAY' ) AS charges, " .
536 "( SELECT SUM(a.pay_amount) FROM ar_activity AS a WHERE " .
537 "a.pid = f.pid AND a.encounter = f.encounter AND a.payer_type = 0 AND a.account_code = 'PCP')*-1 AS copays, " .
538 "( SELECT SUM(a.pay_amount) FROM ar_activity AS a WHERE " .
539 "a.pid = f.pid AND a.encounter = f.encounter AND a.account_code != 'PCP') AS payments, " .
540 "( SELECT SUM(a.adj_amount) FROM ar_activity AS a WHERE " .
541 "a.pid = f.pid AND a.encounter = f.encounter ) AS adjustments " .
542 "FROM form_encounter AS f " .
543 "JOIN patient_data AS p ON p.pid = f.pid " .
545 "ORDER BY p.lname, p.fname, p.mname, f.pid, f.encounter";
547 // Note that unlike the SQL-Ledger case, this query does not weed
548 // out encounters that are paid up. Also the use of sub-selects
549 // will require MySQL 4.1 or greater.
551 // echo "<!-- $query -->\n"; // debugging
553 $t_res = sqlStatement($query);
555 $num_invoices = sqlNumRows($t_res);
556 if ($eracount && $num_invoices != $eracount) {
557 $alertmsg .= "Of $eracount remittances, there are $num_invoices " .
558 "matching encounters in OpenEMR. ";
562 <table border
='0' cellpadding
='1' cellspacing
='2' width
='98%'>
564 <tr bgcolor
="#dddddd">
566  
;<?php
xl('Patient','e'); ?
>
569  
;<?php
xl('Invoice','e'); ?
>
572  
;<?php
xl('Svc Date','e'); ?
>
575  
;<?php
xl('Last Stmt','e'); ?
>
577 <td
class="dehead" align
="right">
578 <?php
xl('Charge','e'); ?
> 
;
580 <td
class="dehead" align
="right">
581 <?php
xl('Adjust','e'); ?
> 
;
583 <td
class="dehead" align
="right">
584 <?php
xl('Paid','e'); ?
> 
;
586 <td
class="dehead" align
="right">
587 <?php
xl('Balance','e'); ?
> 
;
589 <td
class="dehead" align
="center">
590 <?php
xl('Prv','e'); ?
>
592 <?php
if (!$eracount) { ?
>
593 <td
class="dehead" align
="left">
594 <?php
xl('Sel','e'); ?
>
602 while ($row = sqlFetchArray($t_res)) {
603 $balance = sprintf("%.2f", $row['charges'] +
$row['copays'] - $row['payments'] - $row['adjustments']);
605 if ($_POST['form_category'] != 'All' && $eracount == 0 && $balance == 0) continue;
607 // $duncount was originally supposed to be the number of times that
608 // the patient was sent a statement for this invoice.
610 $duncount = $row['stmt_count'];
612 // But if we have not yet billed the patient, then compute $duncount as a
613 // negative count of the number of insurance plans for which we have not
614 // yet closed out insurance.
617 for ($i = 1; $i <= 3 && arGetPayerID($row['pid'], $row['date'], $i); ++
$i) ;
618 $duncount = $row['last_level_closed'] +
1 - $i;
621 $isdueany = ($balance > 0);
623 // An invoice is now due from the patient if money is owed and we are
624 // not waiting for insurance to pay.
626 $isduept = ($duncount >= 0 && $isdueany) ?
" checked" : "";
628 // Skip invoices not in the desired "Due..." category.
630 if (substr($_POST['form_category'], 0, 3) == 'Due' && !$isdueany) continue;
631 if ($_POST['form_category'] == 'Due Ins' && ($duncount >= 0 ||
!$isdueany)) continue;
632 if ($_POST['form_category'] == 'Due Pt' && ($duncount < 0 ||
!$isdueany)) continue;
634 $bgcolor = ((++
$orow & 1) ?
"#ffdddd" : "#ddddff");
636 $svcdate = substr($row['date'], 0, 10);
637 $last_stmt_date = empty($row['last_stmt_date']) ?
'' : $row['last_stmt_date'];
639 // Determine if customer is in collections.
641 $billnote = $row['billing_note'];
642 $in_collections = stristr($billnote, 'IN COLLECTIONS') !== false;
644 <tr bgcolor
='<?php echo $bgcolor ?>'>
646  
;<a href
="" onclick
="return npopup(<?php echo $row['pid'] ?>)"
647 ><?php
echo $row['lname'] . ', ' . $row['fname']; ?
></a
>
650  
;<a href
="sl_eob_invoice.php?id=<?php echo $row['id'] ?>"
651 target
="_blank"><?php
echo $row['pid'] . '.' . $row['encounter']; ?
></a
>
654  
;<?php
echo oeFormatShortDate($svcdate) ?
>
657  
;<?php
echo oeFormatShortDate($last_stmt_date) ?
>
659 <td
class="detail" align
="right">
660 <?php
bucks($row['charges']) ?
> 
;
662 <td
class="detail" align
="right">
663 <?php
bucks($row['adjustments']) ?
> 
;
665 <td
class="detail" align
="right">
666 <?php
bucks($row['payments'] - $row['copays']); ?
> 
;
668 <td
class="detail" align
="right">
669 <?php
bucks($balance); ?
> 
;
671 <td
class="detail" align
="center">
672 <?php
echo $duncount ?
$duncount : " " ?
>
674 <?php
if (!$eracount) { ?
>
675 <td
class="detail" align
="left">
676 <input type
='checkbox' name
='form_cb[<?php echo($row['id
']) ?>]'<?php
echo $isduept ?
> />
677 <?php
if ($in_collections) echo "<b><font color='red'>IC</font></b>"; ?
>
683 } // end search/print logic
690 <?php
if ($eracount) { ?
>
691 <input type
='button' value
='<?php xl('Process ERA File
','e
')?>' onclick
='processERA()' />  
;
693 <input type
='button' value
='<?php xl('Select All
','e
')?>' onclick
='checkAll(true)' />  
;
694 <input type
='button' value
='<?php xl('Clear All
','e
')?>' onclick
='checkAll(false)' />  
;
695 <input type
='submit' name
='form_print' value
='<?php xl('Print Selected Statements
','e
'); ?>' />  
;
696 <input type
='submit' name
='form_download' value
='<?php xl('Download Selected Statements
','e
'); ?>' />  
;
697 <input type
='submit' name
='form_pdf' value
='<?php xl('PDF Download Selected Statements
','e
'); ?>' />  
;
699 <input type
='checkbox' name
='form_without' value
='1' /> <?php
xl('Without Update','e'); ?
>
704 <script language
="JavaScript">
705 function processERA() {
706 var f
= document
.forms
[0];
707 var debug
= f
.form_without
.checked ?
'1' : '0';
708 var paydate
= f
.form_paydate
.value
;
709 window
.open('sl_eob_process.php?eraname=<?php echo $eraname ?>&debug=' + debug +
'&paydate=' + paydate +
'&original=original', '_blank');
714 echo "alert('" . htmlentities($alertmsg) . "');\n";