From b296474cef4ec7b7eb491757cf7b230f481bef67 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 10 Sep 2021 12:12:07 +0000 Subject: [PATCH] Bug 28985: Force positive numbers for itemtype charge fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- .../prog/en/modules/admin/itemtypes.tt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt index dbab84bdcb..f61e0602f0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -311,12 +311,12 @@ Item types › Administration › Koha
  • - + This fee is charged once per checkout/renewal per item
  • - + This fee is charged at checkout/renewal time for each day between the checkout/renewal date and due date for loans specified in days.
  • @@ -330,7 +330,7 @@ Item types › Administration › Koha
  • - + This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.
  • @@ -344,11 +344,11 @@ Item types › Administration › Koha
  • - +
  • - +
  • @@ -601,7 +601,10 @@ Item types › Administration › Koha rules: { itemtype: { required: true }, description: { required: true }, - rentalcharge: { number: true } + rentalcharge: { number: true }, + rentalcharge_hourly: { number: true }, + defaultreplacecost: { number: true }, + processfee: { number: true } } }); $("#itemtype").on("blur",function(){ -- 2.39.5