my $expire = DateTime::Format::ISO8601->new->parse_datetime(
clean_ISO8601($patron->expire_date));
-
- $self->bail_on_events(OpenILS::Event->new('PATRON_ACCOUNT_EXPIRED'))
- if( CORE::time > $expire->epoch ) ;
+
+ # An expired patron can renew with the assistance of an OUS.
+ my $expire_setting = $U->ou_ancestor_setting_value($self->circ_lib, OILS_SETTING_ALLOW_RENEW_FOR_EXPIRED_PATRON);
+ unless ($self->is_renewal and $expire_setting) {
+ if(CORE::time > $expire->epoch) {
+ $self->bail_on_events(OpenILS::Event->new('PATRON_ACCOUNT_EXPIRED'))
+ }
+ }
}
}
econst OILS_SETTING_RESTORE_OVERDUE_ON_LOST_RETURN => 'circ.restore_overdue_on_lost_return';
econst OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE => 'circ.lost_immediately_available';
econst OILS_SETTING_BLOCK_HOLD_FOR_EXPIRED_PATRON => 'circ.holds.expired_patron_block';
+econst OILS_SETTING_ALLOW_RENEW_FOR_EXPIRED_PATRON => 'circ.renew.expired_patron_allow';
econst OILS_SETTING_GENERATE_OVERDUE_ON_LOST_RETURN => 'circ.lost.generate_overdue_on_checkin';
econst OILS_SETTING_MAX_DUPLICATE_HOLDS => 'circ.holds.max_duplicate_holds';
'coust', 'description'),
'bool', null)
+,( 'circ.renew.expired_patron_allow', 'circ',
+ oils_i18n_gettext('circ.renew.expired_patron_allow',
+ 'Allow renewal request if renewal recipient privileges have expired',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.renew.expired_patron_allow',
+ 'If enabled, users within the org unit who are expired may still renew items.',
+ 'coust', 'description'),
+ 'bool', null)
+
,( 'circ.holds.hold_has_copy_at.alert', 'holds',
oils_i18n_gettext('circ.holds.hold_has_copy_at.alert',
'Has Local Copy Alert',
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+ (grp, name, datatype, label, description)
+VALUES (
+ 'circ',
+ 'circ.renew.expired_patron_allow', 'bool',
+ oils_i18n_gettext(
+ 'circ.renew.expired_patron_allow',
+ 'Allow renewal request if renewal recipient privileges have expired',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ 'circ.renew.expired_patron_allow',
+ 'If enabled, users within the org unit who are expired may still renew items.',
+ 'coust',
+ 'description'
+ )
+);
+
+COMMIT;