fix prev commit

This commit is contained in:
Chika 2022-10-14 13:29:32 +03:00
parent ca8d060851
commit 333fcbd8b4

View File

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