From 2b08cb073221fe9c5c04099f50410888c4906f39 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 7 Sep 2013 13:05:39 -0400 Subject: [PATCH] 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 --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ) ; } } -- 2.11.0