Skip to content

Commit

Permalink
fix: send each checked encounter to collections in form export (opene…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwaite authored Oct 16, 2024
1 parent d1f41a5 commit 7183768
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion interface/reports/collections_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7183768

Please sign in to comment.