@@ -, +, @@ --- Koha/EDI.pm | 13 +++++-------- acqui/addorder.pl | 11 ----------- 2 files changed, 5 insertions(+), 19 deletions(-) --- a/Koha/EDI.pm +++ a/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', } ); --- a/acqui/addorder.pl +++ a/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; --