From 7853e2243c132d7988dfbd99a27241a86096fd18 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 10 May 2023 15:21:05 +0200 Subject: [PATCH] Bug 28844: Replace GetSuggestionFromBiblionumber --- C4/Acquisition.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 6873a67e854..ba4ed22cd76 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -22,7 +22,7 @@ use Modern::Perl; use Carp qw( carp croak ); use Text::CSV_XS; use C4::Context; -use C4::Suggestions qw( GetSuggestion GetSuggestionFromBiblionumber ModSuggestion ); +use C4::Suggestions qw( GetSuggestion ModSuggestion ); use C4::Biblio qw( GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ); use C4::Contract qw( GetContract ); use C4::Log qw( logaction ); @@ -1386,12 +1386,14 @@ sub ModReceiveOrder { $order->{invoice_unitprice} ||= $order->{unitprice}; $order->{invoice_currency} ||= Koha::Acquisition::Currencies->get_active->currency; - my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber ); - if ($suggestionid) { - ModSuggestion( {suggestionid=>$suggestionid, - STATUS=>'AVAILABLE', - biblionumber=> $biblionumber} - ); + if ( $order->{suggestionid} ) { + ModSuggestion( + { + suggestionid => $order->{suggestionid}, + STATUS => 'AVAILABLE', + biblionumber => $biblionumber + } + ); } my $result_set = $dbh->selectrow_arrayref( -- 2.25.1