Koha/t/db_dependent/Circulation
Jonathan Druart 704ea1a62e
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>
2019-12-10 16:14:50 +00:00
..
IssuingRules Bug 24138: Fix calculation of suspension days when a limit is set 2019-12-10 16:14:50 +00:00
Branch.t
CalcDateDue.t Bug 15260: Add unit tests 2019-10-31 11:52:44 +00:00
CalcFine.t
CheckIfIssuedToPatron.t
CheckValidBarcode.t
dateexpiry.t
GetHardDueDate.t
GetPendingOnSiteCheckouts.t
GetTopIssues.t
IsItemIssued.t
issue.t Bug 23049: Capitalise type passed to add_debit for rent 2019-10-24 17:24:21 +01:00
MarkIssueReturned.t Bug 23038: Remove unused stderr vars 2019-10-15 14:14:13 +01:00
NoIssuesChargeGuarantees.t Bug 23049: Capitalise type passed to add_debit for lost_item 2019-10-24 17:24:33 +01:00
OfflineOperation.t
ReturnClaims.t Bug 14697: Add Koha::Patron->return_claims 2019-10-31 12:04:03 +00:00
Returns.t Bug 14697: Add return claim handling to AddReturn 2019-10-31 12:03:48 +00:00
StoreLastBorrower.t
SwitchOnSiteCheckouts.t
TooMany.t Bug 23404: Change UT calls 2019-09-09 11:14:15 +01:00
transferbook.t Bug 24013: Add tests 2019-11-25 08:38:02 +00:00
transfers.t Bug 23129: Unit test 2019-10-15 14:12:49 +01:00