From 756afbb89bae87ceac6f3b90c21a67952bab03e8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 13 Dec 2012 14:26:54 +0100 Subject: [PATCH] Bug 9280: FIX price calculation adding an order from a staged file Test plan: Add an order from a staged file containing a price value (010$d for UNIMARC user). Check this patch with 2 different vendors (listprice=1 and listprice=0). Check the calculated price (depending discount and gstrate). Signed-off-by: mathieu saby Signed-off-by: Elliott Davis introduces no new bugs Signed-off-by: Jared Camins-Esakov I was unable to replicate the bug in MARC21, but the patch introduces no regressions that I could find, so I am pushing it anyway. Note: Acquisitions remains unusable under Plack. In order to test this patch I first applied the patch on bug 9432. --- acqui/addorderiso2709.pl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index c4f889fbe7..0e0670f0ea 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -222,12 +222,8 @@ if ($op eq ""){ my $basket = GetBasket( $orderinfo{basketno} ); my $bookseller = GetBookSellerFromId( $basket->{booksellerid} ); $orderinfo{gstrate} = $bookseller->{gstrate}; - if ( $bookseller->{listincgst} ) { - $orderinfo{ecost} = $price; - } else { - $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} ); - } - $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} ); + $orderinfo{rrp} = $price; + $orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $bookseller->{discount} / 100 ); $orderinfo{listprice} = $orderinfo{rrp}; $orderinfo{unitprice} = $orderinfo{ecost}; $orderinfo{total} = $orderinfo{ecost}; -- 2.20.1