$ro->coconutHidden("reportDate", $datez); //echo "</td>"; //echo "</tr>"; echo "<tr>"; echo "<td>Reporting Shift</td>"; echo "<td>"; $ro->coconutComboBoxStart_long("reportShift"); echo "<option value='" . $ro->doubleSelectNow("patientCharges", "reportShift", "registrationNo", $registrationNo, "status", "PAID") . "'>" . $ro->doubleSelectNow("patientCharges", "reportShift", "registrationNo", $registrationNo, "status", "PAID") . "</option>"; echo "<option value='Morning'>Morning</option>"; echo "<option value='Noon'>Noon</option>"; echo "<option value='Afternoon'>Afternoon</option>"; echo "<option value='Night'>Night</option>"; $ro->coconutComboBoxStop(); echo "</td>"; echo "</tr>"; if ($ro->getRegistrationDetails_type() == "OPD") { echo "<tr>"; echo "<td>Amount Paid</td>"; echo "<td>"; echo number_format($ro->totalPaidForReporting($registrationNo) + $ro->totalPaidForReporting_creditCard($registrationNo), 2); echo "</td>"; echo "</tr>"; } else { // } echo "</table>"; echo "<Br>"; $ro->coconutButton("Proceed"); $ro->coconutBoxStop(); $ro->coconutFormStop(); echo "<br><br><br>";
} } } } } } } $comp = $ro->selectNow("registrationDetails", "Company", "registrationNo", $registrationNo); $datePaid = $year . "-" . $month . "-" . $day; $ro->getPatientProfile($registrationNo); //$disc = $ro->getUnpaidPatientAmount($registrationNo) * $ro->getRegistrationDetails_discount(); //$grandTotal = $ro->getUnpaidPatientAmount($registrationNo) - $disc; $grandTotal = $ro->getUnpaidPatientAmount($registrationNo); //$payables = ($grandTotal - $ro->sumPartialPayment($registrationNo)); $payables = $grandTotal; if ($ro->getRegistrationDetails_type() == "OPD" || $ro->getRegistrationDetails_type() == "walkin") { if ($chargeStatus == "UNPAID") { if ($totalPaid >= $payables) { for ($x = 0; $x < $countz; $x++) { //add to collectionReport table $ro->addCollectionReport($registrationNo, $cashierPaid[$x], $shift, "OPD", $ro->getItemNo_total($cashierPaid[$x]), $orNO, "OPD", $username, date("H:i:s"), $datePaid, $paidVia); //$natira = $totalPaid - $ro->getItemNo_total($cashierPaid[$x]); $cashPaid = $ro->getItemNo_total($cashierPaid[$x]) + $ro->selectNow("patientCharges", "cashPaid", "itemNo", $cashierPaid[$x]); $cashUnpaid = $ro->getItemNo_total($cashierPaid[$x]); //$cashPaid = $totalPaid; if ($paidVia == "Cash") { //check kung meron ng payment sa collectionReport table ung charges if ($ro->selectNow("collectionReport", "collectionNo", "itemNo", $cashierPaid[$x]) != "") { $totalCashPaid = $cashPaid + $ro->selectNow("collectionReport", "amountPaid", "itemNo", $cashierPaid[$x]); $ro->paymentManager($cashierPaid[$x], "PAID", $username, $cashPaid, $datePaid, date("H:i:s"), "0"); } else {