[open-ils-commits] r13296 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jun 2 22:18:31 EDT 2009


Author: miker
Date: 2009-06-02 22:18:29 -0400 (Tue, 02 Jun 2009)
New Revision: 13296

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
be a little more strict on grace period; add support for restricting to short fine_interval circs during the day, and a "do them all" run at night for longer intervals

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-06-03 01:10:39 UTC (rev 13295)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm	2009-06-03 02:18:29 UTC (rev 13296)
@@ -93,10 +93,11 @@
 
 sub overdue_circs {
 	my $grace = shift;
+    my $upper_interval = shift || '1 millennium';
 
 	my $c_t = action::circulation->table;
 
-	if ($grace) {
+	if ($grace && $grace =~ /^\d+$/o) {
     	$grace = " - ($grace * (fine_interval))";
     } else {
         $grace = '';
@@ -107,10 +108,11 @@
 		  FROM	$c_t
 		  WHERE	stop_fines IS NULL
 		  	AND due_date < ( CURRENT_TIMESTAMP $grace)
+            AND fine_interval < ?::INTERVAL
 	SQL
 
 	my $sth = action::circulation->db_Main->prepare_cached($sql);
-	$sth->execute;
+	$sth->execute($upper_interval);
 
 	return ( map { action::circulation->construct($_) } $sth->fetchall_hash );
 



More information about the open-ils-commits mailing list