From 971684d97e7d45aeaf3670e8963e6b653fe9954a Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 17 Apr 2023 13:46:41 +0300 Subject: [PATCH] process/create-kp: add cbxPriceWithDiscount, cbxFullPriceWithDiscount reaction --- apps/web/process/create-kp/reactions.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/web/process/create-kp/reactions.ts b/apps/web/process/create-kp/reactions.ts index 174a8b1..42e8390 100644 --- a/apps/web/process/create-kp/reactions.ts +++ b/apps/web/process/create-kp/reactions.ts @@ -14,4 +14,22 @@ export function common({ store }: ProcessContext) { } } ); + + reaction( + () => $calculation.element('cbxPriceWithDiscount').getValue(), + (priceWithDiscount) => { + if (priceWithDiscount === true) { + $calculation.element('cbxFullPriceWithDiscount').setValue(false); + } + } + ); + + reaction( + () => $calculation.element('cbxFullPriceWithDiscount').getValue(), + (fullPriceWithDiscount) => { + if (fullPriceWithDiscount === true) { + $calculation.element('cbxPriceWithDiscount').setValue(false); + } + } + ); }