From 6b39b42f25f358eb8d7e23af4b56afb3f029ec24 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 13 May 2019 10:43:51 -0400 Subject: [PATCH] LP1731021 SIP fine detail fee type additions Adds support for specifying different fee types in the fine/fee response based on the most recent billing type of each transaction. Thanks to Jason Stephenson for the initial implementation. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../src/perlmods/lib/OpenILS/SIP/Patron.pm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm index c9b59022b6..9de94b82e3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm @@ -879,6 +879,16 @@ sub fine_items { my $author; my $line; + my $fee_type; + + if ($xact->last_billing_type =~ /^Lost/) { + $fee_type = 'LOST'; + } elsif ($xact->last_billing_type =~ /^Overdue/) { + $fee_type = 'FINE'; + } else { + $fee_type = 'FEE'; + } + if ($xact->xact_type eq 'circulation') { my $e = OpenILS::SIP->editor(); my $circ = $e->retrieve_action_circulation([ @@ -919,18 +929,17 @@ sub fine_items { $line = $xact->balance_owed . " " . $xact->last_billing_type . " "; if ($xact->xact_type eq 'circulation') { - $line .= "$title/$author"; + $line .= "$title / $author"; } else { $line .= $xact->last_billing_note; } } elsif ($AV_format eq "3m" or $AV_format eq "swyer_a") { - $line = $xact->id . ' $' . $xact->balance_owed . - ' "FINE" ' . $xact->last_billing_type . ' '; + $line = $xact->id . ' $' . $xact->balance_owed . " \"$fee_type\" "; if ($xact->xact_type eq 'circulation') { - $line .= "$title/$author"; + $line .= "$title"; } else { $line .= $xact->last_billing_note; } @@ -939,7 +948,7 @@ sub fine_items { $line = "Charge-Number: " . $xact->id; $line .= ", Amount-Due: " . $xact->balance_owed; - $line .= ", Fine-Type: FINE"; + $line .= ", Fine-Type: $fee_type"; if ($xact->xact_type eq 'circulation') { $line .= ", Title: $title"; -- 2.43.2