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