fix(finance): prefer open cycle in dashboard

This commit is contained in:
2026-03-11 00:36:42 +04:00
parent 8f9abf998f
commit 4dde04ca06
2 changed files with 33 additions and 1 deletions

View File

@@ -58,7 +58,7 @@ async function getCycleByPeriodOrLatest(
return repository.getCycleByPeriod(BillingPeriod.fromString(periodArg).toString())
}
return repository.getLatestCycle()
return (await repository.getOpenCycle()) ?? repository.getLatestCycle()
}
function billingPeriodLockDate(period: BillingPeriod, day: number): Temporal.PlainDate {