Problem
PharmacySaleForCashierController.settlePreBillAndNavigateToPrint() persists the cashier
PreBill with creditCompany = null and toInstitution = null, even when the payment method
is Credit and a credit company was selected on the page.
BillBeanController.setPaymentMethodData(...) only sets creditBill = true for credit
payment types — it never populates creditCompany or toInstitution. And
syncStaffSelectionFromPaymentDetails(), which back-fills the counterparty, syncs only
toStaff and is reachable exclusively from errorCheckOnPaymentMethod(), which the cashier
settle path never calls.
Impact
A "Sale for Cashier" bill paid by Credit is stored with creditBill = true but no credit
counterparty, so it does not appear in credit-company debtor reporting. The debt is
effectively invisible against the company.
How it was found
While building the native-SQL replacement for this page (#20261). The native
implementation deliberately fixes this — it records both toInstitution and creditCompany
— so bills created by the native page will differ from historical legacy bills in this
column. Raising the legacy defect separately so the divergence is a known, deliberate one
rather than a surprise.
Suggested scope
- Populate the credit counterparty on the legacy cashier settle path.
- Decide whether historical legacy cashier Credit bills need a backfill for reporting
consistency across the switchover.
Related: #20261, master #22442
Problem
PharmacySaleForCashierController.settlePreBillAndNavigateToPrint()persists the cashierPreBill with
creditCompany = nullandtoInstitution = null, even when the payment methodis
Creditand a credit company was selected on the page.BillBeanController.setPaymentMethodData(...)only setscreditBill = truefor creditpayment types — it never populates
creditCompanyortoInstitution. AndsyncStaffSelectionFromPaymentDetails(), which back-fills the counterparty, syncs onlytoStaffand is reachable exclusively fromerrorCheckOnPaymentMethod(), which the cashiersettle path never calls.
Impact
A "Sale for Cashier" bill paid by Credit is stored with
creditBill = truebut no creditcounterparty, so it does not appear in credit-company debtor reporting. The debt is
effectively invisible against the company.
How it was found
While building the native-SQL replacement for this page (#20261). The native
implementation deliberately fixes this — it records both
toInstitutionandcreditCompany— so bills created by the native page will differ from historical legacy bills in this
column. Raising the legacy defect separately so the divergence is a known, deliberate one
rather than a surprise.
Suggested scope
consistency across the switchover.
Related: #20261, master #22442