$insurance_obj->trackChanges('billing', $new_bill_number, 'prescription', $prescriptions_nr, 'change', $dosageOld, $dosageNew, 'dosage', $comment, $user); } if ($timesPerDayOld != $timesPerDayNew) { $insurance_obj->trackChanges('billing', $new_bill_number, 'prescription', $prescriptions_nr, 'change', $timesPerDayOld, $timesPerDayNew, 'times per day', $comment, $user); } if ($daysOld != $daysNew) { $insurance_obj->trackChanges('billing', $new_bill_number, 'prescription', $prescriptions_nr, 'change', $daysOld, $daysNew, 'days', $comment, $user); } $bill_obj->StorePrescriptionItemToBill($pid, $prescriptions_nr, $new_bill_number, $_POST['insurance_' . $prescriptions_nr], $_GET['unit_price']); $bill_obj->UpdateBillNumberNewPrescription($prescriptions_nr, $new_bill_number); //$bill_obj->deduct_from_stock($prescriptions_nr,$_POST['dosage_'.$prescriptions_nr]); if ($debug) { echo "Prescription: allocate2insurance(" . $new_bill_number . ", " . $_POST['showprice_' . $prescriptions_nr] . "," . $_POST['insurance'] . ");"; } if ($_POST['insurance'] != -1) { $insurance_obj->allocatePrescriptionsToinsurance($new_bill_number, $prescriptions_nr, $_POST['showprice_' . $prescriptions_nr], $_POST['insurance']); } } elseif ($_POST['modepres_' . $prescriptions_nr] == 'delete') { $insurance_obj->trackChanges('billing', -1, 'prescription', $prescriptions_nr, 'delete', $dosageOld, '-', 'dosage', $comment, $user); $deletecounter++; //Hmm, lets kick this one out! $bill_obj->DeleteNewPrescription($prescriptions_nr, 'Disabled by billing officer'); } } elseif (strstr($x, "modelab_")) { if ($debug) { echo "looking for lab ...<br>"; } $labtest_nr = substr(strrchr($x, "_"), 1); $dosageNew = $_POST['dosage_' . $labtest_nr]; $timesPerDayNew = $_POST['times_per_day_' . $labtest_nr]; $daysNew = $_POST['days_' . $labtest_nr];