From: Jason Stephenson Date: Sat, 7 Sep 2013 17:05:39 +0000 (-0400) Subject: Minor modification to allow "backdated" checkouts to expired patrons. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2b08cb073221fe9c5c04099f50410888c4906f39;p=working%2FEvergreen.git Minor modification to allow "backdated" checkouts to expired patrons. We add a $checkout_time variable to mk_env in Circulate.pm. Then, we check if the args include a checkout_time parameter. If so we use that when checking if the patron's account has expired. If not we use CORE::time to check for expiration. Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index fd90e27bd2..757e35354c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -813,9 +813,12 @@ sub mk_env { my $expire = DateTime::Format::ISO8601->new->parse_datetime( cleanse_ISO8601($patron->expire_date)); + + my $checkout_time = ($self->checkout_time) ? DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($self->checkout_time)) + : DateTime->from_epoch(epoch => CORE::time); $self->bail_on_events(OpenILS::Event->new('PATRON_ACCOUNT_EXPIRED')) - if( CORE::time > $expire->epoch ) ; + if( $checkout_time->epoch > $expire->epoch ) ; } }