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