From 2c8001522290a5170a2d1be31bdedecd4a0fe7da 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 b8b36e8df8..5002d44842 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Ecard.pm @@ -375,6 +375,24 @@ sub load_ecard_submit { $ctx->{response}->{barcode} = $ctx->{user}->card->barcode; $ctx->{response}->{expiration_date} = substr($ctx->{user}->expire_date, 0, 10); + if ($update_type eq 'renew') { + #Mark whether this is a temporary renewal or not + 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; + } + } + return $self->compile_response; } -- 2.11.0