From: erickson Date: Fri, 18 Aug 2006 21:25:09 +0000 (+0000) Subject: removing open transits for a copy when it is deleted X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a4210ae0e819b34d96efa00721081506c83aa632;p=Evergreen.git removing open transits for a copy when it is deleted git-svn-id: svn://svn.open-ils.org/ILS/trunk@5595 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm index c1cf7298cc..e73ae334ac 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm @@ -1091,6 +1091,15 @@ sub delete_copy { $copy, {checkperm=>1, permorg=>$vol->owning_lib}) or return $editor->event; + # Delete any open transits for this copy + my $transits = $editor->search_action_transit_copy( + { target_copy=>$copy->id, dest_recv_time => undef } ); + + for my $t (@$transits) { + $editor->delete_action_transit_copy($t) + or return $editor->event; + } + return remove_empty_objects($editor, $override, $vol); }