Lines 1344-1350
sub checkHighHolds {
Link Here
|
1344 |
branchcode => $branchcode, |
1344 |
branchcode => $branchcode, |
1345 |
} |
1345 |
} |
1346 |
); |
1346 |
); |
1347 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => $daysmode ); |
1347 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => $daysmode }); |
1348 |
|
1348 |
|
1349 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
1349 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
1350 |
|
1350 |
|
Lines 2477-2486
sub _calculate_new_debar_dt {
Link Here
|
2477 |
my $new_debar_dt; |
2477 |
my $new_debar_dt; |
2478 |
# Use the calendar or not to calculate the debarment date |
2478 |
# Use the calendar or not to calculate the debarment date |
2479 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
2479 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
2480 |
my $calendar = Koha::DiscreteCalendar->new( |
2480 |
my $calendar = Koha::DiscreteCalendar->new({ |
2481 |
branchcode => $branchcode, |
2481 |
branchcode => $branchcode, |
2482 |
days_mode => 'Calendar' |
2482 |
days_mode => 'Calendar' |
2483 |
); |
2483 |
}); |
2484 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
2484 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
2485 |
} |
2485 |
} |
2486 |
else { |
2486 |
else { |
Lines 3593-3599
sub CalcDateDue {
Link Here
|
3593 |
else { # days |
3593 |
else { # days |
3594 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
3594 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
3595 |
} |
3595 |
} |
3596 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3596 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
3597 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
3597 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
3598 |
if ($loanlength->{lengthunit} eq 'days') { |
3598 |
if ($loanlength->{lengthunit} eq 'days') { |
3599 |
$datedue->set_hour(23); |
3599 |
$datedue->set_hour(23); |
Lines 3632-3638
sub CalcDateDue {
Link Here
|
3632 |
} |
3632 |
} |
3633 |
} |
3633 |
} |
3634 |
if ( $daysmode ne 'Days' ) { |
3634 |
if ( $daysmode ne 'Days' ) { |
3635 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3635 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
3636 |
if ( $calendar->is_holiday($datedue) ) { |
3636 |
if ( $calendar->is_holiday($datedue) ) { |
3637 |
# Don't return on a closed day |
3637 |
# Don't return on a closed day |
3638 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |
3638 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |