diff --git a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts index 2e82ec9..e07a5bd 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/tablesReactions.ts @@ -149,11 +149,36 @@ export default [ (calculationStore, calculationProcess) => ({ expression: () => { - const { leasingPeriod } = calculationStore.values; - return leasingPeriod; + const { leasingPeriod, leasingWithoutKasko } = calculationStore.values; + return { leasingPeriod, leasingWithoutKasko }; }, - effect: leasingPeriod => { - if (leasingPeriod) { + effect: ({ leasingPeriod, leasingWithoutKasko }) => { + if (leasingWithoutKasko) { + const otherInsuranceCompany = + calculationStore.tables.tableInsurance.options?.insuranceCompany?.find( + x => x.name?.includes('ПРОЧИЕ'), + ); + calculationStore.setTableRow('tableInsurance', rows => + rows.findIndex(x => x?.key === 'kasko'), + )({ + insuranceCompany: { + value: otherInsuranceCompany?.value, + status: ElementStatus.Disabled, + }, + insCost: { + value: 0, + status: ElementStatus.Disabled, + }, + insTerm: { + value: 100_000_000, + status: ElementStatus.Disabled, + }, + insured: { + value: 100_000_000, + status: ElementStatus.Disabled, + }, + }); + } else if (leasingPeriod) { if (leasingPeriod < 12) { calculationStore.setTableRow('tableInsurance', rows => rows.findIndex(x => x?.key === 'osago'),