Skip to content

Commit 9d58c89

Browse files
buddhika75claude
andauthored
fix(inward): source invoice journal charges by CalculationMethod, not a flat BillItem sum (#22687)
* fix(inward): source invoice journal charges by CalculationMethod, not a flat BillItem sum The Inpatient Invoice Journal summed every charge type from a single BillItem query, which only works for the default calculation method. This left Admission Fee, Room Charges, and Professional/Assisting Fee permanently at 0 (those types are never stored as BillItem rows), only showed one credit company when a BHT had several, dropped credit settlement rows entirely, and double-counted BILL_ITEM charge types after discharge once the discharge snapshot bills were created. - Dispatch charge fetching by InwardChargeType.getCalculationMethod(), mirroring the sourcing already used by InwardChargeTypeDetailController and InwardChargeTypeBreakdownController for the same report family. - Read Admission Fee from AdmissionType.admissionFee directly. - Read Room Charges from PatientRoom's calculated fields plus InwardBill service items. - Read Professional/Assisting Charge from BillFee on InwardProfessional bills, split by Consultant vs non-Consultant staff. - Switch the BILL_ITEM charge query from a billTypeAtomic blacklist to a billType whitelist (InwardBill/InwardOutSideBill), which naturally excludes the discharge-time snapshot bills and fixes the post-discharge doubling. - Merge in all EncounterCreditCompany rows for the credit company column, not just the legacy single PatientEncounter.creditCompany field. - Group the credit settlement query on BillItem.patientEncounter instead of Bill.patientEncounter, since the settlement bill itself is never assigned a patientEncounter. Verified end-to-end with a synthetic test admission (OPD Card admission fee, 2 credit companies, room + professional charges, discharge, and credit settlement) — all 6 reported symptoms confirmed fixed, including no doubling post-discharge despite discharge creating duplicate snapshot BillItem/BillFee rows. Also documents a new Playwright gotcha found while testing (required Speciality field silently blocking the Add Professional Fee submit). Closes #22665 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(inward): include bills with a null billTypeAtomic in journal discount totals SQL evaluates `NULL NOT IN (...)` as unknown, so BillFee rows on legacy bills without a billTypeAtomic value were silently excluded from the invoice journal's discount/service-charge totals. Confirmed against the local DB: 1,194 bills currently have a null billTypeAtomic. Fixes CodeRabbit review comment on PR #22687. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 72ad435 commit 9d58c89

2 files changed

Lines changed: 408 additions & 28 deletions

File tree

developer_docs/testing/playwright-e2e-workflow.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,21 @@ Not Paid Tokens** → **Call Customer** → **Accept Payment** → enter Tendere
14651465
Settle**. Then from `pharmacy_search_pre_bill.xhtml`**Search Paid Only Tokens****View Payment Bill**
14661466
lands on the reprint/cancel page for that bill.
14671467

1468+
## 55. `inward_bill_professional.xhtml` "Add Professional Fee" silently no-ops if the Speciality autocomplete is left empty
1469+
1470+
On "Add New Professional Fees", the `+ Add Professional Fee` button is a
1471+
`type="submit"` full postback guarded only by a JS `confirm(...)` — clicking
1472+
it and accepting the dialog looks successful (page reloads, no visible
1473+
error) but the row never appears in "Professional Fees for This Encounter"
1474+
and no `BILLFEE` row is inserted, if the **Speciality** autocomplete (above
1475+
Doctor) was left blank. This is the same zero-observable-signal
1476+
required-field pattern as §37, just on a different page/field — the Doctor
1477+
field alone is not enough. Fix: search and select a Speciality (e.g. type
1478+
`PHYSICIAN`, press Enter) before Doctor/Fee Amount/Add. Confirmed via
1479+
`mysql.general_log`: with Speciality empty, no `INSERT INTO BILLFEE`
1480+
statement reaches the server at all; with it filled, the insert fires
1481+
immediately. Verified while testing issue #22665.
1482+
14681483
## Quick checklist
14691484

14701485
- [ ] Confirmed environment + URL with the developer; credentials kept out of the repo.

0 commit comments

Comments
 (0)