https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18723
Victor Grousset/tuxayo <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83971|0 |1 is obsolete| | --- Comment #17 from Victor Grousset/tuxayo <[email protected]> --- Created attachment 84150 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84150&action=edit Bug 18723: (Alternate Solution) Block form submission When entering an amount in "Actual Cost" on the orderreceive page, it is multiplied by 100 if the entered number's format does not match the "CurrencyFormat" syspref. This patch adds a value check before submitting the form. It uses regexps based on the "CurrencyFormat" syspref to validate that the number will be processed correctly. Test Plan: a)Replicate the issue: 0- Set CurrencyFormat to FR 1- Go to Acquisitions 2- Search for a Vendor 3- Click on "New basket" 4- Give basket a name and click "Save" 5- Click on "Add to basket" 6- Add an order through preferred method 7- In Accounting details, enter a vendor price with dot decimal (i.e. 19.44) 8- Save your order line 9- Click on "Close this basket" 10- Confirm closing of basket by clicking on "Yes, close" 11- Click on "Receive shipment" 12- Enter an invoice number and click "Next" 13- Click on "Receive" to the right of your order 14- In Accounting details, notice the Actual cost is written with a decimal dot. 15- Change the Actual cost, using a dot decimal (i.e 20.99) 16- Receive the order 17- Click on "Save" 18- In "Already received" notice the price is multiplied by 100 (i.e. 2099,00) 19- Click on "Cancel receipt" 20- Click on "Receive" to the right of your order 21- In Accounting details, change the Actual cost, using a comma decimal (i.e. 20,99) 22- Receive the order 23- Click on "Save" 24- In "Already received", notice the price is correct. b)Apply the patch c)Test the patch: 1- Click on "Cancel receipt" 2- Click on "Receive to the right of your order 3- In Accounting Details, notice the Actual cost is formatted correctly (comma decimal) 4- Change the Actual cost, using a dot decimal (21.99) 5- Receive the order 6- Click on "Save" 7- Notice an error message explaining the proper format for Actual cost (click "Ok") 8- Change the Actual cost, using a comma decimal (21,99) 9- Click on "Save" 10- In "Already received", notice the price is correct. 11- Test the other CurrencyFormat settings Signed-off-by: Victor Grousset <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
