mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Fix #1213
This commit is contained in:
@@ -146,15 +146,12 @@ class Support
|
||||
*/
|
||||
protected function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [
|
||||
'sum' => '0',
|
||||
];
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$result[$accountId] = $result[$accountId] ?? '0';
|
||||
$result[$accountId] = bcadd($transaction->transaction_amount, $result[$accountId]);
|
||||
$result['sum'] = bcadd($result['sum'], $transaction->transaction_amount);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user