В формирование PreparedValues добавляем след. параметры:

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
This commit is contained in:
vchikalkin 2022-09-23 17:08:44 +03:00
parent a800ad4b99
commit 952d26e9b4
2 changed files with 25 additions and 2 deletions

View File

@ -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);

View File

@ -1,4 +1,5 @@
export interface PreparedValues {
insuranceEvoKasko?: number;
extraBonusSumColumn?: number;
importProgramSum?: number;
calcDate?: Date;