From 651c8abbe24ef8b3eea1a5636140d822ec34c455 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 12 Sep 2023 11:48:32 +0000 Subject: [PATCH] Bug 34355: Add a plugin hook - before_orderline_create Signed-off-by: Andrew Fuerste Henry Signed-off-by: Nick Clemens --- Koha/MarcOrder.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Koha/MarcOrder.pm b/Koha/MarcOrder.pm index be8f9073196..8faa0492df1 100644 --- a/Koha/MarcOrder.pm +++ b/Koha/MarcOrder.pm @@ -60,6 +60,7 @@ use Koha::Import::Records; use Koha::Acquisition::Currencies; use Koha::Acquisition::Booksellers; use Koha::Acquisition::Baskets; +use Koha::Plugins; =head1 NAME @@ -1105,6 +1106,14 @@ sub create_items_and_generate_order_hash { # Remove uncertainprice flag if we have found a price in the MARC record $orderinfo{uncertainprice} = 0 if $orderinfo{listprice}; + Koha::Plugins->call( + 'before_orderline_create', + { + marcrecord => $fields->{marcrecord}, + orderline => \%orderinfo, + marcfields => $fields + } + ); my $order = Koha::Acquisition::Order->new( \%orderinfo ); $order->populate_with_prices_for_ordering(); @@ -1152,6 +1161,14 @@ sub create_items_and_generate_order_hash { # Remove uncertainprice flag if we have found a price in the MARC record $orderinfo{uncertainprice} = 0 if $orderinfo{listprice}; + Koha::Plugins->call( + 'before_orderline_create', + { + marcrecord => $fields->{marcrecord}, + orderline => \%orderinfo, + marcfields => $fields + } + ); my $order = Koha::Acquisition::Order->new( \%orderinfo ); $order->populate_with_prices_for_ordering(); -- 2.39.5