From 952d26e9b4ac41099b34101564c62d45ed579947 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Fri, 23 Sep 2022 17:08:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20PreparedValues=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5=D0=BC=20=D1=81=D0=BB?= =?UTF-8?q?=D0=B5=D0=B4.=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D1=80=D1=8B:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit InsuranceEvoKASKO если SelectLeasingWithoutKasko содержит данные, то считаем InsuranceEvoKASKO если в SelectLeasingWithoutKasko указана запись evo_addproduct_type, у которой evo_evokasko_calc_type = от стоимости минус ПП (100000001), то InsuranceEvoKASKO = (Стоимость ПЛ tbxLeaseObjectPrice - Скидка tbxSupplierDiscountRub - labelImportProgramSum + tbxAddEquipmentPrice), переведенное в рубли минус Первый платеж, руб. tbxFirstPaymentRub) * Себестоимость (закладываем в график), без НДС, руб evo_cost_service_provider_withoutnds из сущности addproducttype в SelectLeasingWithoutKasko иначе InsuranceEvoKASKO = (Стоимость ПЛ tbxLeaseObjectPrice - Скидка tbxSupplierDiscountRub - labelImportProgramSum + tbxAddEquipmentPrice), переведенное в рубли) * Себестоимость (закладываем в график), без НДС, руб evo_cost_service_provider_withoutnds из сущности addproducttype в SelectLeasingWithoutKasko иначе 0 --- .../Effects/actions/calculate/prepareData.ts | 26 +++++++++++++++++-- .../CoreService/types/Calculation/prepared.ts | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts b/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts index 845b5d6..d6e4111 100644 --- a/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts +++ b/src/client/stores/CalculationStore/Effects/actions/calculate/prepareData.ts @@ -186,6 +186,30 @@ export default function (this: ICalculationStore): PreparedData { ? values.leasingPeriod : 12; + //@ts-ignore + const importProgramSum: number = this.importProgramSum(); + //@ts-ignore + const plPriceRub: number = this.plPriceRub(); + //@ts-ignore + const discountRub: number = this.discountRub(); + + preparedValues.insuranceEvoKasko = 0; + const selectLeasingWithoutKasko = this.getOption('selectLeasingWithoutKasko'); + + if (selectLeasingWithoutKasko?.evo_evokasko_calc_type === 100_000_001) { + preparedValues.insuranceEvoKasko = + (selectLeasingWithoutKasko?.evo_cost_service_provider_withoutnds || 0) * + (plPriceRub - + discountRub - + importProgramSum + + values.addEquipmentPrice - + values.firstPaymentRub); + } else { + preparedValues.insuranceEvoKasko = + (selectLeasingWithoutKasko?.evo_cost_service_provider_withoutnds || 0) * + (plPriceRub - discountRub - importProgramSum + values.addEquipmentPrice); + } + preparedValues.insuranceKaskoNmper = (preparedValues.nmperInsurance || 0) >= 16 ? ((preparedValues.insuranceKasko || 0) * @@ -230,8 +254,6 @@ export default function (this: ICalculationStore): PreparedData { evo_currencychange?.evo_currencychange || 1, ); - //@ts-ignore - const importProgramSum = this.importProgramSum(); preparedValues.importProgramSum = importProgramSum / (1 + valuesConstants.VAT); diff --git a/src/core/services/CoreService/types/Calculation/prepared.ts b/src/core/services/CoreService/types/Calculation/prepared.ts index c2cadaa..5c6ba2e 100644 --- a/src/core/services/CoreService/types/Calculation/prepared.ts +++ b/src/core/services/CoreService/types/Calculation/prepared.ts @@ -1,4 +1,5 @@ export interface PreparedValues { + insuranceEvoKasko?: number; extraBonusSumColumn?: number; importProgramSum?: number; calcDate?: Date;