diff options
Diffstat (limited to 'abrechenbarkeit.lua')
| -rwxr-xr-x | abrechenbarkeit.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua index 5421d5a..2496a1b 100755 --- a/abrechenbarkeit.lua +++ b/abrechenbarkeit.lua @@ -385,6 +385,13 @@ local function r_transaction_post() local pcount = tonumber(data.pcount) local comment = data.comment local pname = data.pname + local max_amount = tonumber(config["max_amount"]) or 9999999999999 + + if math.abs(amount) > max_amount then + return error_box(format("{+error.invalid_amount} - {+max_amount}", { + amount = format_amount(math.abs(max_amount)), + })) + end if pname ~= nil or (pcode ~= nil and pcode ~= "") then -- check if barcode exists |