From 0c6464f1393c77191f674e73619005a36cfc8dea Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 1 Nov 2018 12:49:47 -0400 Subject: [PATCH] Implement Envisionware Fine Item Details Hack for Chicopee. --- Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index 3b458cb784..166febb767 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -846,6 +846,8 @@ sub charged_items_impl { sub fine_items { my ($self, $start, $end, $ids_only) = @_; my @fines; + # Check for Envisionware extension: + my $envisionware_ext = OpenILS::SIP->get_option_value('msg64_fine_items_envisionware') || ''; eval { my $xacts = $U->simplereq('open-ils.actor', 'open-ils.actor.user.transactions.history.have_balance', $self->{authtoken}, $self->{user}->id); foreach my $xact (@{$xacts}) { @@ -853,10 +855,24 @@ sub fine_items { push @fines, $xact; next; } - my $line = $xact->balance_owed . " " . $xact->last_billing_type . " "; + my $line; + if ($envisionware_ext) { + $line = $xact->id . ' $' . $xact->balance_owed . " "; + if ($xact->last_billing_type =~ /^Lost/) { + $line .= '"LOST"'; + } elsif ($xact->last_billing_type =~ /^Overdue/) { + $line .= '"FINE"'; + } else { + $line .= '"FEE"'; + } + $line .= " "; + } else { + $line = $xact->balance_owed . " " . $xact->last_billing_type . " "; + } if ($xact->xact_type eq 'circulation') { my $mods = $U->simplereq('open-ils.circ', 'open-ils.circ.circ_transaction.find_title', $self->{authtoken}, $xact->id); - $line .= $mods->title . ' / ' . $mods->author; + $line .= $mods->title; + $line .= ' / ' . $mods->author unless ($envisionware_ext); } else { $line .= $xact->last_billing_note; } -- 2.11.0