[Koha-bugs] [Bug 14146] Additional days are not added to restriction period when checking-in several overdues for same patron
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Mar 23 19:43:31 CET 2017
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14146
--- Comment #22 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to Marcel de Rooy from comment #16)
> + # FIXME Is it right? I'd have expected 5 * 2 - 1 instead
> + # Same for the others
> + my $expected_expiration = output_pref(
> + {
> + dt => dt_from_string->add( days => ( 5 - 1 ) * 2 ),
>
> If I look to the code:
> my $grace = DateTime::Duration->new( $unit =>
> $issuing_rule->firstremind );
> my $deltadays = DateTime::Duration->new( days =>
> $chargeable_units );
> if ( $deltadays->subtract($grace)->is_positive() ) {
> my $suspension_days = $deltadays * $finedays;
> Then I would expect indeed (5-1)*2.
> Why would you expect 5*2-1 ?
> First you do deltadays - grace (=1) and then you multiply with finedays (2)
Yes but I was wondering if it is really what we expect.
If a checkin is 5 days late, with 2 days of fine per day of overdue and 1 day
of grace: I think it would make more sense to apply the grace on the total of
fine days, then 5 * 2 - 1.
(In reply to Marcel de Rooy from comment #21)
> QA Comment:
>
> [1] We now assume that the max suspension days should be applied on the
> individual suspension, not on the accumulation. Is that a logical choice?
> No blocker, just mentioning it.
I do not get it, what do you mean?
There is now a pref to choose the behavior you want to apply.
> [2] The unit test does not return the case where you would return first the
> 10 day book and then the 5 day book. This might be interesting to add since
> formerly the second return would not make a difference.
> Note: I tested this case in the interface and it works.
Hum maybe, but looking at the current code it seems hard to change it that much
to break that condition. I would have added it if I did not have to c/p ~70
lines of code...
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list