When a POS transaction occurs and multiple items are being added to the Sale box, say for example 9 x .10 items. The total in the This Sale box appears correct, but down below the amount to Collect from Patron is off by a cent. To Recreate: 1. Have an item to sell for .10 in the POS module 2. Add this item to the "Sale" 9 times- do not use the Quantity option- manually click add item 9x. 3. Under the This Sale, it totals up to .90 4. Under the Collect Payment box, the total is .89
On further testing, this error also occurs when using the quantity field rather than clicking "Add" multiple times.
Apologies for my indecisiveness on the severity of this bug. I'm kicking it back to Major, as I've just confirmed that once Koha has mis-calculated that total the user cannot manually correct it.
:(, I should have predicted this. It's the same problem throughout Koha, but the point of sale system highlights it more often. We really need to start dealing with money differently system wide.
Created attachment 125287 [details] Calculation error
On version 21.05.14. The combination of the certain numbers appears to result in being 1 penny off. 0.6 x 3 = 1.79 0.7 x 3 = 2.09 Other combinations appear to be correct. In this case, only one item is added to the sale box. Screenshot attached to ticket.
Created attachment 128228 [details] [review] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match.
Created attachment 128229 [details] [review] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match.
Created attachment 128234 [details] [review] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
I also confirmed the errors Esther mentioned were present without the patch and fixed with it. Thanks, Martin!
Created attachment 128358 [details] [review] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Also tested, and in live operation, at Cheshire libraries.
Created attachment 128449 [details] [review] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.05.x for 21.05.08
Backported: Pushed to 20.11.x branch for 20.11.13
This causes a major problem with the FR currencyformat, see Bug 30139