From ebc2568109b8b49888917145f9cafaecd7b35218 Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Thu, 18 Jan 2024 09:28:29 +0100 Subject: [PATCH] Bug 35087: Discount rate only accepts a point as decimal separator When a comma is used to define the discount rate of a vendor, the data is not recorded (as NULL), it is however recorded if the separator is a point. Test plan: 1) Go to acqui module and edit a vendor 2) Set a discount rate with a comma as decimal separator 3) Edit again or request your database to see that there is no data saved 4) Do it again with a point as decimal and see it works 5) Apply this patch and reloard the build for the templates 6) Repeat step 2 and see the warning to inform you that you must use a point Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Owen Leonard Signed-off-by: Sonia Signed-off-by: Olivier V Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/includes/validator-strings.inc | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt | 2 +- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc index 87dde3e610..578b51da82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc @@ -12,6 +12,7 @@ digits: _("Please enter only digits."), equalTo: _("Please enter the same value again."), number: _("Please add amount in valid format: 0.00"), + decimal_rate: $.validator.addMethod("decimal_rate", $.validator.methods.number, "Please add rate in valid format: 0.00"), maxlength: $.validator.format(_("Please enter no more than {0} characters.")), minlength: $.validator.format(_("Please enter at least {0} characters.")), rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt index 29a1b19510..5c123b877d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -361,7 +361,7 @@ [% END %]
  • - %
  • + %
  • days diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index e357c8b398..fe7593bf6a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -139,6 +139,10 @@ $(document).ready(function () { number: true, }); + jQuery.validator.addClassRules("rate", { + decimal_rate: true + }); + $("#logout").on("click", function () { logOut(); }); -- 2.39.5