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 961-967
sub CancelExpiredReserves {
Link Here
|
961 |
my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); |
961 |
my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); |
962 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
962 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
963 |
|
963 |
|
964 |
my $today = C4::Dates->new(); |
964 |
my $today = dt_from_string(); |
965 |
|
965 |
|
966 |
my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; |
966 |
my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; |
967 |
$sth = $dbh->prepare( $query ); |
967 |
$sth = $dbh->prepare( $query ); |
Lines 970-977
sub CancelExpiredReserves {
Link Here
|
970 |
while ( my $res = $sth->fetchrow_hashref ) { |
970 |
while ( my $res = $sth->fetchrow_hashref ) { |
971 |
my $do_cancel = 1; |
971 |
my $do_cancel = 1; |
972 |
unless ( $cancel_on_holidays ) { |
972 |
unless ( $cancel_on_holidays ) { |
973 |
my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} ); |
973 |
my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); |
974 |
my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) ); |
974 |
my $is_holiday = $calendar->is_holiday( $today ); |
975 |
|
975 |
|
976 |
if ( $is_holiday ) { |
976 |
if ( $is_holiday ) { |
977 |
$do_cancel = 0; |
977 |
$do_cancel = 0; |
978 |
- |
|
|