From 798eaec2e64f37d591a2e641c5531971be6f6662 Mon Sep 17 00:00:00 2001 From: Chika Date: Tue, 8 Nov 2022 13:58:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B2=20=D0=9F=D0=B5=D1=80=D0=B5=D1=81=D1=87=D0=B5?= =?UTF-8?q?=D1=82=D0=B5=20=D0=B1=D0=B5=D0=B7=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D1=81=D0=BC=D0=BE=D1=82=D1=80=D0=B0=20=D1=87=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D0=B2=20=D0=BF=D0=BE=D0=BB=D0=B5=20?= =?UTF-8?q?=D0=AE=D0=9B=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D1=89=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=A2=D0=B8=D0=BF=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=B2=D1=89=D0=B8=D0=BA=D0=B0=20=3D=20=D0=9D=D0=B5=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=84=D0=B5=D1=81=D1=81=D0=B8=D0=BE=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D1=8C=D0=BD=D1=8B=D0=B9=20(evo=5Fsupplier=5Ftype=20=3D=20100?= =?UTF-8?q?=20000=20001),=20=D1=82=D0=BE=20=D1=83=D0=B2=D0=B5=D0=BB=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=BE=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D0=B7=D0=B0=D0=BF=D1=80=D0=B5=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Надо вписаться в ту же проверку что делали на прошлой неделе по закрытию увеличения стоимости при БУ. См. по коду изменения зеленым --- .../Effects/reactions/loadKpReaction/index.ts | 7 ++++--- .../Effects/reactions/recalcWoRevisionReactions.ts | 9 ++++++++- .../graphql/query/quote/options/main_options.graphql | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts index 37448af..5dab95b 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/loadKpReaction/index.ts @@ -4,7 +4,7 @@ import { resetIns } from 'client/Containers/Calculation/Components/ELT/lib/reset import { numberElementsProps } from 'client/Containers/Calculation/Elements/props/common'; import { getTitle, - getValueName, + getValueName } from 'client/Containers/Calculation/Elements/tools'; import { ElementsNames } from 'client/Containers/Calculation/types/elements'; import { openNotification } from 'client/Elements/Notification'; @@ -14,7 +14,7 @@ import { mainOptionsForQuoteQuery, quoteQuery, secondaryOptionsForQuoteQuery, - singleOptionsForQuoteQuery, + singleOptionsForQuoteQuery } from 'core/services/CrmService/graphql/query/quote'; import { TOptionizedEntity } from 'core/services/CrmService/types/common'; import { @@ -23,7 +23,7 @@ import { IEvoGraph, IEvoRewardCondition, IEvoTown, - IQuote, + IQuote } from 'core/services/CrmService/types/entities'; import { currentISODate } from 'core/tools/date'; import { NIL } from 'core/tools/uuid'; @@ -317,6 +317,7 @@ const loadKpReaction: IReactionEffect = calculationStore => ({ evo_broker_accountid evo_kpp evo_inn + evo_supplier_type } } `, diff --git a/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts index cdd5e10..e9884b1 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/recalcWoRevisionReactions.ts @@ -108,6 +108,8 @@ const reactionEffects: IReactionEffect[] = [ //@ts-ignore const importProgramSum = calculationStore.importProgramSum(); + const dealerPerson = calculationStore.getOption('selectDealerPerson'); + return [ supplierDiscountRub, price, @@ -115,6 +117,7 @@ const reactionEffects: IReactionEffect[] = [ recalcWithRevision, addEquipmentPrice, importProgramSum, + dealerPerson, ]; }, effect: ([ @@ -124,6 +127,7 @@ const reactionEffects: IReactionEffect[] = [ recalcWithRevision, addEquipmentPrice, importProgramSum, + dealerPerson, ]) => { if (!recalcWithRevision) { calculationStore.setValidation('tbxLeaseObjectPrice', undefined); @@ -138,6 +142,7 @@ const reactionEffects: IReactionEffect[] = [ const maxCondition1 = leaseObjectUsed === false && + dealerPerson?.evo_supplier_type !== 100_000_001 && quote?.evo_max_price_change && !product?.evo_sale_without_nds && price - supplierDiscountRub + addEquipmentPrice - importProgramSum > @@ -145,6 +150,7 @@ const reactionEffects: IReactionEffect[] = [ const maxCondition2 = leaseObjectUsed === false && + dealerPerson?.evo_supplier_type !== 100_000_001 && quote?.evo_max_price_change && product?.evo_sale_without_nds && leaseObjectPriceWthtVAT > @@ -152,7 +158,8 @@ const reactionEffects: IReactionEffect[] = [ (quote.evo_nds_in_price_supplier_currency || 0); const maxCondition3 = - leaseObjectUsed === true && + (leaseObjectUsed === true || + dealerPerson?.evo_supplier_type === 100_000_001) && quote?.evo_supplier_currency_price && price - supplierDiscountRub + addEquipmentPrice - importProgramSum > quote.evo_supplier_currency_price - diff --git a/src/core/services/CrmService/graphql/query/quote/options/main_options.graphql b/src/core/services/CrmService/graphql/query/quote/options/main_options.graphql index 628a68a..b6992f2 100644 --- a/src/core/services/CrmService/graphql/query/quote/options/main_options.graphql +++ b/src/core/services/CrmService/graphql/query/quote/options/main_options.graphql @@ -47,6 +47,7 @@ query GetMainOptionsForKP( evo_broker_accountid evo_kpp evo_inn + evo_supplier_type } selectDealerRewardCondition: evo_reward_conditions( evo_agent_accountid: $dealer_person_accountid