-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Bug Description
Customer credit is added in the POS UI as a special payment entry, and the dialog counts it toward totalPaid, so the cashier can complete the invoice as if it were fully paid.
However, the invoice submit payload strips the customer-credit metadata and sends only plain payment rows. The backend only performs actual customer-credit redemption when it receives customer_credit_dict together with redeemed_customer_credit.
I could not find the frontend sending those redemption fields in the normal submit flow.
Why This Is Distinct From #192
Issue #192 covers the first failure mode where POSNext tries to resolve a GL account for mode_of_payment = "Customer Credit" and errors before save.
This issue is the deeper frontend/backend contract bug:
- the UI treats customer credit as settled payment
- but the normal submit payload does not send the backend redemption payload
- so even if the account-lookup failure is bypassed, the intended redemption path still is not invoked correctly
Expected Behavior
When customer credit is applied in the payment dialog, the submit request should invoke the backend customer-credit redemption path correctly.
That means either:
- the frontend sends
customer_credit_dictandredeemed_customer_credit, or - the backend translates the special payment entry into that redemption path before submit
Actual Behavior
The frontend counts customer credit as payment, but the normal invoice submission payload only sends plain payments rows.
Steps to Reproduce
- Enable customer credit payment in POS Settings
- Give a customer available credit from a return / prior credit source
- Open a new sale for that customer
- Apply
Customer Creditin the payment dialog - Complete the invoice flow
- Inspect the payload/behavior versus the backend redemption path
Impact
- the cashier can believe the invoice is fully paid when customer credit has not actually been redeemed through the intended backend flow
- invoices can remain unpaid/outstanding despite UI payment completion expectations
- fixing only the account-lookup error in
#192would still leave an incomplete customer-credit payment flow
Suggested Fix
- send
customer_credit_dictandredeemed_customer_creditfrom the frontend when customer credit is applied - or convert the special customer-credit payment entry into the backend redemption payload before submit
- do not let the UI count customer credit as settled payment unless the backend redemption path is actually engaged
Notes
This issue is about the frontend/backend contract for customer-credit redemption, not just the missing account error already reported in #192.