In item types, one can enter a negative amount for a rental charge. Koha allows this, saves the value, and shows it to you in admin. However, that value gets ignored at checkout. On the one hand, I can see weird use cases for giving patrons credits for checking out items. On the other hand, it would be a lot simpler to just not allow negative values to get set in the first place. Whichever way we go, we should pursue consistency and not let users enter values that don't get used.
Created attachment 124758 [details] [review] Bug 28985: Force positive numbers for itemtype charge fields This patch adds a min attribute to the fields on this page and adds other cost related fields to validator To test: 1 - Apply patch 2 - Browse to Administration->Item types 3 - Edit or create an item type 4 - Attempt to place a negative or non numeric value in: Daily rental charge Hourly rental charge Default replacement cost Processing fee 5 - You should not be able to
Created attachment 124761 [details] [review] Bug 28985: Force positive numbers for itemtype charge fields This patch adds a min attribute to the fields on this page and adds other cost related fields to validator To test: 1 - Apply patch 2 - Browse to Administration->Item types 3 - Edit or create an item type 4 - Attempt to place a negative or non numeric value in: Daily rental charge Hourly rental charge Default replacement cost Processing fee 5 - You should not be able to Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 124798 [details] [review] Bug 28985: Force positive numbers for itemtype charge fields This patch adds a min attribute to the fields on this page and adds other cost related fields to validator To test: 1 - Apply patch 2 - Browse to Administration->Item types 3 - Edit or create an item type 4 - Attempt to place a negative or non numeric value in: Daily rental charge Hourly rental charge Default replacement cost Processing fee 5 - You should not be able to Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Pushed to master for 21.11, thanks to everybody involved!
I see it is in 21.05.x for 21.05.05
Pushed to 20.11.x for 20.11.11
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.