From de6bf2faf673367a65a0ca6b095b3c8dd5fe498f Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Sun, 22 Jan 2006 18:10:18 +0000 Subject: [PATCH] improve implementation of DOS as invoice date and make it active by default --- accounting/ws_server.pl | 12 ++++++------ accounting/ws_server_26.pl | 10 +++++----- library/classes/WSClaim.class.php | 14 +++++++++++++- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/accounting/ws_server.pl b/accounting/ws_server.pl index e7a0c9a48..1dbb978ee 100755 --- a/accounting/ws_server.pl +++ b/accounting/ws_server.pl @@ -156,19 +156,19 @@ sub rpc_add_invoice # This is the AR account number, needed by IS::post_invoice. $form->{AR} = $oemr_ar_acc; - # This will use the posting date as the billing date @t = localtime(time); $dd = $t[3]; $mm = $t[4] + 1; $yy = $t[5] + 1900; - - $form->{transdate} = sprintf("%02u-%02u-%04u", $t[4] + 1, $t[3], $t[5] + 1900); - #Uncoment this following line if you rather use the DOS as the billing date. - - # $form->{transdate} = $$post_hash{'dosdate'}; + $form->{transdate} = sprintf("%02u-%02u-%04u", $t[4] + 1, $t[3], $t[5] + 1900); + # This overrides the above statement to use the date of service as the + # invoice date, which should be preferable for most practices. Comment + # out the following line if you really want the billing date instead. + # + $form->{transdate} = $$post_hash{'dosdate'}; # If there is insurance, set a future due date so we don't bother # the patient for a while. diff --git a/accounting/ws_server_26.pl b/accounting/ws_server_26.pl index f88b1518a..c2b2f009c 100755 --- a/accounting/ws_server_26.pl +++ b/accounting/ws_server_26.pl @@ -174,11 +174,11 @@ sub rpc_add_invoice $form->{transdate} = sprintf("%02u-%02u-%04u", $t[4] + 1, $t[3], $t[5] + 1900); - - #Uncoment this following line if you rather use the DOS as the billing date. - - # $form->{transdate} = $$post_hash{'dosdate'}; - + # This overrides the above statement to use the date of service as the + # invoice date, which should be preferable for most practices. Comment + # out the following line if you really want the billing date instead. + # + $form->{transdate} = $$post_hash{'dosdate'}; # If there is insurance, set a future due date so we don't bother # the patient for a while. diff --git a/library/classes/WSClaim.class.php b/library/classes/WSClaim.class.php index fecb68f1f..13cb588e5 100644 --- a/library/classes/WSClaim.class.php +++ b/library/classes/WSClaim.class.php @@ -65,10 +65,21 @@ class WSClaim extends WSWrapper{ } $invoice_info['notes'] = $insnotes; + /**** $sql = "SELECT b.*, CONCAT(pd.fname,' ',pd.mname,' ',pd.lname) as patient_name " . "FROM billing as b LEFT JOIN patient_data as pd on b.pid=pd.pid where " . "b.encounter = '" . $this->encounter ."' AND b.pid = '" . $this->patient_id . "' AND b.billed = 1 AND b.activity != '0' AND authorized = '1'"; + ****/ + + $sql = "SELECT b.*, e.date AS dosdate, " . + "CONCAT(pd.fname,' ',pd.mname,' ',pd.lname) as patient_name " . + "FROM billing AS b " . + "LEFT JOIN form_encounter AS e ON e.encounter = b.encounter AND e.pid = b.pid " . + "LEFT JOIN patient_data AS pd ON b.pid = pd.pid " . + "WHERE " . + "b.encounter = '" . $this->encounter . "' AND b.pid = '" . $this->patient_id . + "' AND b.billed = 1 AND b.activity != '0' AND authorized = '1'"; $result = $this->_db->Execute($sql); @@ -105,7 +116,8 @@ class WSClaim extends WSWrapper{ $invoice_info['invoicedate'] = $process_date; $invoice_info['duedate'] = $process_date; $invoice_info['items'] = array(); - $invoice_info['dosdate'] = date("m-d-Y",strtotime($result->fields['date'])); +// $invoice_info['dosdate'] = date("m-d-Y",strtotime($result->fields['date'])); + $invoice_info['dosdate'] = date("m-d-Y",strtotime($result->fields['dosdate'])); } $tii = array(); -- 2.11.4.GIT