Hi @growlingflea @robertovasquez @visolve,
This report was received from an active user and they reported that the collection report is incorrect. The report is showing patients that still have secondary insurance to be billed as overdue. Have any of you looked into this or can some give me your opinion on this report?
I’ve checked the 5.0.2 dev and the code is largely the same. So, the same issue is going to exist in the next release.
Line 730 is where the bug maybe.
// If we have not yet billed the patient, then compute $duncount as a
// negative count of the number of insurance plans for which we have not
// yet closed out insurance. Here we also compute $insname as the name of
// the insurance plan from which we are awaiting payment, and its sequence
// number $insposition (1-3).
$last_level_closed = $erow['last_level_closed'];
$duncount = $erow['stmt_count'];
$payerids = array();
$insposition = 0;
$insname = '';
if (! $duncount) {
for ($i = 1; $i <= 3; ++$i) {
$tmp = arGetPayerID($patient_id, $svcdate, $i);
if (empty($tmp)) {
break;
}
$payerids[] = $tmp;
}
$duncount = $last_level_closed - count($payerids);
if ($duncount < 0) {
if (!empty($payerids[$last_level_closed])) {
$insname = getInsName($payerids[$last_level_closed]);
$insposition = $last_level_closed + 1;
}
}
}
Thoughts and comments are welcome.