From 7095b707ffc94f2fc821e669d675be43e6e867ba Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 29 Nov 2023 11:11:37 +0000 Subject: [PATCH] Bug 33171: Fix missing price when mapped from MarcItemFieldsToOrder This patch fixes an issue where the price is not passed to the UI when read from MarcItemFieldsToOrder. Test plan: 1) In Administration, copy and paste the following into MarcItemFieldsToOrder: quantity: 975$q budget_code: 975$h price: 975$p itype: 975$y coded_location_qualifier: 975$a barcode: 975$b enumchron: 975$c 2) Save 3) Navigate to Acquisitions and find a basket 4) Click Add to basket and select From a new file 5) Choose the file attached to this bug 6) Upload file and click Stage for import 7) Click Add staged files to basket once the job is finished 8) Check the box next to the record 9) The price should show 10.00 under Item record 1 10) coded location qualifier, barcode, enumchron should also have values as per the other commit on this bug 11) Save and import, the basket should not have a value of 0 as the price has been read correctly 12) Check the database, the newest item should have values for price, coded_location_qualifier, barcode and enumchron Signed-off-by: Matt Blenkinsop Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- acqui/addorderiso2709.pl | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index ce53488a7d..86b79fa54c 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -212,25 +212,26 @@ if ($op eq ""){ $import_record->import_biblio->matched_biblionumber($biblionumber)->store; # Add items from MarcItemFieldsToOrder - my @homebranches = $input->multi_param('homebranch_' . $import_record->import_record_id); - my $count = scalar @homebranches; - my @holdingbranches = $input->multi_param('holdingbranch_' . $import_record->import_record_id); - my @itypes = $input->multi_param('itype_' . $import_record->import_record_id); - my @nonpublic_notes = $input->multi_param('nonpublic_note_' . $import_record->import_record_id); - my @public_notes = $input->multi_param('public_note_' . $import_record->import_record_id); - my @locs = $input->multi_param('loc_' . $import_record->import_record_id); - my @ccodes = $input->multi_param('ccode_' . $import_record->import_record_id); - my @notforloans = $input->multi_param('notforloan_' . $import_record->import_record_id); - my @uris = $input->multi_param('uri_' . $import_record->import_record_id); - my @copynos = $input->multi_param('copyno_' . $import_record->import_record_id); + my @homebranches = $input->multi_param( 'homebranch_' . $import_record->import_record_id ); + my $count = scalar @homebranches; + my @holdingbranches = $input->multi_param( 'holdingbranch_' . $import_record->import_record_id ); + my @itypes = $input->multi_param( 'itype_' . $import_record->import_record_id ); + my @nonpublic_notes = $input->multi_param( 'nonpublic_note_' . $import_record->import_record_id ); + my @public_notes = $input->multi_param( 'public_note_' . $import_record->import_record_id ); + my @locs = $input->multi_param( 'loc_' . $import_record->import_record_id ); + my @ccodes = $input->multi_param( 'ccode_' . $import_record->import_record_id ); + my @notforloans = $input->multi_param( 'notforloan_' . $import_record->import_record_id ); + my @uris = $input->multi_param( 'uri_' . $import_record->import_record_id ); + my @copynos = $input->multi_param( 'copyno_' . $import_record->import_record_id ); my @budget_ids = $input->multi_param( 'budget_code_' . $import_record->import_record_id ); # bad field name used in template! - my @itemprices = $input->multi_param('itemprice_' . $import_record->import_record_id); - my @replacementprices = $input->multi_param('replacementprice_' . $import_record->import_record_id); - my @itemcallnumbers = $input->multi_param('itemcallnumber_' . $import_record->import_record_id); - my @coded_location_qualifiers = $input->multi_param('coded_location_qualifier_' . $import_record->import_record_id); - my @barcodes = $input->multi_param('barcode_' . $import_record->import_record_id); - my @enumchrons = $input->multi_param('enumchron_' . $import_record->import_record_id); + my @itemprices = $input->multi_param( 'itemprice_' . $import_record->import_record_id ); + my @replacementprices = $input->multi_param( 'replacementprice_' . $import_record->import_record_id ); + my @itemcallnumbers = $input->multi_param( 'itemcallnumber_' . $import_record->import_record_id ); + my @coded_location_qualifiers = + $input->multi_param( 'coded_location_qualifier_' . $import_record->import_record_id ); + my @barcodes = $input->multi_param( 'barcode_' . $import_record->import_record_id ); + my @enumchrons = $input->multi_param( 'enumchron_' . $import_record->import_record_id ); my $itemcreation = 0; my @itemnumbers; @@ -534,6 +535,8 @@ sub import_biblios_list { # Handle incorrectly named original parameters for MarcItemFieldsToOrder $iteminfos->{location} = delete $iteminfos->{loc} if $iteminfos->{loc}; $iteminfos->{copynumber} = delete $iteminfos->{copyno} if $iteminfos->{copyno}; + # Price is handled as "itemprice" in the UI form to distinguish from MarcFieldsToOrder + $iteminfos->{itemprice} = delete $iteminfos->{price} if $iteminfos->{price}; # Convert budge code to a budget id my $item_budget_code = delete $iteminfos->{budget_code}; -- 2.39.5