mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #3270
This commit is contained in:
parent
12b3575c5c
commit
e58a5e12d6
@ -301,7 +301,6 @@ class BudgetController extends Controller
|
|||||||
$report[$budgetId]['currencies'][$currencyId]['sum_pct'] = $pct;
|
$report[$budgetId]['currencies'][$currencyId]['sum_pct'] = $pct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('reports.budget.partials.budgets', compact('sums', 'report'));
|
return view('reports.budget.partials.budgets', compact('sums', 'report'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,6 +316,7 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function general(Collection $accounts, Carbon $start, Carbon $end)
|
public function general(Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
|
|
||||||
$report = [
|
$report = [
|
||||||
'budgets' => [],
|
'budgets' => [],
|
||||||
'sums' => [],
|
'sums' => [],
|
||||||
@ -488,6 +488,7 @@ class BudgetController extends Controller
|
|||||||
foreach ($expenses as $currency) {
|
foreach ($expenses as $currency) {
|
||||||
foreach ($currency['budgets'] as $budget) {
|
foreach ($currency['budgets'] as $budget) {
|
||||||
$count = 0;
|
$count = 0;
|
||||||
|
$total = '0';
|
||||||
foreach ($budget['transaction_journals'] as $journal) {
|
foreach ($budget['transaction_journals'] as $journal) {
|
||||||
$count++;
|
$count++;
|
||||||
$key = sprintf('%d-%d', $budget['id'], $currency['currency_id']);
|
$key = sprintf('%d-%d', $budget['id'], $currency['currency_id']);
|
||||||
@ -506,7 +507,7 @@ class BudgetController extends Controller
|
|||||||
$report[$key]['entries'][$dateKey] = $report[$key] ['entries'][$dateKey] ?? '0';
|
$report[$key]['entries'][$dateKey] = $report[$key] ['entries'][$dateKey] ?? '0';
|
||||||
$report[$key]['entries'][$dateKey] = bcadd($journal['amount'], $report[$key] ['entries'][$dateKey]);
|
$report[$key]['entries'][$dateKey] = bcadd($journal['amount'], $report[$key] ['entries'][$dateKey]);
|
||||||
$report[$key]['sum'] = bcadd($report[$key] ['sum'], $journal['amount']);
|
$report[$key]['sum'] = bcadd($report[$key] ['sum'], $journal['amount']);
|
||||||
$report[$key]['avg'] = bcdiv($report[$key]['sum'], (string) $count);
|
$report[$key]['avg'] = bcdiv($report[$key]['sum'], (string) count($periods));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user