From 6769c01217e0c8b8a91ba7d3cc8ce6769919bf39 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Tue, 19 Jun 2012 15:31:08 -0400 Subject: [PATCH] Add SIP support for Fine Items field Add support for SIP Fine Items, msg 64 field AV. Display outstanding balance, last_billing_type, and a description. For circulation xacts, description is title / author from MODS. For grocery xacts, description is last_billing_note. Wishlist LP 1012328 Signed-off-by: Jeff Godin Signed-off-by: Jason Stephenson Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index d4463181ac..460e78d9ce 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -627,7 +627,21 @@ sub charged_items { sub fine_items { my ($self, $start, $end) = @_; my @fines; - syslog('LOG_DEBUG', 'OILS: Patron->fine_items()'); + 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}) { + my $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; + } else { + $line .= $xact->last_billing_note; + } + push @fines, OpenILS::SIP::clean_text($line); + } + }; + my $log_status = $@ ? 'ERROR: ' . $@ : 'OK'; + syslog('LOG_DEBUG', 'OILS: Patron->fine_items() ' . $log_status); return (defined $start and defined $end) ? [ $fines[($start-1)..($end-1)] ] : \@fines; } -- 2.11.0