MT 2069 : MoveItemFromBiblio now checks for orders
authorMatthias Meusburger <matthias.meusburger@biblibre.com>
Wed, 21 Oct 2009 14:13:11 +0000 (16:13 +0200)
committerMatthias Meusburger <matthias.meusburger@biblibre.com>
Wed, 21 Oct 2009 14:14:33 +0000 (16:14 +0200)
C4/Items.pm

index a060c36..61126d9 100644 (file)
@@ -30,6 +30,7 @@ use C4::Log;
 use C4::Branch;
 require C4::Reserves;
 use C4::Charset;
+use C4::Acquisition;
 
 use vars qw($VERSION @ISA @EXPORT);
 
@@ -2060,6 +2061,14 @@ sub MoveItemFromBiblio {
        # If we found an item (should always true, except in case of database-marcxml inconsistency)
        if ($item) {
 
+           # Checking if the item we want to move is in an order 
+           my $order = GetOrderFromItemnumber($itemnumber);
+           if ($order) {
+               # Replacing the biblionumber within the order if necessary
+               $order->{'biblionumber'} = $tobiblio;
+               ModOrder($order);
+           }
+
            # Saving the modification
            ModBiblioMarc($record, $frombiblio, $frameworkcode);