[FIX] pos_loyalty: display relevant loyalty programs on receipts

Previously, if there were multiple loyalty programs with different
sets of rules, all of them would appear on the receipt, regardless of
their applicability to the order. This caused confusion as it included
programs that were not actually applied to the customer's order.

This commit addresses the issue by altering the receipt logic. Now, a
loyalty program will only be shown on the receipt if it has either
awarded points or had points redeemed in the specific order. This
ensures that only relevant loyalty programs are displayed, enhancing
clarity and accuracy in customer receipts.

opw-3608570

closes odoo/odoo#143376

X-original-commit: d4b366f2d741f2087a947d61d7e0618492cc2bf1
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
Pedram (PEBR)
2023-11-28 21:21:03 +00:00
parent 9048f585c7
commit fb2ee0200d
@@ -5,7 +5,7 @@
<xpath expr="//div[hasclass('pos-receipt')]//div[hasclass('before-footer')]" position="inside">
<t t-foreach="props.data.loyaltyStats or []" t-as="_loyaltyStat" t-key="_loyaltyStat.couponId">
<!-- Show only if portal_visible. -->
<div t-if="_loyaltyStat.program.portal_visible" class='loyalty'>
<div t-if="_loyaltyStat.program.portal_visible and (_loyaltyStat.points.won || _loyaltyStat.points.spent)" class='loyalty'>
<span class="pos-receipt-center-align">
<div>--------------------------------</div>
<br/>