Skip to content

fix: honor coupon apply_on in POS#219

Open
my-dev-jour wants to merge 1 commit intoBrainWise-DEV:developfrom
my-dev-jour:fix/201-coupon-apply-on
Open

fix: honor coupon apply_on in POS#219
my-dev-jour wants to merge 1 commit intoBrainWise-DEV:developfrom
my-dev-jour:fix/201-coupon-apply-on

Conversation

@my-dev-jour
Copy link
Copy Markdown
Contributor

@my-dev-jour my-dev-jour commented Mar 28, 2026

Summary

  • honor coupon apply_on when computing the discount amount in the POS coupon dialog
  • use the same selected base amount when applying the coupon to the cart so percentage coupons are not recalculated against subtotal
  • pass tax and grand total into the coupon dialog so Grand Total and Net Total coupons produce different results as intended

Root cause

CouponDialog.vue always validated min_amount and calculated the coupon from subtotal, even when the coupon itself carried apply_on = "Grand Total" or apply_on = "Net Total".

The stale frontend calculation was then repeated in useInvoice.applyDiscount(), which recalculated percentage discounts against subtotal again.

Validation

  • confirmed on the staging code path before patching: coupon dialog ignored coupon.apply_on and always used subtotal
  • confirmed current upstream code still had the same behavior before patching
  • deployed the patch to a staging environment and rebuilt POS assets
  • local verification was limited to git diff --check in this workspace

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.

1 participant