diff --git a/static/src/app/pos_loyalty_safe_coupon_patch.js b/static/src/app/pos_loyalty_safe_coupon_patch.js index a76a487..e346569 100644 --- a/static/src/app/pos_loyalty_safe_coupon_patch.js +++ b/static/src/app/pos_loyalty_safe_coupon_patch.js @@ -155,6 +155,15 @@ patch(OrderPaymentValidation.prototype, { // ─── PosStore patches ───────────────────────────────────────────────────────── patch(PosStore.prototype, { + /** + * fetchCoupons — filter out coupons/cards of archived programs. + */ + async fetchCoupons(domain, limit = 1) { + const activeDomain = [["program_id.active", "=", true]]; + const newDomain = domain ? activeDomain.concat(domain) : activeDomain; + return await super.fetchCoupons(newDomain, limit); + }, + /** * afterProcessServerData — purge orphaned lines from ALL orders after load. */