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 <jstephenson@mvlc.org>
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 ) ;
}
}