From d7d3f4f774d34dd6b06fb3eec507fe9046057414 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 16 Sep 2009 00:05:21 +0200 Subject: [PATCH] Moving item rather than Delete/recreate --- cataloguing/moveitem.pl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cataloguing/moveitem.pl b/cataloguing/moveitem.pl index 67cdf685ee..586ae3619d 100755 --- a/cataloguing/moveitem.pl +++ b/cataloguing/moveitem.pl @@ -70,21 +70,22 @@ if ($barcode && $biblionumber) { if ($item) { my $results = GetBiblioFromItemNumber($itemnumber, $barcode); - my $frombiblionumber = $results->{'biblionumber'}; + my $frombiblionumber = $results->{'biblionumber'}; my $moveresult = MoveItemFromBiblio($itemnumber, $frombiblionumber, $biblionumber); - my $order = GetOrderFromItemnumber($itemnumber); - if ($order){ - $order->{'biblionumber'} = $biblionumber; - ModOrder($order); - my $orderitem = { - ordernumber => $order->{'ordernumber'}, - itemnumber => $itemnumber, - newitemnumber => $newitemnumber, - }; - ModOrderItem($orderitem); - } + if ($moveresult) { + my $order = GetOrderFromItemnumber($itemnumber); + if ($order){ + $order->{'biblionumber'} = $biblionumber; + ModOrder($order); + my $orderitem = { + ordernumber => $order->{'ordernumber'}, + itemnumber => $itemnumber, + newitemnumber => $newitemnumber, + }; + ModOrderItem($orderitem); + } $template->param(success => 1); } else { $template->param(error => 1, -- 2.39.5