From 8f65fd198d366a2a0d4ea5a291c6d4ae4fbba3cc Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 15 Dec 2022 10:56:28 +0300 Subject: [PATCH] merge release/dyn-1999_check-bkk-agency-perc --- .../CalculationStore/Effects/actions/calculate/index.ts | 6 ++++++ .../graphql/query/quote/fragments/quoteFieldsLite.graphql | 1 + src/core/services/CrmService/types/entities.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/src/client/stores/CalculationStore/Effects/actions/calculate/index.ts b/src/client/stores/CalculationStore/Effects/actions/calculate/index.ts index ed30e0d..f3d3fc6 100644 --- a/src/client/stores/CalculationStore/Effects/actions/calculate/index.ts +++ b/src/client/stores/CalculationStore/Effects/actions/calculate/index.ts @@ -82,11 +82,17 @@ export default function (this: ICalculationStore) { console.log('preparedData', preparedData); const getAdditionalData = () => { + let maxAllAgencyPerc: number | undefined; + if (this.getValue('recalcWithRevision')) { + maxAllAgencyPerc = + this.getOption('selectQuote')?.evo_maximum_percentage_av; + } return { //@ts-ignore minCashflowMSFONominal: this.irr().min, //@ts-ignore maxCashflowMSFONominal: this.irr().max, + maxAllAgencyPerc, }; }; diff --git a/src/core/services/CrmService/graphql/query/quote/fragments/quoteFieldsLite.graphql b/src/core/services/CrmService/graphql/query/quote/fragments/quoteFieldsLite.graphql index 46bd182..25fe40d 100644 --- a/src/core/services/CrmService/graphql/query/quote/fragments/quoteFieldsLite.graphql +++ b/src/core/services/CrmService/graphql/query/quote/fragments/quoteFieldsLite.graphql @@ -29,4 +29,5 @@ fragment quoteFieldsLite on quote { evo_program_import_subsidy_sum evo_equip_price evo_supplier_currency_price + evo_maximum_percentage_av } diff --git a/src/core/services/CrmService/types/entities.ts b/src/core/services/CrmService/types/entities.ts index 47f6e00..b8b681d 100644 --- a/src/core/services/CrmService/types/entities.ts +++ b/src/core/services/CrmService/types/entities.ts @@ -186,6 +186,7 @@ export interface IQuote extends BaseEntity { evo_equip_price?: number; evo_accept_period?: number; evo_db_accept_registration?: number; + evo_maximum_percentage_av?: number; } export interface IEvoGraph extends BaseEntity {