[Koha-bugs] [Bug 12310] Accept different monetary formats as input

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 3 10:01:26 CEST 2018


--- Comment #56 from Victor Grousset/tuxayo <victor.grousset at biblibre.com> ---
Created attachment 73546
Bug 12310 : Decimal separator issues: some fixes in fines

The main goal is to prevent
- x100 or /100 of the amounts
- decimal part truncation

Fixes Bug 19521 - Partial fine payment is not working with comma decimal

- Gets rid of the spaces, currency symbols, names (EUR)
  There is nothing specific about currency symbols is this patch.
  It just removes everything that is not a digit a minus or a separator.

It handles:
- by default comma and dot as decimal separators on the same instance
- dot or comma as thousands separators if choose to use only one of them
    as decimal separator. See DigitSeparator syspref.
- minuses, doesn't remove them

== Test plan ==
1. Use a translation of the staff interface if possible.
2. When you pay an existing fine (more details in the next steps if needed).
     Check that you can't enter any string except like "XX.XX" (examples in
     Annex 1) without having an issue after validation. (x100,
     trucation, etc)
3. Apply this patch
4. run ~/src/installer/data/mysql/updatedatabase.pl
5. In the manual invoice (cgi-bin/koha/members/maninvoice.pl)
6. Apply the annex 1 to the "Amount" field
7. When paying a fine (cgi-bin/koha/members/paycollect.pl)
8. Click on "Pay amount" to go to the page to pay all fines
9. Apply the annex 1 to the "Collect from patron" field
10. Click on "Pay" to go to the page to pay fine
11. Apply the annex 1 to the "Collect from patron" field
12. Go to "Create manual credit" (staff://cgi-bin/koha/members/mancredit.pl)
13. Apply the annex 1 to the "Amount" field
14. If you have ideas of stuff to try to find *regressions* from the previous
    versions, then try. You might spare librarian tears by finding something
    before it's released. (and prevent me from having bounty on my head)
15. Express your happiness. This is important, otherwise the sign off spell
    work! The details of expressing your happiness depend on your culture and

=== Annex 1: Subpart for each concerned page ===
1. Set DecimalSeparators syspref to ",."
2. Input "12,34"
3. Press the "Tab/Tabulation" key. It will unfocus the field and trigger the
     conversion. Validating the form does the same but it's a trick to test
     quickly by not switching to another page.
4. The value should have been converted to 12.34
5. What follows is just a list of examples. They don't have to be tried on each
6. Do the same with "12,34 EUR" and ensure that it's converted to "12,34"
7. Same with "EUR 12.34" -> "12.34"
8. "EUR 12.34€hi lyonthree" -> "12.34"
9. "123 456,7" -> "123456.7"
10. "2" -> "2"
11. "2,0" -> "2.0"
12. "-1'345.95" -> "-1345.95"
13. ",1234" -> ".1234"
14. Set DecimalSeparators syspref to ","
15. Reload the page with the form
16. "1.000" -> "1000"
17. "1.000.000,10" -> "1000000.10"
18. Set DecimalSeparators syspref to "."
19. Reload the page with the form
20. "1,000" -> "1000"
21. "1,000,000.10" -> "1000000.10"
22. Validate the form and check that the final value with the dot was
      well handled.
23. Think about Koalas and smile. 🐨🐨🐨

You are receiving this mail because:
You are watching all bug changes.

More information about the Koha-bugs mailing list