Bug 22791: Unify calculation between aqui-home and ordered.pl
authorNick Clemens <nick@bywatersolutions.com>
Fri, 26 Apr 2019 19:58:05 +0000 (19:58 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 7 May 2019 11:28:34 +0000 (11:28 +0000)
To test:
1 - Enable order price rounding
2 - Order an example with 8 * 16,99 and 42% discount, 19.45% tax.
3 - Check ordered page - 94.17 is total
4 - Check aqui-home - 94.16 is total
5 - Apply patch
6 - Verify numbers now match

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

acqui/ordered.pl

index ebf89e8..f6796f2 100755 (executable)
@@ -99,7 +99,7 @@ while ( my $data = $sth->fetchrow_hashref ) {
         $left = $data->{'quantity'};
     }
     if ( $left && $left > 0 ) {
-        my $subtotal = get_rounded_price( $left * $data->{'ecost_tax_included'} );
+        my $subtotal = $left * get_rounded_price( $data->{'ecost_tax_included'} );
         $data->{subtotal} = sprintf( "%.2f", $subtotal );
         $data->{'left'} = $left;
         push @ordered, $data;