From de31362cef248cc2525239449be849981040d120 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Fri, 18 Mar 2022 14:57:43 -0400 Subject: [PATCH] Bug 17983: Add minutes loan to DiscreteCalendar This is an additional feature to our new Discrete Calendar. Theses patches add the possibility to choose the loan unit as minutes in circulations rules. Test plan: - Apply patch of Bugzilla 17015 - Apply this patch. - Run test t/db_dependent/minutes_loan.t - Create new item type for the new rule. - Create circulation rule and fill the fields, make sure the unit is set to : minutes, choose the item type of the one created above.- - Checkout an item that follow the circulation rule and set due date in the past. - Run fines.pl. - Check if the correct amount was calculated. - Note: make sure to factor in the fine grace period if set and the system preference FinesIncludeGracePeriod.fixed patch tests and minor adjustments --- C4/Circulation.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index c96bb5126b..348004e221 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3734,7 +3734,6 @@ sub CalcDateDue { else { # days $dur = DateTime::Duration->new( days => $loanlength->{$length_key}); } - ##my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); $datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); if ($loanlength->{lengthunit} eq 'days') { $datedue->set_hour(23); -- 2.25.1