Bug 19120: Leave cancelled ordered items alone when reopening basket
authorMark Tompsett <mtompset@hotmail.com>
Sat, 2 Sep 2017 01:23:20 +0000 (21:23 -0400)
committerKatrin Fischer <katrin.fischer.83@web.de>
Wed, 18 Oct 2017 21:15:46 +0000 (23:15 +0200)
TEST PLAN
---------
1) Apply first patch
2) prove t/db_dependent/Acquisition/close_reopen_basket.t
   -- FAILS
3) Apply this patch
4) prove t/db_dependent/Acquisition/close_reopen_basket.t
   -- SUCCESS!
5) run koha qa test tools

Followed test plan, patch worked as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 632e2ad51d2510a412224ded5e51a9f991d566b4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 47223f0cad47913c15f4c9dacfbc0ed4682a8e2d)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

C4/Acquisition.pm

index e9d434b..2ba5a63 100644 (file)
@@ -260,7 +260,7 @@ sub ReopenBasket {
         UPDATE aqorders
         SET orderstatus = 'new'
         WHERE basketno = ?
-        AND orderstatus != 'complete'
+        AND orderstatus NOT IN ( 'complete', 'cancelled' )
         }, {}, $basketno);
     return;
 }