Skip to content

Firefly III: a personal finances manager

Retrieve the new setting called 'budgetMaximum' which allows you to set the maximum budget.

James Cole01c5e15bcde8
diff --git a/app/controllers/BudgetController.php b/app/controllers/BudgetController.php
index 973f3336f8..a3fa3bd014 100644
--- a/app/controllers/BudgetController.php
+++ b/app/controllers/BudgetController.php
@@ -115,12 +115,14 @@ class BudgetController extends BaseController
}
);
- $spent = $budgets->sum('spent');
- $amount = $this->_preferences->get('budgetIncomeTotal' . \Session::get('start', Carbon::now()->startOfMonth())->format('FY'), 1000)->data;
- $overspent = $spent > $amount;
- $spentPCT = $overspent ? ceil($amount / $spent * 100) : ceil($spent / $amount * 100);
-
- return View::make('budgets.index', compact('budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
+ $spent = $budgets->sum('spent');
+ $amount = $this->_preferences->get('budgetIncomeTotal' . \Session::get('start', Carbon::now()->startOfMonth())->format('FY'), 1000)->data;
+ $overspent = $spent > $amount;
+ $spentPCT = $overspent ? ceil($amount / $spent * 100) : ceil($spent / $amount * 100);
+ $budgetMax = $this->_preferences->get('budgetMaximum', 1000);
+ $budgetMaximum = $budgetMax->data;
+
+ return View::make('budgets.index', compact('budgetMaximum', 'budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
}
/**