From e6289b7174658e8eda5c2bf565a16231b8151984 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 5 Jun 2023 11:55:35 +0300 Subject: [PATCH] [2] fix: recalc disabled agents fields --- apps/web/process/recalc/reactions.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/process/recalc/reactions.ts b/apps/web/process/recalc/reactions.ts index 074cd9c..61a866f 100644 --- a/apps/web/process/recalc/reactions.ts +++ b/apps/web/process/recalc/reactions.ts @@ -113,6 +113,9 @@ export function common({ store, apolloClient }: ProcessContext) { 'tbxMileage', 'tbxParmentsDecreasePercent', 'tbxVIN', + // 'radioLastPaymentRule', + // 'tbxLastPaymentPerc', + // 'tbxLastPaymentRub', ]; reaction( () => $calculation.element('cbxRecalcWithRevision').getValue(), @@ -130,17 +133,12 @@ export function common({ store, apolloClient }: ProcessContext) { ); const agents: Elements[] = [ - 'selectCalcBroker', 'selectCalcBrokerRewardCondition', - 'selectCalcDoubleAgent', 'selectCalcDoubleAgentRewardCondition', - 'selectCalcFinDepartment', 'selectDealerBroker', 'selectDealerBrokerRewardCondition', - 'selectDealerPerson', 'selectDealerRewardCondition', 'selectFinDepartmentRewardCondtion', - 'selectIndAgent', 'selectIndAgentRewardCondition', 'tbxCalcBrokerRewardSum', 'tbxCalcDoubleAgentRewardSumm', @@ -153,7 +151,7 @@ export function common({ store, apolloClient }: ProcessContext) { reaction( () => $calculation.$values.getValues(['firstPaymentPerc', 'recalcWithRevision']), ({ firstPaymentPerc, recalcWithRevision }) => { - if (firstPaymentPerc === 0 || recalcWithRevision === true) { + if (firstPaymentPerc === 0 && recalcWithRevision === true) { agents.forEach((elementName) => $calculation.$status.overrideStatus(elementName, 'Disabled') );