From d0306539e4f9b999ee56fc46764fff67328962db Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Sat, 25 Nov 2006 23:28:16 +0000 Subject: [PATCH] added option to report on one billing code --- interface/billing/sl_receipts_report.php | 68 ++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 11 deletions(-) diff --git a/interface/billing/sl_receipts_report.php b/interface/billing/sl_receipts_report.php index aaaf5a4c9..39eaee88a 100644 --- a/interface/billing/sl_receipts_report.php +++ b/interface/billing/sl_receipts_report.php @@ -33,6 +33,7 @@ SLConnect(); $form_use_edate = $_POST['form_use_edate']; + $form_billcode = trim($_POST['form_billcode']); ?> @@ -78,6 +79,8 @@ ' title='MM/DD/YYYY'>  To: ' title='MM/DD/YYYY'> +  Code: +   >   @@ -104,6 +107,16 @@ + + + + + + + + + + @@ -123,10 +136,24 @@ $from_date = fixDate($_POST['form_from_date']); $to_date = fixDate($_POST['form_to_date']); - $query = "select acc_trans.amount, acc_trans.transdate, acc_trans.memo, " . - "ar.invnumber, ar.employee_id from acc_trans, ar where " . - "acc_trans.chart_id = $chart_id_cash and " . - "ar.id = acc_trans.trans_id and "; + if ($form_billcode) { + $query = "SELECT acc_trans.amount, acc_trans.transdate, " . + "acc_trans.memo, acc_trans.project_id, " . + "ar.invnumber, ar.employee_id, invoice.fxsellprice " . + "FROM acc_trans, ar, invoice WHERE " . + "acc_trans.chart_id = $chart_id_cash AND " . + "acc_trans.memo ILIKE '$form_billcode' AND " . + "ar.id = acc_trans.trans_id AND " . + "invoice.trans_id = acc_trans.trans_id AND " . + "invoice.serialnumber ILIKE acc_trans.memo AND " . + "invoice.fxsellprice >= 0.00 AND "; + } + else { + $query = "select acc_trans.amount, acc_trans.transdate, acc_trans.memo, " . + "ar.invnumber, ar.employee_id from acc_trans, ar where " . + "acc_trans.chart_id = $chart_id_cash and " . + "ar.id = acc_trans.trans_id and "; + } if ($form_use_edate) { $query .= "ar.transdate >= '$from_date' and " . @@ -162,6 +189,15 @@ for ($irow = 0; $irow < SLRowCount($t_res); ++$irow) { $row = SLGetRow($t_res, $irow); + + // Get insurance company name + $insconame = ''; + if ($form_billcode && $row['project_id']) { + $tmp = sqlQuery("SELECT name FROM insurance_companies WHERE " . + "id = '" . $row['project_id'] . "'"); + $insconame = $tmp['name']; + } + $amount1 = 0; $amount2 = 0; if (is_clinic($row['memo'])) @@ -175,7 +211,7 @@ ?> - + @@ -201,19 +237,29 @@ - + - + + + + + + + + + + + - + - + @@ -227,7 +273,7 @@ ?> - + @@ -239,7 +285,7 @@ - + -- 2.11.4.GIT