[Koha-bugs] [Bug 35114] Total on basketgroup can be different than basket details total

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 7 14:11:19 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35114

--- Comment #13 from Thibaud Guillot <thibaud.guillot at biblibre.com> ---
Hello everyone,

I've adjusted the rounding functions and their calculation.

According to the OrderPriceRounding system preference, when the
get_rounded_price function was called, the prices were adjusted at the wrong
time.
(Note: without this patch, which corrects the use of unit price in
calculations, the system preference has no effect, as the unit price is
retrieved beforehand and modified in JS to round it off).


Lines were rounded one by one and then the total was rounded... This can lead
to problems: 

example: 
- 13.44567 -> rounded to 13.45
- 2.44567 -> rounded to 2.45

total 13.44567 + 2.44567 = 15.89134 rounded to 15.89
total 13.45 + 2.45 = 15.90

so I've kept this rounding behavior on each of the lines, but I've added a
total that I calculate without rounding, and then pass the corresponding
roundings to the view.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list