]> git.koha-community.org Git - koha.git/commit
Bug 24138: Fix calculation of suspension days when a limit is set
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 29 Nov 2019 13:45:25 +0000 (14:45 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 10 Dec 2019 16:14:50 +0000 (16:14 +0000)
commit704ea1a62ea2d80361545101129eb3725e3fe99a
treeeee8e382530f0d062d4a3ad7554262fb4bb6de66
parentfc72ce1a5fcc002b0e1b0e399d66b2ac8afdcf51
Bug 24138: Fix calculation of suspension days when a limit is set

If there is a limit for the number of suspension days
(maxsuspensiondays), the calculation is wrong. We are reducing the
number of days before taking into account the suspension charging
interval.

For instance, a checkin is 1 year late and the circ rules are defined to
charge 7 days every 15 days.
It results in 365 * 7 / 15 days of suspension => 170 days

Before this patch the calculation was:
365 * 7 limited to 333, 333 / 15 => 22 days

Test plan:
Given the examples in the commit messages and the description of the bug
report, setup complex circulation rules and confirm that the debarment
dates are calculated correctly

Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Circulation.pm
t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t