Basic amount fix

This commit is contained in:
James Cole
2022-08-23 05:46:43 +02:00
parent 73d97d90ae
commit 0b49e9b8a8

View File

@@ -148,6 +148,15 @@ class BudgetLimitController extends Controller
Log::debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d'), $end->format('Y-m-d')));
$limit = $this->blRepository->find($budget, $currency, $start, $end);
// sanity check on amount:
if ((float) $amount === 0.0) {
$amount = '1';
}
if ((int) $amount > 65536) {
$amount = '65536';
}
if (null !== $limit) {
$limit->amount = $amount;
$limit->save();