my $ctx = $self->ctx;
my $user = $self->ctx->{user};
my $e = new_editor(xact => 1);
+
+ #I'm sure there is a way to combine the following standing penalty checks, but this is working for now
#check for INVALID_PATRON_ADDRESS
my $findpenalty_address = $e->search_config_standing_penalty({name => 'INVALID_PATRON_ADDRESS'})->[0];
$self->update_dashboard_stats();
#make sure patron is in an eligible perm group for renewal
- #On gapines.org production: 2 = Patron, 14 = Friend, 56 = GLS, 53 = Homebound, 22 = Trustee, 64 = Quipu, 60 = Digital Only
- if ($ctx->{user}->profile eq '2' || $ctx->{user}->profile eq '14' || $ctx->{user}->profile eq '56' || $ctx->{user}->profile eq '53' || $ctx->{user}->profile eq '22' || $ctx->{user}->profile eq '64' || $ctx->{user}->profile eq '60') {
+ my $grp = new_editor()->retrieve_permission_grp_tree($ctx->{user}->profile);
+
+ if ($grp->erenew eq 't') {
$ctx->{eligible_permgroup} = 1;
} else {
$ctx->{eligible_permgroup} = 0;
}
# Temp renewal is only 30 days, otherwise use perm_interval
- # If perm group is Homebound (53) or GLS (56), allow full renewal
+ # If perm group is Homebound or GLS, allow full renewal
my $temp_renewal = $cgi->param('temp_renewal');
- my $perm_grp = $au->profile;
+ my $grp = new_editor()->retrieve_permission_grp_tree($au->profile);
- if ($temp_renewal eq '1' && $perm_grp ne '53' && $perm_grp ne '56') {
+ if ($temp_renewal eq '1' && $grp->name ne 'GLS' && $grp->name ne 'Homebound') {
$au->expire_date(
DateTime->now(time_zone => 'local')->add(
seconds => interval_to_seconds('30 days'))->iso8601()
);
- # Add standing penalty to account
+ # Add temp renewal standing penalty to account
$self->apply_temp_renewal_penalty;
} else {
- my $grp = new_editor()->retrieve_permission_grp_tree($perm_grp);
$au->expire_date(
DateTime->now(time_zone => 'local')->add(
seconds => interval_to_seconds($grp->perm_interval))->iso8601()