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

(-)a/C4/Overdues.pm (-4 / +3 lines)
Lines 349-362 sub get_chargeable_units { Link Here
349
    if ( $unit eq 'hours' ) {
349
    if ( $unit eq 'hours' ) {
350
        if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) {
350
        if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) {
351
            my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode });
351
            my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode });
352
            $charge_duration = $calendar->hours_between( $date_due, $date_returned );
352
            $charge_duration = $calendar->open_hours_between( $date_due, $date_returned );
353
        } else {
353
        } else {
354
            $charge_duration = $date_returned->delta_ms($date_due);
354
            $charge_duration = $date_returned->delta_ms($date_due);
355
        }
355
        }
356
        if ( $charge_duration->in_units('hours') == 0 && $charge_duration->in_units('seconds') > 0 ) {
356
        if ( $charge_duration == 0 && $charge_duration->in_units('seconds') * 3600 > 0 ){
357
            return 1;
357
            return 1;
358
        }
358
        }
359
        return $charge_duration->in_units('hours');
359
        return $charge_duration;
360
    } else {    # days
360
    } else {    # days
361
        if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) {
361
        if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) {
362
            my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode });
362
            my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode });
363
- 

Return to bug 17015