Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date
authorDavid Cook <dcook@prosentient.com.au>
Thu, 20 Jul 2023 02:39:27 +0000 (02:39 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Thu, 31 Aug 2023 10:36:51 +0000 (10:36 +0000)
commitc31d9761740a51a7485b7592ae2c7110b32aed1f
treef2c2c77f646a7325e310929a34e8f0b177dc8572
parent4e90014d79130b7e9460dea4765f86960dabfa11
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 <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f8c474019d74c9fd608206daf3074a79c5737f12)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8fc3531e079d076a3212b2aa76525b5ca6e874bd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
C4/Circulation.pm
t/db_dependent/Circulation.t