diff --git a/process/payments/reactions.ts b/process/payments/reactions.ts index ddfb695..07043c9 100644 --- a/process/payments/reactions.ts +++ b/process/payments/reactions.ts @@ -435,7 +435,9 @@ export default function paymentsReactions( shift(seasons, shiftNumber) ); const shiftedPeriods = new Set( - seasonsConstants.SEASONS_PERIODS[seasonType].map((x) => x + shiftNumber) + seasonsConstants.SEASONS_PERIODS[seasonType].map( + (position) => (position + shiftNumber) % seasonsConstants.SEASONS_PERIOD_NUMBER + ) ); const rows: Row[] = payments.map((value, i) => ({ value, @@ -493,7 +495,9 @@ export default function paymentsReactions( shift(seasons, shiftNumber) ); const shiftedPeriods = new Set( - seasonsConstants.SEASONS_PERIODS[seasonType].map((x) => x + shiftNumber) + seasonsConstants.SEASONS_PERIODS[seasonType].map( + (position) => (position + shiftNumber) % seasonsConstants.SEASONS_PERIOD_NUMBER + ) ); const rows: Row[] = payments.map((value, i) => ({ value,