|
Lines 876-892
Cancels all reserves with an expiration date from before today.
Link Here
|
| 876 |
=cut |
876 |
=cut |
| 877 |
|
877 |
|
| 878 |
sub CancelExpiredReserves { |
878 |
sub CancelExpiredReserves { |
| 879 |
|
|
|
| 880 |
my $today = dt_from_string(); |
879 |
my $today = dt_from_string(); |
| 881 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
880 |
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); |
| 882 |
my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); |
881 |
my $expireWaiting = C4::Context->preference('ExpireReservesMaxPickUpDelay'); |
| 883 |
|
882 |
|
| 884 |
my $dbh = C4::Context->dbh; |
|
|
| 885 |
|
| 886 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
883 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
| 887 |
|
|
|
| 888 |
my $params = { expirationdate => { '<', $dtf->format_date($today) } }; |
884 |
my $params = { expirationdate => { '<', $dtf->format_date($today) } }; |
| 889 |
|
|
|
| 890 |
$params->{found} = undef unless $expireWaiting; |
885 |
$params->{found} = undef unless $expireWaiting; |
| 891 |
|
886 |
|
| 892 |
# FIXME To move to Koha::Holds->search_expired (?) |
887 |
# FIXME To move to Koha::Holds->search_expired (?) |
| 893 |
- |
|
|