From 75c8bcac767837a56315692cdac6bb35f5ba39b1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 12 Mar 2020 08:46:59 +0100 Subject: [PATCH] Bug 24159: Use days_mode circ rule to calculate the dropbox date Calculate the drop box date depending on the circ rule. Note that only the branchcode is taken into account here. Is that correct? Test plan: Use the drop box date feature and confirm that it takes into account the calendar, depending on the circ rule. Signed-off-by: Simon Perry --- Koha/Checkouts.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Koha/Checkouts.pm b/Koha/Checkouts.pm index ccfeb36e10..cad363d6e9 100644 --- a/Koha/Checkouts.pm +++ b/Koha/Checkouts.pm @@ -47,7 +47,14 @@ sub calculate_dropbox_date { my $userenv = C4::Context->userenv; my $branchcode = $userenv->{branch} // q{}; - my $calendar = Koha::Calendar->new( branchcode => $branchcode ); + my $useDaysMode_value = Koha::CirculationRules->get_useDaysMode_effective_value( + { + categorycode => undef, + itemtype => undef, + branchcode => $branchcode, + } + ); + my $calendar = Koha::Calendar->new( branchcode => $branchcode, days_mode => $useDaysMode_value ); my $today = DateTime->now( time_zone => C4::Context->tz() ); my $dropbox_date = $calendar->addDate( $today, -1 ); -- 2.11.0