Bug 34355: Add a plugin hook - before_orderline_create

Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2023-09-12 11:48:32 +00:00 committed by Katrin Fischer
parent 6b85d06c19
commit d3da352b9f
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 17 additions and 0 deletions

View File

@ -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();