Skip to content

Firefly III: a personal finances manager

Test fix for budgeting.

Sander Dorigof814f45e36ab
diff --git a/app/controllers/BudgetController.php b/app/controllers/BudgetController.php
index a564f1b7fa..5c587842e3 100644
--- a/app/controllers/BudgetController.php
+++ b/app/controllers/BudgetController.php
@@ -52,9 +52,13 @@ class BudgetController extends BaseController
Event::fire('limits.store', [$limit]);
} else {
- $limit->amount = $amount;
- $limit->save();
- Event::fire('limits.update', [$limit]);
+ if ($amount > 0) {
+ $limit->amount = $amount;
+ $limit->save();
+ Event::fire('limits.update', [$limit]);
+ } else {
+ $limit->delete();
+ }
}
// try to find the limit repetition for this limit:
$repetition = $limit->limitrepetitions()->first();