View | Details | Raw Unified | Return to bug 8110
Collapse All | Expand All

(-)a/C4/Circulation.pm (-2 / +2 lines)
Lines 1846-1853 sub _FixFineDaysOnReturn { Link Here
1846
    # grace period is measured in the same units as the loan
1846
    # grace period is measured in the same units as the loan
1847
    my $grace = DateTime::Duration->new( $unit => $issuingrule->{firstremind} );
1847
    my $grace = DateTime::Duration->new( $unit => $issuingrule->{firstremind} );
1848
1848
1849
    if ( ( $deltadays - $grace )->is_positive ) { # you can't compare DateTime::Durations with logical operators
1849
    if ( $deltadays - $grace->in_units('days') { 
1850
        my $new_debar_dt = $dt_today->clone()->add_duration( $deltadays * $finedays );
1850
        my $new_debar_dt = $dt_today->clone()->add_duration( DateTime::Duration->new( days => $deltadays * $finedays ) );
1851
        my $borrower_debar_dt = dt_from_string( $borrower->{debarred} );
1851
        my $borrower_debar_dt = dt_from_string( $borrower->{debarred} );
1852
        # check to see if the current debar date is a valid date
1852
        # check to see if the current debar date is a valid date
1853
        if ( $borrower->{debarred} && $borrower_debar_dt ) {
1853
        if ( $borrower->{debarred} && $borrower_debar_dt ) {
(-)a/C4/Overdues.pm (-1 / +1 lines)
Lines 309-315 sub _get_chargeable_units { Link Here
309
    else { # days
309
    else { # days
310
        if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') {
310
        if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') {
311
            my $calendar = Koha::Calendar->new( branchcode => $branchcode );
311
            my $calendar = Koha::Calendar->new( branchcode => $branchcode );
312
            $charge_duration = $calendar->days_between( $dt1, $dt2 );
312
            return $calendar->days_between( $dt1, $dt2 );
313
        } else {
313
        } else {
314
            $charge_duration = $dt2->delta_days( $dt1 );
314
            $charge_duration = $dt2->delta_days( $dt1 );
315
        }
315
        }
(-)a/Koha/Calendar.pm (-2 / +1 lines)
Lines 182-188 sub days_between { Link Here
182
            $duration->subtract( days => 1 );
182
            $duration->subtract( days => 1 );
183
        }
183
        }
184
    }
184
    }
185
    return $duration;
185
    return $duration->in_units('days');
186
186
187
}
187
}
188
188
189
- 

Return to bug 8110