tranlsation function xl()
[openemr.git] / interface / billing / print_billing_report.php
blob0c1334c5616f9a30ab597b99a94ccd19d8ffe72a
1 <?
2 include_once("../globals.php");
4 include_once("$srcdir/patient.inc");
5 include_once("$srcdir/billrep.inc");
6 include_once("$srcdir/forms.inc");
7 include_once("$srcdir/billing.inc");
8 include_once("$srcdir/pnotes.inc");
9 include_once("$srcdir/report.inc");
11 //how many columns to use when displaying information
12 $COLS=6;
15 //global variables:
16 if (!isset($_GET["mode"])) {
17 if (!isset($_GET["from_date"])) {
18 $from_date=date("Y-m-d");
19 } else {
20 $from_date = $_GET["from_date"];
22 if (!isset($_GET["to_date"])) {
23 $to_date = date("Y-m-d");
24 } else {
25 $to_date = $_GET["to_date"];
27 if (!isset($_GET["code_type"])) {
28 $code_type="all";
29 } else {
30 $code_type = $_GET["code_type"];
32 if (!isset($_GET["unbilled"])) {
33 $unbilled = "on";
34 } else {
35 $unbilled = $_GET["unbilled"];
37 if (!isset($_GET["authorized"])) {
38 $my_authorized = "on";
39 } else {
40 $my_authorized = $_GET["authorized"];
42 } else {
43 $from_date = $_GET["from_date"];
44 $to_date = $_GET["to_date"];
45 $code_type = $_GET["code_type"];
46 $unbilled = $_GET["unbilled"];
47 $my_authorized = $_GET["authorized"];
54 <html>
55 <head>
58 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
60 </head>
61 <body bgcolor="#ffffff" topmargin=0 rightmargin=0 leftmargin=2 bottommargin=0 marginwidth=2 marginheight=0>
64 <a href="javascript:window.close();" target=Main><font class=title>Billing Report</font></a>
65 <br>
70 if ($my_authorized == "on" ) {
71 $my_authorized = 1;
72 } else {
73 $my_authorized = "%";
75 if ($unbilled == "on") {
76 $unbilled = "0";
77 } else {
78 $unbilled = "%";
80 if ($code_type == "all") {
81 $code_type = "%";
84 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
89 <?php
90 if (!isset($_GET["mode"])) {
91 if (!isset($_GET["from_date"])) {
92 $from_date=date("Y-m-d");
93 } else {
94 $from_date = $_GET["from_date"];
96 if (!isset($_GET["to_date"])) {
97 $to_date = date("Y-m-d");
98 } else {
99 $to_date = $_GET["to_date"];
101 if (!isset($_GET["code_type"])) {
102 $code_type="all";
103 } else {
104 $code_type = $_GET["code_type"];
106 if (!isset($_GET["unbilled"])) {
107 $unbilled = "on";
108 } else {
109 $unbilled = $_GET["unbilled"];
111 if (!isset($_GET["authorized"])) {
112 $my_authorized = "on";
113 } else {
114 $my_authorized = $_GET["authorized"];
116 } else {
117 $from_date = $_GET["from_date"];
118 $to_date = $_GET["to_date"];
119 $code_type = $_GET["code_type"];
120 $unbilled = $_GET["unbilled"];
121 $my_authorized = $_GET["authorized"];
126 if ($my_authorized == "on" ) {
127 $my_authorized = 1;
128 } else {
129 $my_authorized = "%";
131 if ($unbilled == "on") {
132 $unbilled = "0";
133 } else {
134 $unbilled = "%";
136 if ($code_type == "all") {
137 $code_type = "%";
140 $list = getBillsListBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type);
147 if (isset($_GET["mode"]) && $_GET["mode"] == "bill") {
148 billCodesList($list);
152 $res_count = 0;
153 $N = 1;
155 $itero = array();
156 if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,$code_type)) {
157 $old_pid = -1;
158 $first_time = 1;
159 $encid = 0;
160 foreach ($ret as $iter) {
161 if ($old_pid != $iter{"pid"}) {
162 $name = getPatientData($iter{"pid"});
163 if (!$first_time) {
164 print "</tr></table>\n";
165 print "</td><td>";
166 print "<table border=0><tr>\n"; // small table
167 } else {
168 print "<table border=0><tr>\n"; // small table
169 $first_time=0;
171 print "<tr><td colspan=5><hr><span class=bold>" . $name{"fname"} . " " . $name{"lname"} . "</span><br><br>\n";
172 //==================================
175 print "<font class=bold>Patient Data:</font><br>";
176 printRecDataOne($patient_data_array, getRecPatientData ($iter{"pid"}), $COLS);
178 print "<font class=bold>Employer Data:</font><br>";
179 printRecDataOne($employer_data_array, getRecEmployerData ($iter{"pid"}), $COLS);
181 print "<font class=bold>Primary Insurance Data:</font><br>";
182 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"primary"), $COLS);
184 print "<font class=bold>Secondary Insurance Data:</font><br>";
185 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"secondary"), $COLS);
187 print "<font class=bold>Tertiary Insurance Data:</font><br>";
188 printRecDataOne($insurance_data_array, getRecInsuranceData ($iter{"pid"},"tertiary"), $COLS);
193 //==================================
194 print "</td></tr><tr>\n";
195 $old_pid = $iter{"pid"};
198 print "<td width=100><span class=text>" . $iter{"code_type"} . ": </span></td><td width=100><span class=text>" . $iter{"code"} . "</span></td><td width=100><span class=small>(" . date("Y-m-d",strtotime($iter{"date"})) . ")</span></td>\n";
199 $res_count++;
200 if ($res_count == $N) {
201 print "</tr><tr>\n";
202 $res_count = 0;
204 $itero = $iter;
206 print "</tr></table>\n"; // small table
232 </body>
233 </html>