[open-ils-commits] r9931 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jun 25 20:55:59 EDT 2008


Author: miker
Date: 2008-06-25 20:55:58 -0400 (Wed, 25 Jun 2008)
New Revision: 9931

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Log:
proper support for counting short-duration overdue circs

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2008-06-25 18:25:42 UTC (rev 9930)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm	2008-06-26 00:55:58 UTC (rev 9931)
@@ -56,6 +56,12 @@
 			SELECT	id
 			  FROM	action.circulation
 			  WHERE	usr = ? AND checkin_time IS NULL AND due_date >= 'today' AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
+			  WHERE	usr = ?
+                    AND checkin_time IS NULL
+                    AND (  (fine_interval >= '1 day' AND due_date >= 'today')
+                        OR (fine_interval < '1 day'  AND due_date > 'now'   ))
+                    AND (stop_fines IS NULL
+                        OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
 	SQL
 
 	my $out = actor::user->db_Main->selectcol_arrayref($out_sql, {}, $usr);
@@ -63,7 +69,12 @@
 	my $od_sql = <<"	SQL";
 			SELECT	id
 			  FROM	action.circulation
-			  WHERE	usr = ? AND checkin_time IS NULL AND due_date < 'today' AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
+			  WHERE	usr = ?
+                    AND checkin_time IS NULL
+                    AND (  (fine_interval >= '1 day' AND due_date < 'today')
+                        OR (fine_interval < '1 day'  AND due_date < 'now'  ))
+                    AND (stop_fines IS NULL
+                        OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
 	SQL
 
 	my $od = actor::user->db_Main->selectcol_arrayref($od_sql, {}, $usr);



More information about the open-ils-commits mailing list