Bug 35398: Fix LRP support for EDI orders with single items

This patch corrects a mistake in the original implementaiton of bug
20595 where we introduced support for the LRP segments being used to
automatically assign items ordered via EDI to stock rotation plans.

Signed-off-by: Sophie Halden <sophie.halden@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2023-11-24 13:06:37 +00:00 committed by Katrin Fischer
parent de79e957ce
commit 783a58a9d3
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -829,6 +829,22 @@ sub quote_item {
}
);
++$created;
my $lrp =
$item->girfield( 'library_rotation_plan' );
if ($lrp) {
my $rota =
Koha::StockRotationRotas->find( { title => $lrp },
{ key => 'stockrotationrotas_title' } );
if ($rota) {
$rota->add_item($itemnumber);
$logger->trace("Item added to rota $rota->id");
}
else {
$logger->error(
"No rota found matching $lrp in orderline");
}
}
}
}
}