Bug 19204: Make the debarment date calculation depends on finesCalendar
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 23 Apr 2018 18:23:00 +0000 (15:23 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Apr 2018 13:52:20 +0000 (10:52 -0300)
commit8d3eba6a297f4fd993ddf237b6cd66cfda38ff95
treef17c4234465c0e75f04f99a1c478e43f0de8859d
parent1d12311ac189b928b840e8842076492cdc8369d3
Bug 19204: Make the debarment date calculation depends on finesCalendar

This patchs adds the ability to calculate the end of the suspension date
(debarment date) using the finesCalendar syspref.
Prior to this patch it was never calculating without taking into account
the calendar.

calculated without taking holidays into account.
This was a problem because the restriction could end in the middle of a
period the library is closed.

Test plan:
- Set finescalendar to 'not including days the library is closed'
- Set a circulation condition with no fine/maxfine, but fine days and
max fine days instead
- Check out an item with a due date in the past
- Check the item in and verify the restriction date
- Clean the restriction

- Add holidays to your calendar on the calculated restriction date
- Check the item out again with the same due date in the past
- Check in the item again
- Verify the calculated restriction end date has changed, it's set to the day
after the holiday.

Fines in days restriction calculation is correctly taking calendar
into account.

Sponsored-by: Goethe-Institut
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm
Koha/Calendar.pm
t/db_dependent/Circulation.t