Skip to content

Firefly III: a personal finances manager

Original fix in place. #133

James Cole8cdcba3231a6
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index ababff90b4..e943310c69 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -289,13 +289,13 @@ class BudgetController extends Controller
return Response::json($cache->get()); // @codeCoverageIgnore
}
- // filter empty budgets:
-// foreach ($allBudgets as $budget) {
-// $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts);
-// if ($spent != 0) {
-// $budgets->push($budget);
-// }
-// }
+// filter empty budgets:
+ foreach ($allBudgets as $budget) {
+ $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts);
+ if ($spent != 0) {
+ $budgets->push($budget);
+ }
+ }
$entries = new Collection;
@@ -306,7 +306,7 @@ class BudgetController extends Controller
$row = [clone $start];
// each budget, fill the row:
- foreach ($allBudgets as $budget) {
+ foreach ($budgets as $budget) {
$spent = $repository->balanceInPeriodForList($budget, $start, $month, $accounts);
$row[] = $spent * -1;
}
@@ -314,7 +314,7 @@ class BudgetController extends Controller
$start->endOfMonth()->addDay();
}
- $data = $this->generator->year($allBudgets, $entries);
+ $data = $this->generator->year($budgets, $entries);
$cache->store($data);
return Response::json($data);