LP 1169193 Support L/O xact close on paid
authorBill Erickson <berick@esilibrary.com>
Mon, 6 May 2013 15:01:52 +0000 (11:01 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 9 Aug 2013 19:58:19 +0000 (15:58 -0400)
Middle-layer support for the org unit setting "Leave transaction
open when long overdue balance equals zero".  It behaves the same
as "Leave transaction open when lost balance equals zero", but for
long-overdue circs.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm

index 03dc4d5..2901ec5 100644 (file)
@@ -235,7 +235,22 @@ sub can_close_circ {
                 )
             );
         }
                 )
             );
         }
+
+    } elsif ($reason eq OILS_STOP_FINES_LONGOVERDUE) {
+        # Check the copy circ_lib to see if they close
+        # transactions when long-overdue are paid.
+        my $copy = $e->retrieve_asset_copy($circ->target_copy);
+        if ($copy) {
+            $can_close = !$U->is_true(
+                $U->ou_ancestor_setting_value(
+                    $copy->circ_lib,
+                    'circ.longoverdue.xact_open_on_zero',
+                    $e
+                )
+            );
+        }
     }
     }
+
     return $can_close;
 }
 
     return $can_close;
 }