LP1928003 Protect real copies from auto-deletion by cancelling acq line items
authorTiffany Little <tlittle@georgialibraries.org>
Fri, 18 Jun 2021 18:33:50 +0000 (14:33 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 24 Mar 2022 17:25:54 +0000 (13:25 -0400)
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm

index 104cf71..377a9b4 100644 (file)
@@ -3176,7 +3176,7 @@ sub cancel_lineitem {
         # gathering any real copies for deletion
         # if there is a copy ID and the cancel reason keeps debits,
         # do not delete. 
-        if ($lid->eg_copy_id && ! $U->is_true($cancel_reason->keep_debits)) {
+        if ($lid->eg_copy_id && ! $U->is_true($cancel_reason->keep_debits) && $lid->eg_copy_id->status == OILS_COPY_STATUS_ON_ORDER) {
             $lid->eg_copy_id->isdeleted('t');
             push @$copies, $lid->eg_copy_id;
         }