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 <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Elliott Davis <elliott@bywatersolions.com>
introduces no new bugs
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
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.
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};