Bug 34231 - Allow different input formats for monetary values
Summary: Allow different input formats for monetary values
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement with 10 votes (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-07 16:37 UTC by Katrin Fischer
Modified: 2023-07-07 16:37 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.