|
Lines 1423-1429
sub checkHighHolds {
Link Here
|
| 1423 |
branchcode => $branchcode, |
1423 |
branchcode => $branchcode, |
| 1424 |
} |
1424 |
} |
| 1425 |
); |
1425 |
); |
| 1426 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branchcode, days_mode => $daysmode ); |
1426 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branchcode, days_mode => $daysmode }); |
| 1427 |
|
1427 |
|
| 1428 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
1428 |
my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branchcode, $patron->unblessed ); |
| 1429 |
|
1429 |
|
|
Lines 2606-2615
sub _calculate_new_debar_dt {
Link Here
|
| 2606 |
my $new_debar_dt; |
2606 |
my $new_debar_dt; |
| 2607 |
# Use the calendar or not to calculate the debarment date |
2607 |
# Use the calendar or not to calculate the debarment date |
| 2608 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
2608 |
if ( C4::Context->preference('SuspensionsCalendar') eq 'noSuspensionsWhenClosed' ) { |
| 2609 |
my $calendar = Koha::DiscreteCalendar->new( |
2609 |
my $calendar = Koha::DiscreteCalendar->new({ |
| 2610 |
branchcode => $branchcode, |
2610 |
branchcode => $branchcode, |
| 2611 |
days_mode => 'Calendar' |
2611 |
days_mode => 'Calendar' |
| 2612 |
); |
2612 |
}); |
| 2613 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
2613 |
$new_debar_dt = $calendar->addDuration( $return_date, $suspension_days ); |
| 2614 |
} |
2614 |
} |
| 2615 |
else { |
2615 |
else { |
|
Lines 3757-3763
sub CalcDateDue {
Link Here
|
| 3757 |
else { # days |
3757 |
else { # days |
| 3758 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
3758 |
$dur = DateTime::Duration->new( days => $loanlength->{$length_key}); |
| 3759 |
} |
3759 |
} |
| 3760 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3760 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
| 3761 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
3761 |
$datedue = $calendar->addDuration( $datedue, $dur, $loanlength->{lengthunit} ); |
| 3762 |
if ($loanlength->{lengthunit} eq 'days') { |
3762 |
if ($loanlength->{lengthunit} eq 'days') { |
| 3763 |
$datedue->set_hour(23); |
3763 |
$datedue->set_hour(23); |
|
Lines 3796-3802
sub CalcDateDue {
Link Here
|
| 3796 |
} |
3796 |
} |
| 3797 |
} |
3797 |
} |
| 3798 |
if ( $daysmode ne 'Days' ) { |
3798 |
if ( $daysmode ne 'Days' ) { |
| 3799 |
my $calendar = Koha::DiscreteCalendar->new( branchcode => $branch, days_mode => $daysmode ); |
3799 |
my $calendar = Koha::DiscreteCalendar->new({ branchcode => $branch, days_mode => $daysmode }); |
| 3800 |
if ( $calendar->is_holiday($datedue) ) { |
3800 |
if ( $calendar->is_holiday($datedue) ) { |
| 3801 |
# Don't return on a closed day |
3801 |
# Don't return on a closed day |
| 3802 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |
3802 |
$datedue = $calendar->prev_open_days( $datedue )->set(hour => 23, minute => 59); |