From 7183768184879e35b1c9c6c2a4159efa30d1c011 Mon Sep 17 00:00:00 2001 From: stephen waite Date: Wed, 16 Oct 2024 09:57:09 -0400 Subject: [PATCH] fix: send each checked encounter to collections in form export (#7769) --- interface/reports/collections_report.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/reports/collections_report.php b/interface/reports/collections_report.php index 20c69d95290..2194d08bf85 100644 --- a/interface/reports/collections_report.php +++ b/interface/reports/collections_report.php @@ -186,6 +186,7 @@ function endPatient($ptrow) global $grand_total_charges, $grand_total_adjustments, $grand_total_paid; global $grand_total_agedbal, $is_due_ins, $form_age_cols; global $initial_colspan, $final_colspan, $form_cb_idays, $form_cb_err; + global $encounters; if (!$ptrow['pid']) { return; @@ -214,7 +215,9 @@ function endPatient($ptrow) echo sprintf("%-9s\n", " "); if (empty($_POST['form_without'])) { - sqlStatement("UPDATE form_encounter SET in_collection = 1 WHERE encounter = ?", array($ptrow['encounter'])); + foreach ($encounters as $key => $item) { + sqlStatement("UPDATE form_encounter SET in_collection = 1 WHERE encounter = ?", [$item]); + } } $export_patient_count += 1; @@ -1125,6 +1128,12 @@ function checkAll(checked) { foreach ($rows as $key => $row) { list($insname, $unused , $ptname, $trash) = explode('|', $key); list($pid, $encounter) = explode(".", $row['invnumber']); + if (!empty($_POST['form_cb'])) { + if ($_POST['form_cb'][$row['invnumber']] ?? '' == 'on') { + $encounters[] = $encounter; + } + } + if ($form_payer_id) { if ($ins_co_name <> $row['ins1']) { continue;