From c6027e73c562a309f20dda804aed921982006e1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 4 Jan 2010 17:06:17 +0100 Subject: [PATCH] Fixed a major bug in ModReceiveOrder Orders were not splited correctly. --- C4/Acquisition.pm | 4 +++- acqui/parcel.pl | 2 -- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index f26e243250..2b60f39442 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1226,7 +1226,7 @@ sub ModReceiveOrder { , unitprice=? , freight=? , rrp=? - , quantityreceived=? + , quantity=? WHERE biblionumber=? AND ordernumber=?"); $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$quantrec,$biblionumber,$ordernumber); @@ -1236,6 +1236,8 @@ sub ModReceiveOrder { foreach my $orderkey ( "linenumber", "allocation" ) { delete($order->{'$orderkey'}); } + $order->{'quantity'} -= $quantrec; + $order->{'quantityreceived'} = 0; my $newOrder = NewOrder($order); } else { $sth=$dbh->prepare("update aqorders diff --git a/acqui/parcel.pl b/acqui/parcel.pl index 7b93a158f1..863bb7f329 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -111,7 +111,6 @@ if($input->param('format') eq "json"){ $data->{author} = $order->{author}; $data->{biblionumber} = $order->{biblionumber}; $data->{freight} = $order->{freight}; - $data->{quantrem} = $order->{quantity} - $order->{quantityreceived}; $data->{quantity} = $order->{quantity}; $data->{ecost} = $order->{ecost}; $data->{ordertotal} = sprintf("%.2f",$order->{ecost}*$order->{quantity}); @@ -234,7 +233,6 @@ for (my $i = 0 ; $i < $countpendings ; $i++) { my %line; %line = %{$pendingorders->[$i]}; $line{quantity}+=0; - $line{quantrem} = $line{quantity} - $line{quantityreceived}; $line{quantityreceived}+=0; $line{unitprice}+=0; $totalPunitprice += $line{unitprice}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl index c97c26eb79..5a6e8a71dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tmpl @@ -179,7 +179,7 @@ Order Summary View Record - Still on order + Quantity Unit cost Order cost   @@ -209,7 +209,7 @@
Publisher : " title="MARC" rel="gb_page_center[600,500]">MARC | " title="MARC" rel="gb_page_center[600,500]">Card - / + -- 2.39.5