Lines 352-365
sub get_chargeable_units {
Link Here
|
352 |
if ( $unit eq 'hours' ) { |
352 |
if ( $unit eq 'hours' ) { |
353 |
if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { |
353 |
if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { |
354 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode }); |
354 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode }); |
355 |
$charge_duration = $calendar->hours_between( $date_due, $date_returned ); |
355 |
$charge_duration = $calendar->open_hours_between( $date_due, $date_returned ); |
356 |
} else { |
356 |
} else { |
357 |
$charge_duration = $date_returned->delta_ms($date_due); |
357 |
$charge_duration = $date_returned->delta_ms($date_due); |
358 |
} |
358 |
} |
359 |
if ( $charge_duration->in_units('hours') == 0 && $charge_duration->in_units('seconds') > 0 ) { |
359 |
if ( $charge_duration == 0 && $charge_duration->in_units('seconds') * 3600 > 0 ){ |
360 |
return 1; |
360 |
return 1; |
361 |
} |
361 |
} |
362 |
return $charge_duration->in_units('hours'); |
362 |
return $charge_duration; |
363 |
} else { # days |
363 |
} else { # days |
364 |
if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { |
364 |
if ( C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed' ) { |
365 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode }); |
365 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode }); |
366 |
- |
|
|