From aee918b0f274b0aaf91b76c9e0ba6157372d2402 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Tue, 7 Nov 2017 16:49:37 -0500 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..868365d941 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,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; } -- 2.11.0