From 2ed897abf4e708736c62205c1ce7df589f7f0320 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 12 Aug 2022 16:19:49 +0000 Subject: [PATCH] Bug 31356: Pass expirationdate through itiva script --- misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index 6a1456987f..c1dbb85dda 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -308,7 +308,8 @@ sub GetWaitingHolds { my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, borrowers.categorycode, borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate, reserves.branchcode AS site, branches.branchname AS site_name, - TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting + TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting, + reserves.expirationdate FROM borrowers JOIN reserves USING (borrowernumber) JOIN items USING (itemnumber) JOIN biblio ON (biblio.biblionumber = items.biblionumber) @@ -321,7 +322,6 @@ sub GetWaitingHolds { AND message_name = 'Hold_Filled' $patron_branchcode_filter "; - my $pickupdelay = C4::Context->preference("ReservesMaxPickUpDelay"); my $sth = $dbh->prepare($query); $sth->execute(); my @results; @@ -338,12 +338,8 @@ sub GetWaitingHolds { my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'}, days_mode => $daysmode ); my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' ); - my $pickup_date = $waiting_date->clone->add( days => $pickupdelay ); - if ( $calendar->is_holiday($pickup_date) ) { - $pickup_date = $calendar->next_open_days( $pickup_date, 1 ); - } - $issue->{'date_due'} = output_pref({dt => $pickup_date, dateformat => 'iso' }); + $issue->{'date_due'} = output_pref({dt => $issue->{expirationdate}, dateformat => 'iso' }); $issue->{'level'} = 1; # only one level for Hold Waiting notifications my $days_to_subtract = 0; -- 2.30.2