From: Chris Sharp Date: Tue, 7 Nov 2017 21:49:37 +0000 (-0500) Subject: LP#1269574 - Exclude backordered copies from deletion. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fcsharp%2Flp1269574_acq_cancel_delete_copies;p=working%2FEvergreen.git LP#1269574 - Exclude backordered copies from deletion. When canceling a lineitem with a cancel reason that keep debits = true, make sure we don't delete those copies. Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm index 3eae8602e3..86d3593f05 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -3155,7 +3155,10 @@ sub cancel_lineitem { or return 0; # gathering any real copies for deletion - if ($lid->eg_copy_id) { + # if there is a copy ID and the cancel reason keeps debits, + # do not delete. csharp + # if ($U->is_true($bib->deleted)) { + if ($lid->eg_copy_id && ! $U->is_true($cancel_reason->keep_debits)) { $lid->eg_copy_id->isdeleted('t'); push @$copies, $lid->eg_copy_id; }