Fix three years ago.

This commit is contained in:
James Cole
2025-08-10 07:31:10 +02:00
parent ef317d5b3c
commit c3a28fc698
2 changed files with 9 additions and 6 deletions

View File

@@ -119,8 +119,11 @@ class ShowController extends Controller
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
// go back max 3 years.
$threeYearsAgo = $start->subYears(3);
$firstTransaction = $firstTransaction->lt($threeYearsAgo) ? $threeYearsAgo : $firstTransaction;
$threeYearsAgo = clone $start;
$threeYearsAgo->startOfYear()->subYears(3);
if($firstTransaction->lt($threeYearsAgo)) {
$firstTransaction = clone $threeYearsAgo;
}
Log::debug('Start period overview');
$timer = Timer::getInstance();