$array_encounters = $bill_obj->GetAllEncounters(); // Now we have all encounters, but we are not sure that this person ($pid) made // some tasks with interesting points for us as billing module. while (list($index, $encounter_nr) = each($array_encounters)) { if ($debug) { echo "---------------------------------------------------------------------------------<br>"; } if ($debug) { echo "<b>'.{$LDEncounterNumber}.' {$encounter_nr}</b><br>"; } //---------------------------------------------------------------------------------------------- /** * Going through the tables and looking for pending items that should be stored into * the billing tables */ if ($bill_obj->PendingBillObjects($encounter_nr)) { if ($debug) { echo $LDPendingBillsforEncounterNr . " " . $encounter_nr . "<br>"; } // There are pending objects => There are entries in the module-tables // that are not listened in the billing list // Do we have a bill for this encounter, that we can append it? if ($bill_obj->CheckForPendingBill($encounter_nr)) { // There is a pending bill for this encounter and we can append all items to it if ($debug) { echo "'.{$LDPendingBillAdd}.'<br>"; } $bill_number = $bill_obj->GetBill($encounter_nr); if ($debug) { echo "'.{$LDOurBillNumberIs}.'" . $bill_number . "<br>"; }