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

(-)a/C4/Reserves.pm (-5 / +4 lines)
Lines 36-44 use C4::Members qw(); Link Here
36
use C4::Letters;
36
use C4::Letters;
37
use C4::Branch qw( GetBranchDetail );
37
use C4::Branch qw( GetBranchDetail );
38
use C4::Dates qw( format_date_in_iso );
38
use C4::Dates qw( format_date_in_iso );
39
use C4::Calendar;
40
39
41
use Koha::DateUtils;
40
use Koha::DateUtils;
41
use Koha::Calendar;
42
42
43
use List::MoreUtils qw( firstidx );
43
use List::MoreUtils qw( firstidx );
44
44
Lines 974-980 sub CancelExpiredReserves { Link Here
974
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
974
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
975
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
975
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
976
976
977
        my $today = C4::Dates->new();
977
        my $today = dt_from_string();
978
978
979
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
979
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
980
        $sth = $dbh->prepare( $query );
980
        $sth = $dbh->prepare( $query );
Lines 983-990 sub CancelExpiredReserves { Link Here
983
        while ( my $res = $sth->fetchrow_hashref ) {
983
        while ( my $res = $sth->fetchrow_hashref ) {
984
            my $do_cancel = 1;
984
            my $do_cancel = 1;
985
            unless ( $cancel_on_holidays ) {
985
            unless ( $cancel_on_holidays ) {
986
                my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} );
986
                my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} );
987
                my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) );
987
                my $is_holiday = $calendar->is_holiday( $today );
988
988
989
                if ( $is_holiday ) {
989
                if ( $is_holiday ) {
990
                    $do_cancel = 0;
990
                    $do_cancel = 0;
991
- 

Return to bug 8735