From 645e9ba1f75061a41274c83cfd589c518fb80735 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 10 Aug 2025 06:58:06 +0200 Subject: [PATCH] Go back 3 years max. --- app/Http/Controllers/Account/ShowController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/Account/ShowController.php b/app/Http/Controllers/Account/ShowController.php index 6419c10aa3..2f4b026dc5 100644 --- a/app/Http/Controllers/Account/ShowController.php +++ b/app/Http/Controllers/Account/ShowController.php @@ -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')]); $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'); $timer = Timer::getInstance(); $timer->start('period-overview');