fix: prevent interaction with reward and negative price lines in split bill screen
This commit is contained in:
parent
4b32aba967
commit
59e9ea98a9
@ -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
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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 && !line.is_reward_line && (line.prices ? line.prices.total_included >= 0 : true)</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
</templates>
|
</templates>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user