This might be this bug: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8243 Nicole On Fri, Jun 15, 2012 at 12:19 AM, Mason James <mtj@kohaaloha.com> wrote:
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! :)
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/