Bug 34231

Summary: Allow different input formats for monetary values
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, jonathan.druart, michaela.sieber, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30718
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21507
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33028
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34169
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Katrin Fischer 2023-07-07 16:37:54 UTC
There are several bugs already about this, but after discussing with Joubu and Tomas today I think it deserves a fresh start.

On bug 30718 Jonathan wrote:

> "Show the user a readable date (as per altFormat), but return
> something totally different to the server."
> 
> It's actually an option we want to use for all our dates, that will
> reduce a lot the overhead in our controllers.

And we should use the same approach for dealing with monetary amounts in patrons/account and in the acquisition module.

Using a client side solution we avoid having to touch the .pl scripts and it will also make it easier to work with the API. 

We'd have 2 input fields, one hidden, with the 'raw' data in the expected database format, and one visible input field for entering and displaying the 'formatted' data.

When sending the data to the server, only the 'raw' data will be processed.


To explain the need/use case:

At the moment we don't have any validation on input fields in the acquisition module and that leads to input errors that can have dire consequences. 1,00 might be turned into 100 or 1000 or just end up as an empty field.

We also only allow the 'US' format with decimal dot, but not the French/German format of decimal comma. This is also a usability issue as keyboard with German layout don't have a . in the number block, only a comma.