From: erickson Date: Wed, 20 Sep 2006 14:22:23 +0000 (+0000) Subject: allowing hold permit on expired patron accounts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4064e42634f2fea08e76f2b7582beab2c914b79d;p=evergreen%2Fpines.git allowing hold permit on expired patron accounts git-svn-id: svn://svn.open-ils.org/ILS/trunk@6156 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm b/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm index e8dd91fee0..4446c908b3 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm @@ -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