[Koha-bugs] [Bug 18736] Problems in order calculations (rounding errors)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 15 11:54:04 CET 2019


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|BLOCKED                     |Failed QA

--- Comment #161 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Test pass. QA pass.
Hmm. Not wanting to be too precise, but we still have some subtle differences
in some lines of the last patch. The first line rounds at the unit; with a
whole quantity, it will be rounded. The second line is not rounded since you
multiply with tax rate. The algorithm of tax = incl - excl is only used in the
first line.
The third line shows rounding at final stage.
+            $order->{tax_value_on_ordering} = (
get_rounded_price($order->{ecost_tax_included}) -
get_rounded_price($order->{ecost_tax_excluded}) ) * $order->{quantity};
+            $order->{tax_value_on_ordering} = $order->{quantity} *
get_rounded_price($order->{ecost_tax_excluded}) *
$order->{tax_rate_on_ordering};

+        my $subtotal = get_rounded_price( $left *
$data->{'ecost_tax_included'} );

Please explain why you do what you do.

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


More information about the Koha-bugs mailing list