@@ -, +, @@ places * C4::Circulation::checkHighHolds * Koha::Hold->set_waiting * misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl --- C4/Circulation.pm | 11 +++++++++-- Koha/Hold.pm | 11 ++++++++++- .../thirdparty/TalkingTech_itiva_outbound.pl | 13 +++++++++++-- 3 files changed, 30 insertions(+), 5 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1238,9 +1238,16 @@ sub checkHighHolds { my $issuedate = dt_from_string(); - my $calendar = Koha::Calendar->new( branchcode => $branchcode ); - my $itype = $item_object->effective_itemtype; + my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value( + { + categorycode => $borrower->{categorycode}, + itemtype => $itype, + branchcode => $branchcode, + } + ); + my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => $useDaysMode_value ); + my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration'); --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -178,12 +178,21 @@ sub set_waiting { my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); - my $calendar = Koha::Calendar->new( branchcode => $self->branchcode ); my $expirationdate = $today->clone; $expirationdate->add(days => $max_pickup_delay); if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) { + my $itemtype = $self->item ? $self->item->effective_itemtype : $self->biblio->itemtype; + my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value( + { + categorycode => $self->borrower->categorycode, + itemtype => $itemtype, + branchcode => $self->branchcode, + } + ); + my $calendar = Koha::Calendar->new( branchcode => $self->branchcode, days_mode => $useDaysMode_value ); + $expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay ); } --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -311,7 +311,7 @@ sub GetWaitingHolds { my $patron_branchcode_filter = $patron_branchcode ? "AND borrowers.branchcode = '$patron_branchcode'" : q{}; - my $query = "SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, + 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 @@ -332,7 +332,16 @@ sub GetWaitingHolds { $sth->execute(); my @results; while ( my $issue = $sth->fetchrow_hashref() ) { - my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'} ); + my $item = Koha::Items->find({ barcode => $issue->{barcode} }); + my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value( + { + categorycode => $issue->{categorycode}, + itemtype => $item->effective_itemtype, + branchcode => $issue->{site}, + } + ); + + my $calendar = Koha::Calendar->new( branchcode => $issue->{'site'}, days_mode => $useDaysMode_value ); my $waiting_date = dt_from_string( $issue->{waitingdate}, 'sql' ); my $pickup_date = $waiting_date->clone->add( days => $pickupdelay ); --