From c5f7f1b3677da25afd693053974915e1d26a881b Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 20 Jul 2023 02:39:27 +0000 Subject: [PATCH] Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date This change fixes GetSoonestRenewDate so that it returns the soonest renew date as calculated using "No Renewal Before" and "NoRenewalBeforePrecision". In the past, it would only return the soonest renew date if "$now" was lesser than it, which would typically only happen when using an "exact" precision rather than a "date" precision. Test plan: 0. Apply the patch 1. prove t/db_dependent/Circulation.t Signed-off-by: Sam Lau --- C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 14918de09d..af8a17d37b 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3459,7 +3459,7 @@ sub GetSoonestRenewDate { { $soonestrenewal->truncate( to => 'day' ); } - return $soonestrenewal if $now < $soonestrenewal; + return $soonestrenewal; } elsif ( $issue->auto_renew && $patron->autorenew_checkouts ) { # Checkouts with auto-renewing fall back to due date my $soonestrenewal = dt_from_string( $issue->date_due ); -- 2.30.2