Lines 1410-1416
sub checkHighHolds {
Link Here
|
1410 |
branchcode => $branchcode, |
1410 |
branchcode => $branchcode, |
1411 |
} |
1411 |
} |
1412 |
); |
1412 |
); |
1413 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => $daysmode ); |
1413 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => $daysmode }); |
1414 |
|
1414 |
|
1415 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
1415 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
1416 |
|
1416 |
|
Lines 2629-2638
sub _calculate_new_debar_dt {
Link Here
|
2629 |
my $new_debar_dt; |
2629 |
my $new_debar_dt; |
2630 |
# Use the calendar or not to calculate the debarment date |
2630 |
# Use the calendar or not to calculate the debarment date |
2631 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
2631 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
2632 |
my $calendar = Koha::DiscreteCalendar->new( |
2632 |
my $calendar = Koha::DiscreteCalendar->new({ |
2633 |
branchcode => $branchcode, |
2633 |
branchcode => $branchcode, |
2634 |
days_mode => 'Calendar' |
2634 |
days_mode => 'Calendar' |
2635 |
); |
2635 |
}); |
2636 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
2636 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
2637 |
} |
2637 |
} |
2638 |
else { |
2638 |
else { |
Lines 3795-3801
sub CalcDateDue {
Link Here
|
3795 |
else { # days |
3795 |
else { # days |
3796 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
3796 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
3797 |
} |
3797 |
} |
3798 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3798 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
3799 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
3799 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
3800 |
if ($loanlength->{lengthunit} eq 'days') { |
3800 |
if ($loanlength->{lengthunit} eq 'days') { |
3801 |
$datedue->set_hour(23); |
3801 |
$datedue->set_hour(23); |
Lines 3834-3840
sub CalcDateDue {
Link Here
|
3834 |
} |
3834 |
} |
3835 |
} |
3835 |
} |
3836 |
if ( $daysmode ne 'Days' ) { |
3836 |
if ( $daysmode ne 'Days' ) { |
3837 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3837 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
3838 |
if ( $calendar->is_holiday($datedue) ) { |
3838 |
if ( $calendar->is_holiday($datedue) ) { |
3839 |
# Don't return on a closed day |
3839 |
# Don't return on a closed day |
3840 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |
3840 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |