Lines 799-814
sub CancelExpiredReserves {
Link Here
|
799 |
|
799 |
|
800 |
my $today = dt_from_string(); |
800 |
my $today = dt_from_string(); |
801 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
801 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
|
|
802 |
my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); |
802 |
|
803 |
|
803 |
my $dbh = C4::Context->dbh; |
804 |
my $dbh = C4::Context->dbh; |
804 |
|
805 |
|
805 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
806 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
|
|
807 |
|
808 |
my $params = { expirationdate => { '<', $dtf->format_date($today) } }; |
809 |
|
810 |
$params->{found} = undef unless $expireWaiting; |
811 |
|
806 |
# FIXME To move to Koha::Holds->search_expired (?) |
812 |
# FIXME To move to Koha::Holds->search_expired (?) |
807 |
my $holds = Koha::Holds->search( |
813 |
my $holds = Koha::Holds->search( $params ); |
808 |
{ |
|
|
809 |
expirationdate => { '<', $dtf->format_date($today) } |
810 |
} |
811 |
); |
812 |
|
814 |
|
813 |
while ( my $hold = $holds->next ) { |
815 |
while ( my $hold = $holds->next ) { |
814 |
my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); |
816 |
my $calendar = Koha::Calendar->new( branchcode => $hold->branchcode ); |
815 |
- |
|
|