From 333fcbd8b4cff91723d5841d9a6f831d6744a2f9 Mon Sep 17 00:00:00 2001 From: Chika Date: Fri, 14 Oct 2022 13:29:32 +0300 Subject: [PATCH] fix prev commit --- process/payments/reactions.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/process/payments/reactions.ts b/process/payments/reactions.ts index f95a859..e63fbfb 100644 --- a/process/payments/reactions.ts +++ b/process/payments/reactions.ts @@ -436,9 +436,12 @@ export default function paymentsReactions( leasingPeriod, shift(seasons, shiftNumber) ); + const shiftedPeriods = new Set( + seasonsConstants.SEASONS_PERIODS[seasonType].map((x) => x + shiftNumber) + ); const rows: Row[] = payments.map((value, i) => ({ value, - status: seasonsConstants.SEASONS_PERIODS[seasonType].includes(i) ? 'Default' : 'Disabled', + status: shiftedPeriods.has(i) ? 'Default' : 'Disabled', })); const firstPaymentPerc = $calculation.getElementValue('tbxFirstPaymentPerc'); const lastPaymentPerc = $calculation.getElementValue('tbxLastPaymentPerc'); @@ -491,10 +494,12 @@ export default function paymentsReactions( leasingPeriod, shift(seasons, shiftNumber) ); - + const shiftedPeriods = new Set( + seasonsConstants.SEASONS_PERIODS[seasonType].map((x) => x + shiftNumber) + ); const rows: Row[] = payments.map((value, i) => ({ value, - status: seasonsConstants.SEASONS_PERIODS[seasonType].includes(i) ? 'Default' : 'Disabled', + status: shiftedPeriods.has(i) ? 'Default' : 'Disabled', })); const firstPaymentPerc = $calculation.getElementValue('tbxFirstPaymentPerc'); const lastPaymentPerc = $calculation.getElementValue('tbxLastPaymentPerc');