From f1a42bbe798abab808171a36fd8f522a1e431936 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 12 Feb 2020 16:22:02 +0100 Subject: [PATCH] Bug 24469: Record biblionumber in import_biblio when adding to basket via file The column import_biblios.matched_biblionumber was not populated when an order is created from a staged file. Test plan: A/ Create a new order from a stage file. Use the "Save" button at the bottom of the "Add orders from" page Then note the matched_biblionumber value. It should be populated correctly B/ Import again the same record, this time you will have to use the "Add order" link in the list of order (ie. not the "Save" button) Note the matched_biblionumber value. It should be populated correctly Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Sarah Daviau Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart (cherry picked from commit 7bc460e00501a5161a5ac1700dc8d1ce7b76730c) Signed-off-by: Fridolin Somers (cherry picked from commit 3f636fdbb9a057cea616aff9ef1cf004c621c3c7) Signed-off-by: Andrew Fuerste-Henry --- acqui/addorderiso2709.pl | 6 ++++++ acqui/neworderempty.pl | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 8e3d117d5d..83c6eaa5bc 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -198,6 +198,12 @@ if ($op eq ""){ SetImportRecordStatus( $biblio->{'import_record_id'}, 'imported' ); } + my $dbh = C4::Context->dbh; + $dbh->do( + q|UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?|, + undef, $biblionumber, $biblio->{import_record_id} + ); + # Add items from MarcItemFieldsToOrder my @homebranches = $input->multi_param('homebranch_' . $biblio_count); my $count = scalar @homebranches; diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 6aa84b0a38..efbc188f90 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -179,6 +179,12 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ # get the price if there is one. $listprice = GetMarcPrice($marcrecord, $marcflavour); SetImportRecordStatus($params->{'breedingid'}, 'imported'); + + my $dbh = C4::Context->dbh; + $dbh->do( + q|UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?|, + undef, $biblionumber, $params->{breedingid} + ); } -- 2.39.5