# Inpatient Final Bill ## Introduction The **final bill** closes the patient's inpatient episode. It consolidates every charge accumulated during the stay, applies discounts, sets off what has already been paid (deposits and interim payments), and leaves the balance to be collected at discharge. Settling it is the point at which the admission is financially closed. This page covers the **finance framing**: where the final bill sits in the inpatient billing chain, what it is made of, and what happens to it afterwards. For the screen itself — the Process/Save steps, the category totals, the configuration options that change its behaviour — see **[Inpatient — Final Bill Generation](Inpatient-Final-Bill-Generation)**, which is the single source of truth for that page. ## Where the Final Bill Fits | Stage | Document | Page | |---|---|---| | During the stay | [Interim bill](Finance-Inpatient-Interim-Bills) — a running summary, does not close anything | `inward/inward_bill_intrim.xhtml` | | At discharge | **Final bill** | `inward/inward_bill_final.xhtml` | | After settlement | [Payment collection](Inpatient-Final-Bill-Payment), then [final bill versions](Inpatient-Final-Bill-Versions) if a correction is needed | `inward/inward_bill_payment.xhtml` | There is **no menu item that opens a blank final bill**. The final bill is reached from the interim bill: open the admission's Interim Bill and click **Create Final Bill**. Once it exists, it is reached from the Inpatient Dashboard for the admission — **Final Bill** to view or reprint it, **Manage Final Bills** where more than one version exists — or through **Inward → Search → Final Bill Search**. Settling requires the `InwardSettleFinalBill` privilege. > On the final bill screen the sequence is **Process** (or **Process Bill**, depending on configuration) to calculate, then **Save Final Bill** to commit. There is no button called "Generate Final Bill". See [Inpatient — Final Bill Generation](Inpatient-Final-Bill-Generation). ## What the Final Bill Is Made Of Charges are gathered from every source that billed against the BHT during the admission — room and timed services, services and investigations, outside charges, pharmacy and store issues, professional and surgery fees, and any admission items configured on the admission type — and are grouped into `InwardChargeType` categories, one line per category. The totals panel shows: | Figure | Meaning | |---|---| | Total Charges | The sum of all charge categories, matrix markup included | | Gross Total and Service Charge (Margin) | The split of Total Charges into base value and the markup applied by the [price matrix](Inward-Price-Adjustment-Matrix); visible with the `ShowServiceCharges` privilege | | Item Discounts / Charge Type Discounts / Bill Level Discount | The three levels at which a discount can reach this bill; **Total Discount** is their sum | | Paid By Patient / Paid by Credit Company / Paid | What has already been collected — deposits and interim payments — split by payer | For a credit patient, a **credit company allocation** panel splits the bill between the company and the patient's own co-payment. Charge categories are documented on [Admin — Inpatient Charge Type Labels](Admin-Inpatient-Charge-Type-Labels); the sources that feed them have their own pages, for example [Inpatient Service Bills](Finance-Inpatient-Service-Bills) and [Inpatient Outside Charges](Finance-Inpatient-Outside-Charges). ## Discounts and Adjustments on the Final Bill There is **no "Price Adjustment" button** on the final bill. Three things can reduce the amount, and they are different mechanisms: - **Rule-based discounts** configured in advance on the [Discount Matrix](Admin-Inpatient-Discount-Matrix) — applied automatically as the bill is processed, and shown as Item Discounts and Charge Type Discounts - **Bill Level Discount** — a single figure typed on the final bill screen by an authorised user - **Adjusted Total** per charge category, and per-row discount fields on room and related charges — editable for most categories but locked for the ones driven by configured rules The [price matrix](Inward-Price-Adjustment-Matrix) is *not* a discount: it adds the hospital's service-charge margin, and its value is already inside Total Charges. See [Inpatient Price Adjustments](Finance-Inpatient-Price-Adjustments) for the distinction. ## Collecting the Balance From the settled final bill, **Collect Patient Payment** (or **Collect Patient Co-payment** for a credit patient) opens the payment screen — `inward/inward_bill_payment.xhtml`, or the co-payment screen for credit admissions. If the patient has paid more than the balance, the excess is handled as a refund. See [Inpatient — Final Bill Payment](Inpatient-Final-Bill-Payment) and [Inpatient Bill Refunds](Finance-Inpatient-Bill-Refunds). Professional fees for consultants and surgeons may be settled with the final bill or separately — see [Inpatient Professional Fees](Finance-Inpatient-Professional-Fees). ## Reprinting and Correcting - **Reprint** — Inward → Search → **Final Bill Search**, or the Inpatient Dashboard's **Final Bill** button, which opens the bill for reprinting - **Correcting a settled bill** — a settled final bill is never edited in place. A new **version** is created instead; see [Inpatient — Final Bill Versions](Inpatient-Final-Bill-Versions) for creating a corrected version, retiring a bad one, and emailing a version to the patient - **Cancelling** — `inward/inward_cancel_bill_final.xhtml`; see [Inpatient — Bill Cancellations and Refunds (Overview)](Inpatient-Bill-Cancellations-and-Refunds-Overview) ### Custom Bill 3 (Letterhead) — patient details Custom Bill 3 always prints the patient's address, NIC, phone, guardian and corporate sponsor in the detail block at the top of the bill. There is nothing to switch on: these are part of the format. An admission can be sponsored by more than one credit company. All of them are listed on the **Credit Company** line, separated by commas, and the line shows whenever the admission has a sponsor registered - it does not depend on the bill's own payment method. Where the same company has been registered twice against one admission, it is listed once. The **Settings** dialog on the Custom Bills tab controls which *formats* are offered (and the per-field choices for Custom Bill 2) — it has no per-field settings for Custom Bill 3. ### Custom Bill 3 — Due Amount Breakdown by Payer When an admission's payment responsibility is split across one or more credit companies (and/or the patient has a co-payment portion), Custom Bill 3 prints one **"Due from <Company>"** line per credit company that still has an outstanding balance on this bill, instead of a single lump "Due Amount" figure. A **"Due from Patient"** line is added when the patient still owes a portion after all company commitments are accounted for. Rows are only shown when their own due is greater than zero — a company that has already been fully paid, or a patient with nothing outstanding, simply gets no line. For a plain self-pay (non-credit) bill, or a credit bill with no registered companies, the original single "Due Amount" line is shown unchanged. Each company's due is computed the same way as the **Credit Company Debtor Report** (Inpatient → Inpatient Analytics → Payment Reports) — the company's committed amount (fixed at settlement) minus whatever has actually been settled against it since — so the two always agree. The patient's due is derived as whatever of the bill's net total was not committed to any company, less anything the patient has already paid, so the printed breakdown always reconciles back to the bill's own Net Total. *Custom Bill 3 for an admission with two credit companies committed to different amounts. Patient name, BHT/bill numbers, address, phone and guardian are redacted for this screenshot; the credit company names and amounts are real local test data.* ![Custom Bill 3 showing a per-credit-company Due Amount breakdown](images/24001-custom-bill3-due-breakdown.png) ### Custom Bills — Bundled Charge Types An admin can combine several charge types into one summed line on the Final Bill *print* — for example, Room Charges + Meal Charges + Maintain Charges all under one "Room Charges" heading — instead of a line per charge type. - Which charge types get combined, and under what label, is configured once for the whole hospital on the [Inpatient Charge Type Labels](Admin-Inpatient-Charge-Type-Labels#bundling-charge-types-on-the-final-bill) admin page (the **Final Bill Group** column) — nothing to choose at print time. - On the **standard Final Bill** print (shown after generation and on the reprint screen's *Final Bill* tab) and the **Custom Bill**, **Custom Bill 2**, and **Custom Bill 3 (Letterhead)** formats, the combining only happens when the `Inward Final Bill - Bundle Grouped Charge Types` application setting is on. **Bundled Custom 1** applies it with no extra switch. The Custom formats each still need switching on from the **Custom Bills** tab's **Settings** dialog before they appear at all. - With that setting off (the default), every format prints exactly as it does today, regardless of any Final Bill Group values — the feature is inert by default. - Reports (Invoice Journal, Charge Type Breakdown) always keep showing every charge type separately, regardless of this setting. ![Bundled Custom 1 print on the qa3 test instance, with the charge table highlighted where the configured Final Bill Group label prints](images/23340-qa3-bundled-custom-1-live.png) *Live render on qa3.carecode.org (Coop test instance) — the Bundled Custom 1 format opened from the Custom Bills tab. Patient name, BHT number, room, address, guardian, and the two attending doctors' names are redacted for this screenshot; the charge amounts and totals are real test data. This particular bill only carries a `RoomCharges` charge, so the grouped line prints alone — with Meal or Maintain charges also present on a bill, they would sum into the same "Room Charges" line, as demonstrated locally in PR [#23382](https://github.com/hmislk/hmis/pull/23382).* ![Standard Final Bill print with Room Charges and Meal Charges combined into one Room & Board line by a Final Bill Group](images/23651-final-bill-group-standard-print.png) *Standard Final Bill print (reprint screen's *Final Bill* tab) for a local test bill after setting **Final Bill Group = "Room & Board"** on both Room Charges (5,800.00) and Meal Charges (1,006.25) — they now print as one **Room & Board 6,806.25** line, every other charge type still on its own line, and the Total (223,587.97) unchanged. Patient, guardian, doctor and cashier names redacted; amounts are real local test data. Verified in PR [#23651](https://github.com/hmislk/hmis/pull/23651) across all five formats.* ### Professional Charge — the Printed Lines Add Up to the Total On every Final Bill print (standard, Custom Bill, Custom Bill 2, Custom Bill 3, Bundled Custom 1, Green Sheet, VAT, Cancelled) and on the **Professional Bill**, the lines under **Professional Charge** add up to the Professional Charge amount. A doctor is **named** only when the fee was entered through **Add Professional Fee**. Professional charges that arrive any other way — a service item whose charge type is Professional Charge, such as an MRI "REPORTING - Dr ..." item billed by the Diagnostic Centre with the radiologist's fee bundled in — are summed into one **Other Professional Charges** line. The label is the application option `Inward Final Bill - Label For Other Professional Charges`. ![Final bill print where the bundled MRI reporting fee prints as Other Professional Charges](images/23723-b-bundled-other-professional-charges.png) *One admission, the same doctor billed both ways: 5,000.00 of fees entered through Add Professional Fee are named, and 500.00 bundled inside the MRI reporting item prints as Other Professional Charges — together the 5,500.00 Professional Charge. Doctor name replaced, patient details cropped; amounts are local test data.* **To get a doctor named on the bill**, enter the fee through Add Professional Fee, and have an administrator provide the service without its professional component so the charge isn't billed twice. See [Inpatient — Final Bill Generation](Inpatient-Final-Bill-Generation#professional-fees-on-the-final-bill) for the two setups side by side. Older final bills print the same way when reprinted: anything not entered as a professional fee falls into the Other Professional Charges line, so the lines still add up. ### Technician Fee — Named Like Consultant Fee (fixed) When a hospital's final bill print uses the "bundle grouped charge types" layout (`Inward Final Bill - Bundle Grouped Charge Types`), **Technician Fee** now lists each technician/paramedical staff member by name under the charge line, exactly like **Consultant Fee** already does. Before the fix, Technician Fee printed only its total — the row silently dropped the per-staff breakdown that Consultant Fee and Assistant Fee already had, because `BhtSummeryController#getBundledFinalBillRows()` (and the matching block in each bundled print template) only excluded `ProfessionalCharge` and `DoctorAndNurses` from the generic "sum every other charge type into one row" bucket — `TechnicianAndParamedicalCharge` fell into that generic bucket, which has no staff-name logic at all. ![Technician Fee before the fix: total only, no staff name, highlighted in red](images/24209-technician-fee-name-missing-before.png) *Before: Technician Fee prints as a bare total (red box) while Consultant Fee on the same bill lists both doctors by name. Patient name, phone and doctor names redacted; charge amounts are real local test data.* ![Technician Fee after the fix: staff name now prints, highlighted in green](images/24209-technician-fee-name-fixed-after.png) *After: the same bill now lists the technician by name (green box), the same way Consultant Fee always has. Verified locally for issue [#24209](https://github.com/hmislk/hmis/issues/24209).* As with Consultant Fee, a technician is named only when the fee was entered through **Add Professional Fee** with the Technician category — this is unaffected by the fix. Whether that per-staff fee record is created at all still depends on the `Create Professional Bill Fees For Assistant Chargers` application option, same as before; this fix only repairs the *display* of that data once it exists, for the bundled print layout. ### Header/Logo and Generated-by / Approved-by Stamps Every Final Bill print format (standard, Custom Bill 2, Custom Bill 3 and 4, Bundled Custom 1, Green Sheet, VAT, and Professional Bill) can show a configurable institution header/logo, and every format now stamps who printed the copy and when, plus who approved the bill once it has been approved: - **Header/logo** — three application options control this, shared across every format so one admin setting applies everywhere: - `Inward Final Bill Header Template` — a free-text/HTML template with `{ins_name}`, `{ins_address}`, `{ins_phone}`, `{ins_fax}`, `{ins_email}`, `{ins_web}` placeholders, if set - `Show Inward Final bill header with institution details` — a plain fallback showing the institution's name/address/contact block when no template is set - `Inaptient Final Bill Header Image URL` (the "Inaptient" spelling is intentional — an existing key, kept as-is for backward compatibility) — a full-width header image/logo, shown independently of the two options above - Custom Bill 3 and Custom Bill 4 intentionally opt out of all three — both are designed for pre-printed letterhead stationery that already carries the institution's header physically - **Generated by / Generated on** — always shown: the user currently printing this copy, and the current date/time — distinct from the existing **Prepared by** line, which shows who originally created the bill record - **Approved by / Approved on** — shown only once the bill has actually been approved (`Bill.approveAt` set); silently absent on an unapproved bill, alongside the existing red "This final bill has NOT been approved" warning ![Final Bill original copy showing the configured header/logo above the Tax Invoice title, and the Generated by/Generated on stamp below the charges](images/23600-final-bill-header-generated-approved.png) *Final Bill (standard format), reprint screen's Final Bill tab, with `Inaptient Final Bill Header Image URL` set to a test logo. Patient name, address, phone, BHT/bill numbers, referring/consultant doctor names, and staff names are redacted; charge amounts and totals are real local test data. This bill is unapproved, so no Approved by/on line prints. Verified locally for issue [#23600](https://github.com/hmislk/hmis/issues/23600) across all eight Final Bill print formats.* ### Professional Bill Print — Trailing Blank Page (fixed) The **Professional Bill** print button, on the reprint screen's *Professional Bill* tab, used to produce a second, completely blank page after the real content — every shared print format wraps its content in a `div.a4bill`, and `printing.css` forces `page-break-after: always` on that class so several bills printed back-to-back start clean pages between each other. Printed *alone*, as the Professional Bill button does, that same rule left a forced break after the only content there was, with nothing to fill the page it broke to. The fix is scoped to this one composite (`finalProfessionalBill.xhtml`) — it does not touch the shared `printing.css` rule other multi-bill print flows still rely on for separation. ![Professional Bill print, before the fix — page 1 of 2 has the correct content, page 2 is entirely blank](images/23713-professional-bill-print-before.png) *Before: printing the Professional Bill produced a 2-page PDF with the consultant fee table on page 1 and nothing at all on page 2. Patient name and BHT No redacted; consultant names and fee amounts are real local test data.* ![Professional Bill print, after the fix — a single page with no trailing blank page](images/23713-professional-bill-print-after.png) *After: the same bill now prints as a single page — "Page 1 of 1" — with no trailing blank page. Verified locally for issue [#23713](https://github.com/hmislk/hmis/issues/23713).* ## Technical Reference | Item | Detail | |---|---| | Page | `inward/inward_bill_final.xhtml` (breakdown: `inward/inward_bill_final_break_down.xhtml`) | | Controller | `BhtSummeryController` | | BillType | `InwardFinalBill` | | Reprint page | `inward/inward_reprint_bill_final.xhtml` | | Cancellation page | `inward/inward_cancel_bill_final.xhtml` | | Payment page | `inward/inward_bill_payment.xhtml` (credit co-payment: `credit/inward_patient_copay_payment.xhtml`) | | Professional fees | `InwardProfessionalBillController` | | Settle privilege | `InwardSettleFinalBill` | ## Related Pages - [Inpatient — Final Bill Generation](Inpatient-Final-Bill-Generation) — the end-user workflow for this screen - [Inpatient — Final Bill Versions](Inpatient-Final-Bill-Versions) · [Inpatient — Final Bill Payment](Inpatient-Final-Bill-Payment) - [Inpatient Interim Bills](Finance-Inpatient-Interim-Bills) — the mid-stay equivalent - [Admin — Inpatient Discount Matrix](Admin-Inpatient-Discount-Matrix) · [Inward Price Adjustment Matrix](Inward-Price-Adjustment-Matrix) - [Inpatient Professional Fees](Finance-Inpatient-Professional-Fees) · [Inpatient Bill Refunds](Finance-Inpatient-Bill-Refunds) - [Inpatient — Bill Cancellations and Refunds (Overview)](Inpatient-Bill-Cancellations-and-Refunds-Overview)