Potential fix for LP bug 667370, reported by Bill Ott. user/dyrcona/lp667370
authorJason Stephenson <jstephenson@mvlc.org>
Tue, 30 Aug 2011 14:16:05 +0000 (10:16 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Tue, 30 Aug 2011 14:16:05 +0000 (10:16 -0400)
Adds an if block around the checking and logging of balance owed
from mbts when renewing. If the mbts is not found the transaction
is closed anyway and the fact that no mbts is found is logged.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 270f7aa..de32c2f 100644 (file)
@@ -3238,9 +3238,13 @@ sub checkin_handle_circ {
 
     # see if there are any fines owed on this circ.  if not, close it
     ($obt) = $U->fetch_mbts($circ->id, $self->editor);
-    $circ->xact_finish('now') if( $obt and $obt->balance_owed == 0 );
-
-    $logger->debug("circulator: ".$obt->balance_owed." is owed on this circulation");
+    if ( $obt ) {
+        $circ->xact_finish('now') if( $obt->balance_owed == 0 );
+        $logger->debug("circulator: ".$obt->balance_owed." is owed on this circulation");
+    } else {
+        $circ->xact_finish('now');
+        $logger->debug("circulator: no mbts on this circulation");
+    }
 
     return $self->bail_on_events($self->editor->event)
         unless $self->editor->update_action_circulation($circ);