From 5078aa18d4fe2567e2b9168a9d99055fc7e40b7b 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 Signed-off-by: Kyle M Hall (cherry picked from commit 2c4e29795a10ffb2d4835803ca6fa6fd44812c2f) Signed-off-by: Fridolin Somers --- .../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 851877fe7f..1e3561b9be 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt @@ -255,12 +255,12 @@ Item types administration
  • - + 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.
  • @@ -274,7 +274,7 @@ Item types administration
  • - + This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.
  • @@ -288,11 +288,11 @@ Item types administration
  • - +
  • - +
  • @@ -548,7 +548,10 @@ Item types administration 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