mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Make sure you can't set negative amounts.
This commit is contained in:
@@ -185,7 +185,7 @@ class AvailableBudgetController extends Controller
|
||||
|
||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||
}
|
||||
if (0 === bccomp('0', $amount)) {
|
||||
if (bccomp($amount, '0') <= 0) {
|
||||
session()->flash('error', trans('firefly.invalid_amount'));
|
||||
|
||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||
@@ -238,7 +238,7 @@ class AvailableBudgetController extends Controller
|
||||
|
||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||
}
|
||||
if (0 === bccomp('0', $amount)) {
|
||||
if (bccomp($amount, '0') <= 0) {
|
||||
session()->flash('error', trans('firefly.invalid_amount'));
|
||||
|
||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||
|
Reference in New Issue
Block a user