allowing hold permit on expired patron accounts
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Sep 2006 14:22:23 +0000 (14:22 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 20 Sep 2006 14:22:23 +0000 (14:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6156 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm

index e8dd91f..4446c90 100644 (file)
@@ -39,8 +39,18 @@ sub permit_copy_hold {
 
        my $runner = OpenILS::Application::Circ::ScriptBuilder->build($ctx);
 
-       if( $ctx->{_events} ) {
-               push( @allevents, $_) for @{$ctx->{_events}};
+       my $ets = $ctx->{_events};
+
+       # --------------------------------------------------------------
+       # Strip the expired event since holds are still allowed to be
+       # captured on expired patrons.  
+       # --------------------------------------------------------------
+       if( $ets and @$ets ) {
+               $ets = [ grep { $_->{textcode} ne 'PATRON_ACCOUNT_EXPIRED' } @$ets ];
+       } else { $ets = []; }
+
+       if( @$ets ) {
+               push( @allevents, @$ets);
 
                # --------------------------------------------------------------
                # If scriptbuilder returned any events, then the script context