fix: prevent interaction with reward and negative price lines in split bill screen

This commit is contained in:
Suherdy Yacob 2026-06-08 11:31:41 +07:00
parent 4b32aba967
commit 59e9ea98a9
3 changed files with 3 additions and 4 deletions

View File

@ -6,8 +6,7 @@ patch(PosOrderline.prototype, {
return ( return (
this.is_reward_line || this.is_reward_line ||
(this.config.discount_product_id && this.product_id.id === this.config.discount_product_id.id) || (this.config.discount_product_id && this.product_id.id === this.config.discount_product_id.id) ||
this.price_unit < 0 || this.price_unit < 0
this.prices?.total_included < 0
); );
}, },

View File

@ -5,7 +5,7 @@ import { SplitBillScreen } from "@pos_restaurant/app/screens/split_bill_screen/s
patch(SplitBillScreen.prototype, { patch(SplitBillScreen.prototype, {
onClickLine(line) { onClickLine(line) {
if (line.isDiscountLine) { if (line.isDiscountLine || line.is_reward_line || (line.prices && line.prices.total_included < 0)) {
return; return;
} }
super.onClickLine(...arguments); super.onClickLine(...arguments);

View File

@ -2,7 +2,7 @@
<templates id="template" xml:space="preserve"> <templates id="template" xml:space="preserve">
<t t-name="pos_custom_access.SplitBillScreen" t-inherit="pos_restaurant.SplitBillScreen" t-inherit-mode="extension"> <t t-name="pos_custom_access.SplitBillScreen" t-inherit="pos_restaurant.SplitBillScreen" t-inherit-mode="extension">
<xpath expr="//Orderline" position="attributes"> <xpath expr="//Orderline" position="attributes">
<attribute name="t-if">!line.isDiscountLine</attribute> <attribute name="t-if">!line.isDiscountLine &amp;&amp; !line.is_reward_line &amp;&amp; (line.prices ? line.prices.total_included &gt;= 0 : true)</attribute>
</xpath> </xpath>
</t> </t>
</templates> </templates>