diff --git a/static/src/app/pos_order_patch.js b/static/src/app/pos_order_patch.js index e046c65..cadaf6b 100644 --- a/static/src/app/pos_order_patch.js +++ b/static/src/app/pos_order_patch.js @@ -18,7 +18,7 @@ patch(PosOrder.prototype, { for (const rule of program.rule_ids) { for (const line of rewardLines) { const reward = line.reward_id; - if (this._validForPointsCorrection(reward, line, rule)) { + if (reward && this._validForPointsCorrection(reward, line, rule)) { if (rule.reward_point_mode === "money") { const priceToUse = rule.money_reward_point_mode === "before_tax" ? line.prices.total_excluded @@ -124,6 +124,7 @@ patch(PosOrder.prototype, { if (line.is_reward_line) { const reward = line.reward_id; if ( + !reward || program.id === reward.program_id?.id || ["gift_card", "ewallet"].includes(reward.program_id?.program_type) ) {