]> git.koha-community.org Git - koha.git/commit
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)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Tue, 25 Jan 2022 17:46:27 +0000 (17:46 +0000)
commit8aa24c0ceb8dcd5315aba90f3a661e65776c3ad4
tree3adb7e9c23057d71de01b860790e41ecc913b863
parent8f107efb285bd49394b0bab60fd7464fd31d8452
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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit cea2b217c5288c77aae7cbaf5ac791ee249b9812)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation.t