Skip to content

fix: submit customer credit redemption payload from POS#218

Open
my-dev-jour wants to merge 2 commits intoBrainWise-DEV:developfrom
my-dev-jour:fix/210-customer-credit-payload
Open

fix: submit customer credit redemption payload from POS#218
my-dev-jour wants to merge 2 commits intoBrainWise-DEV:developfrom
my-dev-jour:fix/210-customer-credit-payload

Conversation

@my-dev-jour
Copy link
Copy Markdown
Contributor

Summary

Fix customer-credit POS sales so the frontend submits the redemption payload the backend already expects.

Before this change:

  • the payment dialog created Customer Credit entries with is_customer_credit and credit_details
  • POSSale.vue stripped that metadata before submit
  • submit_invoice() never received customer_credit_dict / redeemed_customer_credit
  • pure customer-credit sales could not redeem credit correctly

This patch:

  • preserves customer-credit metadata through the POS submit flow
  • builds customer_credit_dict and redeemed_customer_credit in useInvoice.js
  • excludes synthetic Customer Credit rows from normal invoice payments
  • allows pure customer-credit POS sales to pass core POS payment-row validation only when POSNext has explicitly marked the invoice for redemption

Validation

  • reproduced the bug on staging (frappe 16.12.0, erpnext 16.11.0, pos_next 1.15.0)
  • applied the fix on staging and reran the same bench-console sale flow
  • confirmed the invoice submitted successfully
  • confirmed customer-credit redemption created a linked Journal Entry
  • confirmed the saved invoice finished with outstanding_amount = 0

Issue

Closes #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Customer Credit UI counts payment as settled but submit flow does not send redemption payload

1 participant