Test fix for budgeting.

This commit is contained in:
Sander Dorigo 2014-11-05 21:37:24 +01:00
parent f7117d47c2
commit f814f45e36

View File

@ -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();