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=868904789b1be09470fc1deca68cc4789248719a;p=evergreen%2Fpines.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 Signed-off-by: John Amundson Signed-off-by: Jason Stephenson --- 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 feacb2f1e1..331baf2dc1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm @@ -3167,7 +3167,9 @@ 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. + if ($lid->eg_copy_id && ! $U->is_true($cancel_reason->keep_debits)) { $lid->eg_copy_id->isdeleted('t'); push @$copies, $lid->eg_copy_id; }