Bugzilla – Attachment 167746 Details for
Bug 35087
Discount rate should only allow valid input formats
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35087: Discount rate only accepts a point as decimal separator
Bug-35087-Discount-rate-only-accepts-a-point-as-de.patch (text/plain), 3.56 KB, created by
Owen Leonard
on 2024-06-14 15:57:47 UTC
(
hide
)
Description:
Bug 35087: Discount rate only accepts a point as decimal separator
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-06-14 15:57:47 UTC
Size:
3.56 KB
patch
obsolete
>From 934580a0470bf8c0a8b14362172f4a80f8c47a49 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >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 <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Sonia <sonia.bouis@univ-lyon3.fr> >--- > .../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 @@ > <input type="hidden" name="tax_rate" value="0" /> > [% END %] > <li><label for="discount">Discount: </label> >- <input type="text" size="6" id="discount" name="discount" value="[% discount | format ('%.1f') %]" />%</li> >+ <input class="rate" type="text" size="6" id="discount" name="discount" value="[% discount | format ('%.1f') %]" />%</li> > <li> > <label for="deliverytime">Delivery time: </label> > <input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime | html %]" /> 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35087
:
157302
|
157626
|
158921
|
159831
|
161128
|
161225
|
161237
|
161596
|
161597
|
161598
|
161704
|
161705
|
161706
|
162065
|
162066
|
162067
|
164739
|
164740
|
167746
|
167747
|
171197
|
171198
|
171594
|
171595