From ee13e82d4ec2e793c32830089b30773ccf91c456 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Tue, 15 Oct 2013 14:57:36 +0200 Subject: [PATCH] Bug 10461 - tax not taken in to account in the acq budget summaries Calculation of ecost and unitprice whith the tax information according to preferences in the vendor page Test plan : Create a new fund Define different tax rate in "gist" in system preferences Edit a vendor and add a tax rate and put List prices "Include tax" Add a new basket and a new order at this vendor and on the new fund Check the budget summary in acqui-home.pl, the total price of the order is add in the amount "ordered" of the new fund Edit the vendor and changed List Prices "Don't include tax" Check the budget summary in acqui-home.pl, the total price more the tax is add in the amount "ordered" of the new fund Go back to the vendor and put Invoice prices: "Include tax" Go to the receive shipments, receive your order Check the budget summary in acqui-home.pl, the actual cost of the order is add in the amount "spent" of the new fund Go back to the vendor and put Invoice prices: "Don't include tax" Check the budget summary in acqui-home.pl, the actual cost more the tax of the order is add in the amount "spent" of the new fund --- acqui/addorder.pl | 4 ++-- acqui/orderreceive.pl | 15 ++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 42324aa..e24be41 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -154,7 +154,7 @@ my $orderinfo = $input->Vars; $orderinfo->{'list_price'} ||= 0; $orderinfo->{'uncertainprice'} ||= 0; $orderinfo->{subscriptionid} ||= undef; - +$orderinfo->{gstrate}; my $user = $input->remote_user; # create, modify or delete biblio @@ -195,7 +195,7 @@ if ( $orderinfo->{quantity} ne '0' ) { } $orderinfo->{biblionumber}=$biblionumber; } - +$orderinfo->{ecost}= $orderinfo->{ecost} + $orderinfo->{ecost}*$orderinfo->{gstrate} if $orderinfo->{listinc} == 0; $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; # if we already have $ordernumber, then it's an ordermodif diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 8fc760b..c938e46 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -170,19 +170,16 @@ if ( $bookseller->{listincgst} ) { $ecost = $order->{ecost}; $unitprice = $order->{unitprice}; } else { - $rrp = $order->{rrp} / ( 1 + $order->{gstrate} ); - $ecost = $order->{ecost} / ( 1 + $order->{gstrate} ); - $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} ); + $unitprice = $order->{unitprice} + ($order->{unitprice}*$order->{gstrate} ); } } else { if ( $bookseller->{invoiceincgst} ) { - $rrp = $order->{rrp} * ( 1 + $order->{gstrate} ); - $ecost = $order->{ecost} * ( 1 + $order->{gstrate} ); - $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} ); + $rrp = $order->{rrp} +($order->{rrp}*$order->{gstrate} ); + $ecost = $order->{ecost} +($order->{ecost}*$order->{gstrate}); } else { - $rrp = $order->{rrp}; - $ecost = $order->{ecost}; - $unitprice = $order->{unitprice}; + $unitprice = $order->{unitprice} + ($order->{unitprice}*$order->{gstrate} ); + $rrp = $order->{rrp} +($order->{rpp}*$order->{gstrate} ); + $ecost = $order->{ecost} +($order->{ecost}*$order->{gstrate}) } } -- 1.7.2.5