LP 1169193 Support L/O xact close on paid user/berick/lp1169193-long-overdue
authorBill Erickson <berick@esilibrary.com>
Mon, 6 May 2013 15:01:52 +0000 (11:01 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 9 Jul 2013 13:16:55 +0000 (09:16 -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>
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;
 }