When creating a manual invoice with CurrencyFormat = FR , it shows the incorrect format. 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)
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