mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Make sure you can't set negative amounts.
This commit is contained in:
parent
284222c2ee
commit
34e2595a3d
@ -185,7 +185,7 @@ class AvailableBudgetController extends Controller
|
|||||||
|
|
||||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
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'));
|
session()->flash('error', trans('firefly.invalid_amount'));
|
||||||
|
|
||||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
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')]));
|
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'));
|
session()->flash('error', trans('firefly.invalid_amount'));
|
||||||
|
|
||||||
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
return redirect(route('budgets.index', [$start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||||
|
Loading…
Reference in New Issue
Block a user