When we print our superbills (we use an outside billing company while we set up openemr for our billing) the date that gets printed is the date of posting, not the date of service. We usually post our visits the next day, or several days later. How can I get openemr to print the date of service and not the date of posting??
$sql = “select billing.*, u.id, u.fname, u.mname, u.lname,CONCAT(u.fname,’ ‘, u.lname) as provider_name, u.federaltaxid from billing LEFT JOIN users as u on u.id = billing.provider_id where pid=’” . mysql_real_escape_string($pid) . “’ and encounter = '” . mysql_real_escape_string($encounter) . “’ and activity=‘1’ order by date”;
to
//modified by Dr. Gutierrez to include service date
$sql = “select billing.*, u.id, u.fname, u.mname, u.lname,CONCAT(u.fname,’ ‘, u.lname) as provider_name, u.federaltaxid, form_encounter.date as svc_date from billing LEFT JOIN users as u on (u.id = billing.provider_id) LEFT JOIN form_encounter on (form_encounter.encounter = billing.encounter) where billing.pid=’” . mysql_real_escape_string($pid) . “’ and billing.encounter = '” . mysql_real_escape_string($encounter) . “’ and activity=‘1’ order by date”;
And in /openemer/interface/reports/custom_report_range.php change: