Bug 14963: Set status=ORDERED for suggestions created from existing record
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 7 Nov 2019 17:18:31 +0000 (18:18 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 2 Jan 2020 13:08:55 +0000 (13:08 +0000)
Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

acqui/addorder.pl

index 2c269e0..9ff4e79 100755 (executable)
@@ -269,13 +269,21 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) {
 
         # create the record in catalogue, with framework ''
         my ($biblionumber,$bibitemnum) = AddBiblio($record,'');
-        # change suggestion status if applicable
-        if ($$orderinfo{suggestionid}) {
-            ModSuggestion( {suggestionid=>$$orderinfo{suggestionid}, STATUS=>'ORDERED', biblionumber=>$biblionumber} );
-        }
+
         $orderinfo->{biblionumber}=$biblionumber;
     }
 
+    # change suggestion status if applicable
+    if ( $orderinfo->{suggestionid} ) {
+        ModSuggestion(
+            {
+                suggestionid => $orderinfo->{suggestionid},
+                biblionumber => $orderinfo->{biblionumber},
+                STATUS       => 'ORDERED',
+            }
+        );
+    }
+
     $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq '';
 
     $orderinfo = C4::Acquisition::populate_order_with_prices(