Bug 29476: Correct soonest renewal date calculation for checkouts with auto-renewal
authorJoonas Kylmälä <joonas.kylmala@iki.fi>
Sun, 14 Nov 2021 14:19:08 +0000 (14:19 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 14 Jan 2022 02:37:33 +0000 (16:37 -1000)
commited021c0add2e710ef402fdf7aa6126fc1501da05
tree074efacb3ce28f25da0ac1e86cf2776b302ba6af
parent093cffe7c120b2586a40140e35bafa5c4d50f968
Bug 29476: Correct soonest renewal date calculation for checkouts with auto-renewal

If a checkout with auto-renewal enabled doesn't have a
"norenewalbefore" circulation rule set the code in CanBookBeRenewed()
falls back to using due date (to verify this please look for the
string "auto_too_soon" in C4/Circulation.pm), the calculation result
of GetSoonestRenewDate() however didn't do this, though luckily it was
not used in CanBookBeRenewed so we didn't get any issues
there. However, GetSoonestRenewDate() is used for displaying the
soonest renewal date in the staff interface on the circ/renew.pl page
so you would have gotten wrong results there.

This patch moves additionally the tests made for Bug 14395 under a new
subtest for GetSoonestRenewDate() as they should have been like that
already before.

To test:
  1) prove t/db_dependent/Circulation.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Circulation.pm
t/db_dependent/Circulation.t