From cdb18dbde8761d52b85a740c3a3c2bcc34c9e834 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 12 May 2025 15:00:03 +0000 Subject: [PATCH] Bug 39620: Fallback to GetMarcPrice if nessesary To test: 1. Have a MRC file with price populated in the 020$c 2. Have nothing the MarcFieldsToOrder or MarcItemFieldsToOrder sys prefs 3. Create a new basket and import from a new file 4. The price is not imported. 5. APPLY PATCH and restart_all 6. Try again, this time the price should be populated correctly. --- Koha/MarcOrder.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/MarcOrder.pm b/Koha/MarcOrder.pm index e58cc5634a2..13053c588d9 100644 --- a/Koha/MarcOrder.pm +++ b/Koha/MarcOrder.pm @@ -49,6 +49,7 @@ use C4::Biblio qw( GetMarcFromKohaField TransformHtmlToXml GetMarcQuantity + GetMarcPrice ); use C4::Items qw( AddItemFromMarc ); use C4::Budgets qw( GetBudgetByCode ); @@ -722,8 +723,8 @@ sub import_biblios_list { my $marcrecord = $import_record->get_marc_record || die "couldn't translate MARC information"; my $infos = _get_syspref_mappings( $marcrecord, 'MarcFieldsToOrder' ); - - my $price = $infos->{price} || undef; + my $price = + $infos->{price} ? $infos->{price} : GetMarcPrice( $marcrecord, C4::Context->preference('marcflavour') ); my $replacementprice = $infos->{replacementprice} || undef; my $quantity = $infos->{quantity} || undef; my $budget_code = $infos->{budget_code} || undef; -- 2.39.5