From a4210ae0e819b34d96efa00721081506c83aa632 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 18 Aug 2006 21:25:09 +0000 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/OpenILS/Application/Cat.pm | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } -- 2.11.0