mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Expand budget report #1106
This commit is contained in:
@@ -133,7 +133,7 @@ class Support
|
||||
}
|
||||
|
||||
$return[$objectId]['earned'] = $entry;
|
||||
$return['sum']['earned'] = bcadd($return['sum']['earned'], $entry);
|
||||
$return['sum']['earned'] = bcadd($return['sum']['earned'], $entry);
|
||||
}
|
||||
|
||||
return $return;
|
||||
@@ -146,12 +146,15 @@ class Support
|
||||
*/
|
||||
protected function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [];
|
||||
$result = [
|
||||
'sum' => '0',
|
||||
];
|
||||
/** @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