From e3e200544907feb7f92cac16a479949773984156 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Jan 2014 12:06:34 +0100 Subject: [PATCH] Bug 11549: FIX receive and cancel the receipt after a transfer. To reproduce the issue: - transfer an order from a basket to another. Note the previous ordernumber (X) and the new one (Y). - receive the order - cancel the receipt - verify the order has been deleted: select count(*) from aqorders where ordernumber=Y; select * from aqorders_transfers where ordernumber_from = X; The value for ordernumber_to is null. To test this patch: - apply this patch - transfer an order from a basket to another - receive the order - cancel the receipt - verify the order still exist in the basket where the transfer has been done. --- C4/Acquisition.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 99933e4..8e1e9d4 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1818,6 +1818,12 @@ sub TransferOrder { my $newordernumber; (undef, $newordernumber) = NewOrder($order); + $dbh->do( q{ + UPDATE aqorders + SET parent_ordernumber = ordernumber + WHERE ordernumber = ? + }, {}, $newordernumber ); + $query = qq{ UPDATE aqorders_items SET ordernumber = ? -- 1.7.10.4