[Koha-devel] About "Problems on Due date when checking in"
Mason James
mtj at kohaaloha.com
Fri Jun 15 06:19:13 CEST 2012
On 2012-06-15, at 1:07 PM, Bernardo Gonzalez Kriegel wrote:
> Hi,
> we noted a strange behavior: if check out an item and immediately check in the item then the user is debarred.
>
> Following the code found that user is debarred if ($deltadays -$grace)->is_positive is true
> (_FixFineDaysOnReturn, C4/Circulation.pm)
>
> I think that $deltadays = $calendar->days_between( $dt_due, $dt_today ) needs to be negative if
> $dt_due > $dt_today, but is computed on Koha/Calendar.pm as
>
> my $duration = $dateend_temp->delta_days($datestart_temp);
> (there is a while that changes $duration but DateTime->compare( $datestart_temp, $dateend_temp ) = 1 in this case)
>
> Now, the method delta_days() always returns a positive duration, even if $dt_due > $dt_today
>
> If we compute $duration as
>
> my $duration = $dateend_temp->subtract_datetime($datestart_temp);
>
> and add a line on C4/Circulation.pm
>
> my $deltadays = $calendar->days_between( $dt_due, $dt_today );
> +return if ( $deltadays->is_negative );
>
> we solved our problem.
>
> Do you think that this is a real bug or we missed some configuration?
>
> (the code examples are from master but the problem is on 3.8.0, where we found it.
> BUG 8045 changes some of the code, but not the use of delta_days() method)
>
> Sincerely
> Bernardo
log a bug > http://bugs.koha-community.org
then attach your patch! :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 535 bytes
Desc: This is a digitally signed message part
URL: </pipermail/koha-devel/attachments/20120615/6cfe22ba/attachment.pgp>
More information about the Koha-devel
mailing list