Bug 12063 - Remove checking of ExpireReservesMaxPickUpDelay in CancelExpiredReserves(). Koha::Hold::set_waiting calculate expiration date from today instead of hold's waiting date.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Alex Arnaud 2017-05-04 08:54:16 +00:00 committed by Kyle M Hall
parent 342baadde5
commit a08b309c4f
3 changed files with 3 additions and 9 deletions

View File

@ -899,7 +899,6 @@ Cancels all reserves with an expiration date from before today.
=cut
sub CancelExpiredReserves {
return unless C4::Context->preference("ExpireReservesMaxPickUpDelay");
my $today = dt_from_string();
my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays');

View File

@ -140,7 +140,7 @@ sub set_waiting {
$expirationdate->add(days => $max_pickup_delay);
if ( C4::Context->preference("ExcludeHolidaysFromMaxPickUpDelay") ) {
$expirationdate = $calendar->days_forward( dt_from_string($self->waitingdate), $max_pickup_delay );
$expirationdate = $calendar->days_forward( dt_from_string(), $max_pickup_delay );
}
# If patron's requested expiration date is prior to the

View File

@ -8,7 +8,7 @@ use Koha::DateUtils;
use t::lib::Mocks;
use t::lib::TestBuilder;
use Test::More tests => 6;
use Test::More tests => 5;
use_ok('C4::Reserves');
@ -63,12 +63,7 @@ my $reserve2 = $builder->build({
CancelExpiredReserves();
my $r2 = Koha::Holds->find($reserve2->{reserve_id});
ok($r2, 'Without ExpireReservesMaxPickUpDelay, reserve 2 should not be canceled.');
t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelay', 1);
CancelExpiredReserves();
$r2 = Koha::Holds->find($reserve2->{reserve_id});
is($r2, undef,'With ExpireReservesMaxPickUpDelay, reserve 2 should be canceled.');
is($r2, undef,'reserve 2 should be canceled.');
# Reserve expired on holiday
my $reserve3 = $builder->build({