mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix for #2460
This commit is contained in:
@@ -106,7 +106,7 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
$entry['end_balance'] = $endSet[$account->id] ?? '0';
|
$entry['end_balance'] = $endSet[$account->id] ?? '0';
|
||||||
|
|
||||||
// first journal exists, and is on start, then this is the actual opening balance:
|
// first journal exists, and is on start, then this is the actual opening balance:
|
||||||
if (null !== $first && $first->date->isSameDay($start)) {
|
if (null !== $first && $first->date->isSameDay($start) && TransactionType::OPENING_BALANCE === $first->transactionType->type) {
|
||||||
Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d')));
|
Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d')));
|
||||||
$entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount;
|
$entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount;
|
||||||
Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance']));
|
Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance']));
|
||||||
@@ -255,6 +255,7 @@ class AccountTasker implements AccountTaskerInterface
|
|||||||
];
|
];
|
||||||
$report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
|
$report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $report;
|
return $report;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user