From fe8660751aa0272fa7b48784ad7c0e6178dcdab3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Nov 2023 14:56:06 +0100 Subject: [PATCH] Bug 35717: Adjust other calls Signed-off-by: Nick Clemens --- Koha/EDI.pm | 13 +++++-------- acqui/addorder.pl | 11 ----------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/Koha/EDI.pm b/Koha/EDI.pm index ceb9a2ccd41..0cacb45e6a5 100644 --- a/Koha/EDI.pm +++ b/Koha/EDI.pm @@ -45,6 +45,7 @@ use Koha::Plugins; # Adds plugin dirs to @INC use Koha::Plugins::Handler; use Koha::Acquisition::Baskets; use Koha::Acquisition::Booksellers; +use Koha::Acquisition::Orders; our $VERSION = 1.1; @@ -330,16 +331,12 @@ sub process_invoice { # ModReceiveOrder does not validate that $ordernumber exists validate here if ($order) { - # check suggestions - my $s = $schema->resultset('Suggestion')->search( - { - biblionumber => $order->biblionumber->biblionumber, - } - )->single; - if ($s) { + my $order_koha_object = Koha::Acquisition::Orders->find($ordernumber); + my $suggestions = $order_koha_object->suggestions; + while ( my $suggestion = $suggestions->next ) { ModSuggestion( { - suggestionid => $s->suggestionid, + suggestionid => $suggestion->id, STATUS => 'AVAILABLE', } ); diff --git a/acqui/addorder.pl b/acqui/addorder.pl index f8d4f9e0b20..5ffe3d8cc52 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -329,17 +329,6 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { $orderinfo->{biblionumber}=$biblionumber; } - # change suggestion status if applicable - if ( my $suggestionid = $input->param('suggestionid') ) { - ModSuggestion( - { - suggestionid => $suggestionid, - biblionumber => $orderinfo->{biblionumber}, - STATUS => 'ORDERED', - } - ); - } - $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; my $order; -- 2.30.2