From 30589b8ba41cfd00032432193e874f84de22b75a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 29 Aug 2023 13:35:53 -0400 Subject: [PATCH] Bug 34645: Add support for discount, sort1 and sort2 to MarcItemFieldsToOrder MarcItemFieldsToOrder supersedes MarcFieldsToOrder, so the fields discount, sort1, and sort2 won't be populated if using the latter - We should add these fields in to allow the orders to be created correctly Test Plan: 1) Set up MarcItemFields to order 2) Map the new keys discount, sor1 and sort2 to fields in the order record 3) Import an order record into a basket 4) Note those fields were imported! Signed-off-by: Esther --- acqui/addorderiso2709.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 250d9c2bb3..dbb851d8a2 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -517,7 +517,7 @@ sub import_biblios_list { # Items my @itemlist = (); my $all_items_quantity = 0; - my $alliteminfos = get_infos_syspref_on_item('MarcItemFieldsToOrder', $marcrecord, ['homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code']); + my $alliteminfos = get_infos_syspref_on_item('MarcItemFieldsToOrder', $marcrecord, ['homebranch', 'holdingbranch', 'itype', 'nonpublic_note', 'public_note', 'loc', 'ccode', 'notforloan', 'uri', 'copyno', 'price', 'replacementprice', 'itemcallnumber', 'quantity', 'budget_code', 'discount', 'sort1', 'sort2']); if ($alliteminfos != -1) { foreach my $iteminfos (@$alliteminfos) { my $item_homebranch = $iteminfos->{homebranch}; @@ -532,6 +532,9 @@ sub import_biblios_list { my $item_copyno = $iteminfos->{copyno}; my $item_quantity = $iteminfos->{quantity} || 1; my $item_budget_code = $iteminfos->{budget_code}; + my $item_discount = $iteminfos->{discount}; + my $item_sort1 = $iteminfos->{sort1}; + my $item_sort2 = $iteminfos->{sort2}; my $item_budget_id; if ( $iteminfos->{budget_code} ) { my $item_budget = GetBudgetByCode( $iteminfos->{budget_code} ); @@ -560,6 +563,9 @@ sub import_biblios_list { 'copyno' => $item_copyno, 'quantity' => $item_quantity, 'budget_id' => $item_budget_id || $budget_id, + 'discount' => $item_discount || $discount, + 'sort1' => $item_sort1 || $sort1, + 'sort2' => $item_sort2 || $sort2, 'itemprice' => $item_price || $price, 'replacementprice' => $item_replacement_price || $replacementprice, 'itemcallnumber' => $item_callnumber, -- 2.30.2