From 0679425b29b9bff8c16fff91b7351a2f9f89a045 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 2 Aug 2017 17:12:44 +0100 Subject: [PATCH] Bug 19024 Do not unset order cancelled status on basket close On closing a basket, status is updated to ordered for orders not completed. However the operation was resetting the status for cancelled as well as new orders. While display is correct from the basket view (it checks the cancellation date). The status in the acquisitions tab from the catalogue view reverts erroneously to ordered. This patch adds cancelled to the statuses not updated on basket close. Signed-off-by: Mark Tompsett Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart (cherry picked from commit 2e9165001f69312255ad1b6706f040784460d5d1) Signed-off-by: Fridolin Somers --- C4/Acquisition.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index ecd382ca2a..d4612184d2 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -237,8 +237,10 @@ sub CloseBasket { my $dbh = C4::Context->dbh; $dbh->do('UPDATE aqbasket SET closedate=now() WHERE basketno=?', {}, $basketno ); - $dbh->do( q{UPDATE aqorders SET orderstatus = 'ordered' WHERE basketno = ? AND orderstatus != 'complete'}, - {}, $basketno); + $dbh->do( +q{UPDATE aqorders SET orderstatus = 'ordered' WHERE basketno = ? AND orderstatus NOT IN ( 'complete', 'cancelled')}, + {}, $basketno + ); return; } -- 2.39.5