Go back 3 years max.

This commit is contained in:
James Cole
2025-08-10 06:58:06 +02:00
parent 56487c3a33
commit 645e9ba1f7

View File

@@ -118,6 +118,10 @@ class ShowController extends Controller
$chartUrl = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]); $chartUrl = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start; $firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
// go back max 3 years.
$threeYearsAgo = $start->subYears(3);
$firstTransaction = $firstTransaction->lt($threeYearsAgo) ? $threeYearsAgo : $firstTransaction;
Log::debug('Start period overview'); Log::debug('Start period overview');
$timer = Timer::getInstance(); $timer = Timer::getInstance();
$timer->start('period-overview'); $timer->start('period-overview');