On bug 19271 we decided that the work to fix the prices should be split out into it's own bug. Leaving all credit to Katrin for spotting the issue and the initial patch.
Created attachment 79485 [details] [review] Bug 21427: Format prices on ordered/spent lists Improvements to the display of lists of ordered and received orders: - Format prices according to CurrencyFormat system preference To test: - Make sure you have some pending and received orders - Access the Spent and Ordered pages by clicking on the amount ordered or spent on the acq start page - Verify that - All price information is shown according to CurrencyFormat Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Copying across Jonathans issue with this implimentation: (Jonathan Druart from comment #5) > I would not format the prices in the same patch/bug report, I am expecting > regressions here: sum of round numbers (sprintf %.2f) vs round of sum (if it > makes sense...) (Jonathan Druart from comment #7) > use Modern::Perl; > my $x = 12.344; > my $y = 67.213; > say sprintf("%.2f", $x)+sprintf("%.2f", $y); > say sprintf("%.2f", $x+$y);' > > 79.55 > 79.56 (Martin Renvoize from comment #8) > Man that's upsetting, but I have to agree with Jonathan here.. the totals > shouldn't really be calculated in this script in my opinion. But because > they are, we can't make this change here. > > Could we perhaps split into two bugs please Katrin?
Is it possible that this will not be a regression but a bug fix? It seems wrong that we added up the truncated prices int he first place?
I agree it's likely a bugfix.. however, I'm not sure about its implementation here.. I'd like to get Nicks opinion as it's overlapping with bug 18736 round errors. Ok, so in this case it's only at display time, but it's at display time that users will actually see the end results of the calculations and so those displayed numbers are what end users will expect are used throughout calculations within the system. My point really is that 'different' isn't necessarily wrong.. but I'm not qualified to argue for or against moving to it.
Also.. in reality I'd be more comfortable with these calculations being shifted up a level into the objects rather than in the display scripts.. that way the same calculations would be shared system-wide rather than risking them being re-implemented elsewhere in a different way.
Talked to Katrin - I think we can do as she suggested on bug 19271 - don't touch the scripts and simply add the price filter on display
I'm game for that :)
21282 adds a bit of filters. Waiting for that one.
what's the status of bug 21427? Carnegie Stout Team
Created attachment 83831 [details] [review] Bug 21427: Format prices on ordered/spent lists consistently Some price information on the spent and ordered list already used the $Price filter. With this patch all amounts should be formatted according to the CurrencyFormat system preference. 1) Switch CurrencyFormat to FR 2) Make sure you have - Pending orders - An open invoice with shipment cost and adjustment with "encumber while open" checked - A received order - A closed invoice with shipment cost and adjustment 3) View the "oder" and "spent" lists clicking on the amounts in the budget and funds table on the acq start page 4) Verify all price information is formatted wit decimal comma 5) Switch CurrencyFormat to other settings and verify display changes accordingly
(In reply to Brian from comment #9) > what's the status of bug 21427? > > Carnegie Stout Team Hi Carnegie Stout, took me a bit to get back to this. New patch added, would be easy to test with sandboxes (https://wiki.koha-community.org/wiki/Sandboxes) ;)
Created attachment 84168 [details] [review] Bug 21427: Format prices on ordered/spent lists consistently Some price information on the spent and ordered list already used the $Price filter. With this patch all amounts should be formatted according to the CurrencyFormat system preference. Signed-off-by: Jack Kelliher <jke0429@stacmail.net>
Created attachment 84886 [details] [review] Bug 21427: Format prices on ordered/spent lists consistently Some price information on the spent and ordered list already used the $Price filter. With this patch all amounts should be formatted according to the CurrencyFormat system preference. Signed-off-by: Jack Kelliher <jke0429@stacmail.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 84887 [details] [review] Bug 21427: (QA follow-up) Fix for tabs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Added tab fixing followup. Nice to see this one working it's way through.. happy to pass qa now.
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.04