Summary: | Create manual invoice with FR currency format show the incorrect format | ||
---|---|---|---|
Product: | Koha | Reporter: | The Minh Luong <the-minh.luong> |
Component: | Fines and fees | Assignee: | Katrin Fischer <katrin.fischer> |
Status: | CLOSED FIXED | QA Contact: | Jonathan Druart <jonathan.druart> |
Severity: | normal | ||
Priority: | P5 - low | CC: | arthur.suzuki, caroline.cyr-la-rose, david, jonathan.druart, lucas, philippe.blouin, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This fixes the price formatting when CurrencyFormat = FR. When adding a manual invoice, the amount input field was shown with a comma for debit types with default amounts, but it should be a decimal point. (For input fields we always use the decimal point and the display format uses the decimal separator defined by CurrencyFormat.)
|
Version(s) released in: |
22.11.00, 22.05.04, 21.11.11, 21.05.18
|
Circulation function: | |||
Attachments: |
Bug 30567: Create manual invoice with FR currency format show the correct format
Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR |
Description
The Minh Luong
2022-04-19 18:23:16 UTC
Created attachment 133413 [details] [review] Bug 30567: Create manual invoice with FR currency format show the correct format This patch correct the format of the price when creating a manual invoice with CurrencyFormat = FR To test: 1- Go in Administration->Debit types 2- Click on New debit type 3- Fill the form: Code: USEDBOOK Default amount: 0.50 Description: Used book Can be manually invoiced: Yes Can be sold: Optionnal 4- Save 5- Go in Patrons 6- Go in a patron's page 7- Go in the "Accounting" section 8- Click on "Create manual invoice" 9- Fill the form 10- Choose the created debit (Used book) 11- Notice that the format is incorrect (0,50 instead of 0.50) 12 - Apply the patch 13- We now see the correct format I can confirm the bug and the patch fixes it, but I am worried about side effects of this change to Price.pm. Are we sure it has no undesired effects in other places? We'll also need unit tests for this to PQA. Ok, with the patch the display format also changes to . instead of , - so this is not what we want. You can see this for example under administration > debit types. The rule is that input fields should always have ., but the display format depends on CurrencyFormat. Created attachment 135737 [details] [review] Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR In input fields we always use the decimal . while the display format uses the decimal separtor definded by CurrencyFormat. When adding a manual invoice without this patch, the amount is shown with comma, but it should be . in the input field. To test: 1- Go in Administration->Debit types 2- Click on New debit type 3- Fill the form: Code: USEDBOOK Default amount: 0.50 Description: Used book Can be manually invoiced: Yes 4- Save 5- Go to any patron account 6- Go to the "Accounting" tab 7- Click on "Create manual invoice" 8- Fill the form 9- Choose the created debit (Used book) 10- Verify that the format is incorrect (0,50 instead of 0.50) 11- Apply the patch 12- Verify the amount is now using the correct format I hope it's ok - I had an idea what could be wrong here and have written up an alternate patch. I'd really like to see this fixed :) Created attachment 136335 [details] [review] Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR In input fields we always use the decimal . while the display format uses the decimal separtor definded by CurrencyFormat. When adding a manual invoice without this patch, the amount is shown with comma, but it should be . in the input field. To test: 1- Go in Administration->Debit types 2- Click on New debit type 3- Fill the form: Code: USEDBOOK Default amount: 0.50 Description: Used book Can be manually invoiced: Yes 4- Save 5- Go to any patron account 6- Go to the "Accounting" tab 7- Click on "Create manual invoice" 8- Fill the form 9- Choose the created debit (Used book) 10- Verify that the format is incorrect (0,50 instead of 0.50) 11- Apply the patch 12- Verify the amount is now using the correct format Signed-off-by: David Nind <david@davidnind.com> Created attachment 137059 [details] [review] Bug 30567: Fix price formatting when adding a manual invoice with CurrencyFormat FR In input fields we always use the decimal . while the display format uses the decimal separtor definded by CurrencyFormat. When adding a manual invoice without this patch, the amount is shown with comma, but it should be . in the input field. To test: 1- Go in Administration->Debit types 2- Click on New debit type 3- Fill the form: Code: USEDBOOK Default amount: 0.50 Description: Used book Can be manually invoiced: Yes 4- Save 5- Go to any patron account 6- Go to the "Accounting" tab 7- Click on "Create manual invoice" 8- Fill the form 9- Choose the created debit (Used book) 10- Verify that the format is incorrect (0,50 instead of 0.50) 11- Apply the patch 12- Verify the amount is now using the correct format Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 22.11. Nice work everyone, thanks! Backported to 22.05.x for 22.05.04 pushed to 21.11.x for 21.11.11 Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document, marking resolved. If it applies, please backport. It's a TT filter change, but if the bug is in the version it's a bigger issue for users. I confirm we found this bug in 21.05 Backported: Pushed to 21.05.x branch for 21.05.18 |