diff --git a/static/src/app/pos_order_patch.js b/static/src/app/pos_order_patch.js index 2992912..5bfb8cb 100644 --- a/static/src/app/pos_order_patch.js +++ b/static/src/app/pos_order_patch.js @@ -48,7 +48,7 @@ patch(PosOrder.prototype, { const isDiscount = reward && reward.reward_type === "discount"; const rewardProgram = reward && reward.program_id; // Skip lines for automatic discounts. - if (isDiscount && rewardProgram.trigger === "auto") { + if (isDiscount && rewardProgram?.trigger === "auto") { continue; } @@ -121,8 +121,8 @@ patch(PosOrder.prototype, { if (line.is_reward_line) { const reward = line.reward_id; if ( - program.id === reward.program_id.id || - ["gift_card", "ewallet"].includes(reward.program_id.program_type) + program.id === reward.program_id?.id || + ["gift_card", "ewallet"].includes(reward.program_id?.program_type) ) { continue; }