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;