LP#1306666 - Only set "Canceled Transit" status on "In Transit" copies
authorChris Sharp <csharp@georgialibraries.org>
Mon, 15 Aug 2016 22:06:18 +0000 (18:06 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 15 Aug 2016 22:54:03 +0000 (18:54 -0400)
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Transit.pm

index f5bee54..8fe22c8 100644 (file)
@@ -239,10 +239,12 @@ sub __abort_transit {
         return $e->die_event unless $e->allowed('ABORT_REMOTE_TRANSIT', $e->requestor->ws_ou);
     }
 
-    # set the copy status to "Canceled Transit"
-    $copy->status( OILS_COPY_STATUS_CANCELED_TRANSIT );
-    $copy->editor( $e->requestor->id );
-    $copy->edit_date('now');
+    # if the copy status is "In Transit", set the copy status to "Canceled Transit"
+    if( $copy->status == OILS_COPY_STATUS_IN_TRANSIT ) {
+        $copy->status( OILS_COPY_STATUS_CANCELED_TRANSIT );
+        $copy->editor( $e->requestor->id );
+        $copy->edit_date('now');
+    }
 
     my $holdtransit = $e->retrieve_action_hold_transit_copy($transit->id);