From d2c729847a865275ea148289f92d1433f04c66ac Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 27 Oct 2016 17:31:36 -0400 Subject: [PATCH] improve lost+paid handling Signed-off-by: Galen Charlton --- .../lib/OpenILS/Application/Circ/Circulate.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 37c9c25f37..9752bc1ca4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -43,13 +43,13 @@ my $MK_ENV_FLESH = { # table of cases where suppressing a system-generated copy alerts # should generate an override of an old-style event my %COPY_ALERT_OVERRIDES = ( - "CLAIMSRETURNED\tCHECKOUT" => 'CIRC_CLAIMS_RETURNED', - "CLAIMSRETURNED\tCHECKIN" => 'CIRC_CLAIMS_RETURNED', - "LOST\tCHECKOUT" => 'OPEN_CIRCULATION_EXISTS', - "LONGOVERDUE\tCHECKOUT" => 'OPEN_CIRCULATION_EXISTS', - "MISSING\tCHECKOUT" => 'COPY_STATUS_MISSING', - "DAMAGED\tCHECKOUT" => 'COPY_NOT_AVAILABLE', - "LOST_AND_PAID\tCHECKOUT" => 'COPY_NOT_AVAILABLE', + "CLAIMSRETURNED\tCHECKOUT" => ['CIRC_CLAIMS_RETURNED'], + "CLAIMSRETURNED\tCHECKIN" => ['CIRC_CLAIMS_RETURNED'], + "LOST\tCHECKOUT" => ['OPEN_CIRCULATION_EXISTS'], + "LONGOVERDUE\tCHECKOUT" => ['OPEN_CIRCULATION_EXISTS'], + "MISSING\tCHECKOUT" => ['COPY_STATUS_MISSING'], + "DAMAGED\tCHECKOUT" => ['COPY_NOT_AVAILABLE'], + "LOST_AND_PAID\tCHECKOUT" => ['COPY_NOT_AVAILABLE', 'OPEN_CIRCULATION_EXISTS'] ); sub initialize {} @@ -842,12 +842,12 @@ sub add_overrides_from_system_copy_alerts { foreach my $condition (keys %{$self->overrides_per_copy_alerts()}) { if (exists $COPY_ALERT_OVERRIDES{$condition}) { $self->override(1); - push @{$self->override_args->{events}}, $COPY_ALERT_OVERRIDES{$condition}; + push @{$self->override_args->{events}}, @{ $COPY_ALERT_OVERRIDES{$condition} }; # special handling for long-overdue and lost checkouts - if ($COPY_ALERT_OVERRIDES{$condition} eq 'OPEN_CIRCULATION_EXISTS') { + if (grep { $_ eq 'OPEN_CIRCULATION_EXISTS' } @{ $COPY_ALERT_OVERRIDES{$condition} }) { my $state = (split /\t/, $condition, -1)[0]; my $setting; - if ($state eq 'LOST') { + if ($state eq 'LOST' or $state eq 'LOST_AND_PAID') { $setting = 'circ.copy_alerts.forgive_fines_on_lost_checkin'; } elsif ($state eq 'LONGOVERDUE') { $setting = 'circ.copy_alerts.forgive_fines_on_long_overdue_checkin'; -- 2.11.0