Open tslittle opened 4 years ago
Bug that might have some ideas: https://bugs.launchpad.net/evergreen/+bug/1761615
See Order.pm at line 3175 forhow copies are deleted when lineitems are cancelled.
# 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)) {
$lid->eg_copy_id->isdeleted('t');
push @$copies, $lid->eg_copy_id;
Note for later: there's way more than below that line, since it also needs to delete acn's and possibly the bib.
The sub for deleting lineitems is in Lineitem.pm starting at 273.
May want to look at the code in the branch linked here, since it mentions that it should prompt before deleting copies: https://bugs.launchpad.net/evergreen/+bug/1175740
https://bugs.launchpad.net/evergreen/+bug/1808173