return undef if defined $password &&
!$U->verify_migrated_user_password($e, $patron->id, $password);
- my $penalties = get_patron_penalties($session, $patron);
-
- set_patron_privileges($session, $details, $penalties);
-
- $details->{too_many_overdue} = 1 if
- grep {$_->{id} == OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT}
- @$penalties;
-
- $details->{too_many_fines} = 1 if
- grep {$_->{id} == OILS_PENALTY_PATRON_EXCEEDS_FINES}
- @$penalties;
+ set_patron_privileges($session, $details);
my $summary = $e->retrieve_money_open_user_summary($patron->id);
$details->{balance_owed} = ($summary) ? $summary->balance_owed : 0;
sub set_patron_privileges {
- my ($session, $details, $penalties) = @_;
+ my ($session, $details) = @_;
my $patron = $details->{patron};
my $expire = DateTime::Format::ISO8601->new
# patron_status_permit_all is true.
return if $session->config->{patron_status_permit_all};
+ my $penalties = get_patron_penalties($session, $patron);
+
+ $details->{too_many_overdue} = 1 if
+ grep {$_->{id} == OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT}
+ @$penalties;
+
+ $details->{too_many_fines} = 1 if
+ grep {$_->{id} == OILS_PENALTY_PATRON_EXCEEDS_FINES}
+ @$penalties;
+
my $blocked = (
$patron->barred eq 't'
|| $patron->active eq 'f'
# checkout and holds privilege, since both would be needed for recalls.
$details->{recall_denied} =
($details->{charge_denied} || $details->{holds_denied});
+
}
# Returns an array of penalty hashes with keys "id" and "block_list"
foreach my $xact (@{$xacts}) {
my ($title, $author, $line, $fee_type);
- if ($xact->last_billing_type =~ /^Lost/) {
+ if ($xact->last_billing_type eq 'Lost Materials') {
$fee_type = 'LOST';
} elsif ($xact->last_billing_type =~ /^Overdue/) {
$fee_type = 'FINE';
if ($xact->xact_type eq 'circulation') {
$line .= "$title / $author";
} else {
- $line .= $xact->last_billing_note;
+ $line .= $xact->last_billing_type;
}
} elsif ($AV_format eq "3m" or $AV_format eq "swyer_a") {
if ($xact->xact_type eq 'circulation') {
$line .= "$title";
} else {
- $line .= $xact->last_billing_note;
+ $line .= $xact->last_billing_type;
}
} elsif ($AV_format eq "swyer_b") {
if ($xact->xact_type eq 'circulation') {
$line .= ", Title: $title";
} else {
- $line .= ", Title: " . $xact->last_billing_note;
+ $line .= ", Title: " . $xact->last_billing_type;
}
}