From 4b50a4fad764ce7ab597a7ab4587a5c48db30384 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Wed, 3 Apr 2013 01:16:24 +0200 Subject: [PATCH] Bug 7593 : Follow-up : store the biblioitemnumber of kept record into the order With this followup, the biblioitemnumber of $tobiblio is stored into the orderline. To test : 1. create 2 records A and B 2. use record A in an order. 3. merge A and B (keep B) 4. check your basket : record B sould be used in order 5. check your database (using a report or in mysql) : SELECT biblioitemnumber FROM aqorders WHERE biblionumber= [Biblionumber of record B] => the result of the request should be the biblioitemnumber of record B (usually the same value as its biblionumber) --- cataloguing/merge.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index 18de702..5a0f5c5 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -104,9 +104,11 @@ if ($merge) { # Moving orders my @allorders = GetOrdersByBiblionumber($frombiblio); + my @tobiblioitem = GetBiblioItemByBiblioNumber ($tobiblio); + my $tobiblioitem_biblioitemnumber = $tobiblioitem [0]-> {biblioitemnumber }; foreach my $myorder (@allorders) { $myorder->{'biblionumber'} = $tobiblio; - $myorder->{'biblioitemnumber'} = $tobiblio; #maybe useless + $myorder->{'biblioitemnumber'} = $tobiblioitem_biblioitemnumber; ModOrder ($myorder); # TODO : add error control (in ModOrder?) } -- 1.7.9.5