From 64a460231b9bc4b3b0be00730211302a01423232 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Tue, 22 Nov 2022 14:38:29 -0500 Subject: [PATCH] Online Renewal - add temp renewal flag to quipu response Signed-off-by: Terran McCanna --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm index 3d9b2cd9ef..afd9a7e781 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm @@ -219,7 +219,20 @@ sub load_ecard_submit { #New expiration date $ctx->{response}->{expire_date} = $ctx->{user}->expire_date; #Mark whether this is a temporary renewal or not - # TERRAN - TO DO + my $findpenalty_temp = $e->search_config_standing_penalty({name => 'PATRON_TEMP_RENEWAL'})->[0]; + my $searchpenalty_temp = $e->search_actor_user_standing_penalty({ + usr => $cgi->param('patron_id'), + standing_penalty => $findpenalty_temp->id, + '-or' => [ + {stop_date => undef}, + {stop_date => {'>' => 'now'}} + ] + }); + if (@$searchpenalty_temp) { + $ctx->{response}->{temp_renew} = 1; + } else { + $ctx->{response}->{temp_renew} = 0; + } } else { $ctx->{response}->{barcode} = $ctx->{user}->card->barcode; } -- 2.11.0