|
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 982-988
sub CancelExpiredReserves {
Link Here
|
| 982 |
my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); |
982 |
my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); |
| 983 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
983 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
| 984 |
|
984 |
|
| 985 |
my $today = C4::Dates->new(); |
985 |
my $today = dt_from_string(); |
| 986 |
|
986 |
|
| 987 |
my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; |
987 |
my $query = "SELECT * FROM reserves WHERE TO_DAYS( NOW() ) - TO_DAYS( waitingdate ) > ? AND found = 'W' AND priority = 0"; |
| 988 |
$sth = $dbh->prepare( $query ); |
988 |
$sth = $dbh->prepare( $query ); |
|
Lines 991-998
sub CancelExpiredReserves {
Link Here
|
| 991 |
while ( my $res = $sth->fetchrow_hashref ) { |
991 |
while ( my $res = $sth->fetchrow_hashref ) { |
| 992 |
my $do_cancel = 1; |
992 |
my $do_cancel = 1; |
| 993 |
unless ( $cancel_on_holidays ) { |
993 |
unless ( $cancel_on_holidays ) { |
| 994 |
my $calendar = C4::Calendar->new( branchcode => $res->{'branchcode'} ); |
994 |
my $calendar = Koha::Calendar->new( branchcode => $res->{'branchcode'} ); |
| 995 |
my $is_holiday = $calendar->isHoliday( split( '/', $today->output('metric') ) ); |
995 |
my $is_holiday = $calendar->is_holiday( $today ); |
| 996 |
|
996 |
|
| 997 |
if ( $is_holiday ) { |
997 |
if ( $is_holiday ) { |
| 998 |
$do_cancel = 0; |
998 |
$do_cancel = 0; |
| 999 |
- |
|
|