added more penalty checks
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 13:40:50 +0000 (13:40 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 25 Aug 2006 13:40:50 +0000 (13:40 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5669 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm

index b6ed045..c3c955f 100644 (file)
@@ -204,7 +204,23 @@ sub fee_amount {
 }
 
 sub screen_msg {
-    my $self = shift;
+       my $self = shift;
+       my $u = $self->{user};
+       return 'barred' if $u->barred eq 't';
+
+       my $b = 'blocked';
+       return $b if $u->card->active eq 'f';
+
+       if( $u->standing_penalties ) {
+               return $b if 
+                       grep { $_->penalty_type eq 'PATRON_EXCEEDS_OVERDUE_COUNT' } 
+                               @{$u->standing_penalties};
+
+               return $b if 
+                       grep { $_->penalty_type eq 'PATRON_EXCEEDS_FINES' } 
+                               @{$u->standing_penalties};
+       }
+
        return '';
 }