Finance OPD Bill Cancellation and Refunds - hmislk/hmis GitHub Wiki
OPD Bill Cancellation and Refunds
Introduction
OPD bills can be cancelled (voided) or refunded (cash returned to the patient). These are distinct operations: cancellation voids the entire bill and reverses the payment, while a refund returns specific items or a partial amount. Both operations create an audit trail and, where configured, require supervisor approval.
Navigation
- Bill Cancellation: Main Menu → OPD → Bill Search → select bill → Cancel
- OPD Refunds (Cashier): Main Menu → OPD Cashier → Refunds for OPD Bills (privilege:
RefundOpdBillsFromCashier) - Pharmacy Refunds (Cashier): Main Menu → OPD Cashier → Refunds for Pharmacy Bills (privilege:
RefundPharmacyBillsFromCashier)
Bill Cancellation
- Locate the bill via OPD Bill Search.
- Open the bill and click Cancel.
- Navigate to
opd/bill_cancel.xhtml. - Enter the cancellation reason.
- If a bill cancellation approval workflow is configured, the request is queued for supervisor approval (see Bill Cancellation Approval).
- On approval (or immediately if no approval is required): the bill is marked
cancelled=true, and the associated payment is reversed.
Important: A cancelled bill is not deleted — it remains in the system with
cancelled=truefor audit purposes. The bill items and fees remain visible for reporting.
Bills With a Sample Accepted by the Laboratory
Once the laboratory has accepted a sample for a test on a bill, that bill cannot be cancelled, refunded or returned by anyone. A sample that has only been collected or sent (not yet accepted by the laboratory) does not block anything. No user privilege can override this. It applies to:
- OPD individual bills
- OPD batch bills
- package bills
- collecting centre bills
If you try, the system shows a message like:
Cannot cancel this bill because the laboratory has already accepted the sample for FBC (accepted at 2026-10-08 09:30). Ask a laboratory user with the 'Lab Revert Sample' privilege to cancel the sample collection first.
If the bill genuinely needs to be cancelled or refunded:
- Ask a laboratory user with the Lab Revert Sample privilege to cancel the sample collection. See Cancelling a Sample Collection.
- After that, cancel or refund the bill as usual.
A sample collection cannot be cancelled once the report has been approved or printed. From then on the bill stays as it is.
A test whose samples have all been rejected counts as not collected, so its bill can be cancelled or refunded.
Administrators can switch this protection off for a hospital with the application option Block cancellation and refund of OPD, package and collecting centre bills once the laboratory has accepted a sample. It is on by default.
Bill Return / Refund (Cashier)
For returning specific items and refunding the patient:
- Navigate to Refunds for OPD Bills → the system opens the refund search page.
- Search for the bill by patient or bill number →
opd/opd_search_pre_refund_bill_for_return_cash. - Select the bill. The system opens
opd/bill_return.xhtml. - Select the items to return (tick each service/item being refunded).
- The refund amount is calculated automatically.
- Select the refund payment method (how the money is returned to the patient: Cash, card reversal, etc.).
- Click Save. A refund bill is created and the return is processed.
- Print from
opd/bill_return_print.xhtml.
Note: OPD refund payment method selection was fixed in PR #20645 to correctly handle payment method adjustments.
Bill Refund Page
opd/bill_refund.xhtml is an alternative refund entry page for situations where the return amount needs to be entered manually rather than selected by item.
Patient Refund Payment
opd/patient_refund_payment.xhtml — accepts a pending refund payment for a patient, used when the refund was created previously and payment is processed separately.
Pharmacy Refunds
For pharmacy bill refunds:
- Navigate to Refunds for Pharmacy Bills →
pharmacy/pharmacy_search_pre_refund_bill_for_return_cash. - Search for the pharmacy bill.
- Select items to return, confirm refund amount and method.
- Save and print.
Technical Reference
| Item | Detail |
|---|---|
| Controller | BillController, BillReturnController |
| Cancel page | opd/bill_cancel.xhtml |
| Return page | opd/bill_return.xhtml |
| Return print | opd/bill_return_print.xhtml |
| Refund page | opd/bill_refund.xhtml |
| Patient refund | opd/patient_refund_payment.xhtml |
| Privileges | RefundFromCashier, RefundOpdBillsFromCashier, RefundPharmacyBillsFromCashier |
| Bill state | cancelled=true on Bill entity (not retired) |
| PR reference | #20645 (refund payment method fix) |