treat archived penalties as non-existent (unless explicitly retireved via pcrud)
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Jun 2009 13:49:11 +0000 (13:49 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Jun 2009 13:49:11 +0000 (13:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13338 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm

index a5e2f41..b8201b1 100644 (file)
@@ -2682,6 +2682,10 @@ sub apply_penalty {
     # is it already applied?
     return 1 if $e->search_actor_user_standing_penalty(
         {   usr => $penalty->usr, 
+            '-or' => [
+                {stop_date => undef},
+                {stop_date => {'>' => 'now'}}
+            ],
             standing_penalty => $penalty->standing_penalty,
             org_unit => $penalty->org_unit
         })->[0];
@@ -2823,6 +2827,10 @@ sub new_flesh_user {
         $user->standing_penalties(
             $e->search_actor_user_standing_penalty([
                 {   usr => $id, 
+                    '-or' => [
+                        {stop_date => undef},
+                        {stop_date => {'>' => 'now'}}
+                    ],
                     org_unit => $U->get_org_ancestors($e->requestor->ws_ou)
                 },
                 {   flesh => 1,