With Koha language set to de-DE, it is not possible to enter numeric values with decimal separator point like 5.00 if the input field is of type "numeric". Validation requires comma (,) Independently on Koha language and CurrencyFormat settings, you get an error message (in German): "Bitte geben Sie eine Nummer ein." To verify: - Install language de-DE (alternatively use Firebug to manipulate page HTML to <html lang="de-DE"> or to set lang="de-DE directly in form field). - Go to /cgi-bin/koha/members/maninvoice.pl?borrowernumber=XXX ("Manuelle Gebühr") - In field "Betrag:", enter 5.00 Result: Field border turns to red, field shows tooltip "Bitte geben Sie eine Nummer ein." Expected result: Point as decimal separator is accepted. Same behaviour with it-IT, fr-FR, nl-NL However if you set language to en or de-CH, both comma and point are accepted.
More information: Discussion on IRC: http://irc.koha-community.org/koha/2016-08-09#i_1847065 Bug 12310 - Accept different monetary formats as input
Files with input type "numeric" (git grep --files-with-matches 'type="number"'): Decimal: koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt Only digits (no problem): koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt
We are currently running into this - it's irritating for the libraries tht sometimes you have to use . and other times you have to use , - There is a lot of error potential if you are not careful. Updating severity a bit.
At the moment this problem exists in 2 files: maninvoice.tt and mancredit.tt. Pasting the fix we did on our installations here for making a proper patch later: --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -70,7 +70,7 @@ type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.li <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li> <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> - <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> + <li><label for="amount">Amount: </label><input type="text" pattern="\d+(\.\d{2})?" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> </ol></fieldset> <fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset> </form>
I do not recreate, on /members/maninvoice.pl?borrowernumber=5, I tried with FF ESR 45.4.0 and Chromium 55.0.2883.75. With de-DE, I do see lang=de-DE, but 12.3 and 12,3 are ok
If we simply replace type="number" with type="text", we will reintroduce bug 2542.
(In reply to Jonathan Druart from comment #6) > If we simply replace type="number" with type="text", we will reintroduce bug > 2542. That could work using the pattern attribute indeed.
(In reply to Jonathan Druart from comment #5) > I do not recreate, on /members/maninvoice.pl?borrowernumber=5, I tried with > FF ESR 45.4.0 and Chromium 55.0.2883.75. > With de-DE, I do see lang=de-DE, but 12.3 and 12,3 are ok Hm. That's odd. Might be some change in browser behaviour? We are using ESR at work too. Will retest.
I ended up patching it like that: - <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> + <li><label for="amount">Amount: </label><input type="text" pattern="\d+(\.\d{2})?" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
It could be a mix of having a "German" firefox installed and Plack and other settings... we have seen some weird things happening. See bug 18186.
Popping this in here so we don't loose it. https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/