From 6d63881e0447bae83d21b6f082ee1549277c6071 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 Jan 2014 12:06:34 +0100 Subject: [PATCH] Bug 11549: make it possible to receive and cancel the receipt of a transferred order 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. Signed-off-by: Sonia BOUIS Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- C4/Acquisition.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 99933e4d5a..8e1e9d496a 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 = ? -- 2.39.5