From: Jason Etheridge Date: Tue, 31 May 2022 09:23:26 +0000 (-0400) Subject: LP1901930 tweak checkout/renewal response messages X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4b5dd9d3e5ecf0025a53e2a024b0dd918834b0d4;p=working%2FEvergreen.git LP1901930 tweak checkout/renewal response messages Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm index 2509ec460a..a5a8ba095e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm @@ -577,15 +577,18 @@ sub checkout_renew_common { && $circ->renewal_remaining > 0; } + my $already_out_to_patron = $item_details->{circ} + ? $item_details->{circ}->usr->id == $patron_details->{patron}->id + : 0; + return { code => $code, fixed_fields => [ $circ ? 1 : 0, # checkout ok # Per SIP spec, "renewal ok" is a bit dumber than $can_renew, and returns Y if the item was already circulating to the patron, N otherwise) - # FIXME: Hardcoded for now, but need to revisit - $SC->sipbool(0), # renewal ok + $SC->sipbool($already_out_to_patron), # renewal ok $SC->sipbool($magnetic), # magnetic media - $SC->sipbool(!$magnetic), # desensitize + $is_renewal ? $SC->sipbool(0) : $SC->sipbool(!$magnetic), # desensitize $SC->sipdate, # transaction date ], fields => [ @@ -597,7 +600,7 @@ sub checkout_renew_common { {CI => 'N'}, # security inhibit {CK => $item_details->{media_type}}, $screen_msg ? {AF => $screen_msg} : (), - $due_date ? {AH => $due_date} : (), + $due_date ? {AH => $due_date} : {AH => ''}, # a required field in the SIP spec, even for failures :-/ $circ ? {BK => $circ->id} : (), $deposit ? {BV => $deposit} : (), ]