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 914-920 sub CancelExpiredReserves { Link Here
914
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
914
        my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge");
915
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
915
        my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');
916
916
917
        my $today = C4::Dates->new();
917
        my $today = dt_from_string();
918
918
919
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
919
        my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0";
920
        $sth = $dbh->prepare( $query );
920
        $sth = $dbh->prepare( $query );
Lines 923-930 sub CancelExpiredReserves { Link Here
923
        while ( my $res = $sth->fetchrow_hashref ) {
923
        while ( my $res = $sth->fetchrow_hashref ) {
924
            my $do_cancel = 1;
924
            my $do_cancel = 1;
925
            unless ( $cancel_on_holidays ) {
925
            unless ( $cancel_on_holidays ) {
926
                my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} );
926
                my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} );
927
                my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) );
927
                my $is_holiday = $calendar->is_holiday( $today );
928
928
929
                if ( $is_holiday ) {
929
                if ( $is_holiday ) {
930
                    $do_cancel = 0;
930
                    $do_cancel = 0;
931
- 

Return to bug 8735