returning circ on transiting LOST
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 22:07:06 +0000 (22:07 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Jul 2005 22:07:06 +0000 (22:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1562 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Rules.pm

index 94ddf28..5931f3e 100644 (file)
@@ -763,20 +763,26 @@ sub transit_receive {
                                my $s = $session->request(
                                        "open-ils.storage.direct.asset.copy.update", $copy )->gather(1);
                                if(!$s) {throw OpenSRF::EX::ERROR ("Error updating copy ".$copy->id);} # blah..
-                               $apputils->commit_db_session($session);
 
                                my($status, $status_text) = (0, "Transit Complete");
 
+                               my $circ;
                                if($transit->copy_status eq "3") { #if copy is lost
                                        $status = 2;
                                        $status_text = "Copy is marked as LOST";
+                                       $circ = $session->request(
+                                               "open-ils.storage.direct.action.circulation.search_where",
+                                               { target_copy => $copy->id, xact_finish => undef } )->gather(1);
                                }
 
+                               $apputils->commit_db_session($session);
+
                                return { 
                                        status => $status, 
                                        route_to => $user->home_ou, 
                                        text => $status_text, 
                                        record => $record, 
+                                       circ    => $circ,
                                        copy => $copy  };
 
                        } else {