From 934580a0470bf8c0a8b14362172f4a80f8c47a49 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 --- .../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 8545c64a82..bef92ea1aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt @@ -358,7 +358,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 ceaf8b8d57..52606b73b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -138,6 +138,10 @@ $(document).ready(function () { number: true, }); + jQuery.validator.addClassRules("rate", { + decimal_rate: true + }); + $("#logout").on("click", function () { logOut(); }); -- 2.39.2