Bug 37832: Fix Rental discount to be decimal like other similar fields

Added decimal input_mode and pattern for "Rental discount (%)" so it functions same way as "Fine amount" or "Overdue fines cap (amount)" rules, allowing user to save decimals only.

1. Go to Circulation and fine rules page and save some gibberish into "Rental discount (%)", see that it allows you to do that.
2. Apply the patch, and try same thing again, this time it should only allow you to save decimal numbers.

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Petro Vashchuk 2024-09-04 16:45:57 +03:00 committed by Katrin Fischer
parent 96b86f9b27
commit 143220d0c6
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -538,7 +538,7 @@
</select>
</td>
[% END %]
<td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
<td><input type="text" name="rentaldiscount" id="rentaldiscount" size="3" inputmode="decimal" pattern="^\d+(\.\d{2})?$" /></td>
[% IF Koha.Preference('UseRecalls') %]
<td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td>
<td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td>