Bug 14937: Expiration date for holds based onReservesMaxPickUpDelay should not require ExpireReservesMaxPickUpDelay

C4::Letters::_parseletter will replace reserves.expirationdate with the
date a hold will be marked as problematic ( holds over ) if both
ReservesMaxPickUpDelay and ExpireReservesMaxPickUpDelay are enabled.
There is no reason this feature needs to rely on
ExpireReservesMaxPickUpDelay as there are many libraries that would like
to send the last day to pick up a hold in notices, but would rather deal
with the expired waiting holds manually rather than have Koha cancel
them automatically.

Test Plan:
1) Apply this patch
2) Set ReservesMaxPickUpDelay to 7
3) Disable ExpireReservesMaxPickUpDelay
4) Add reserves.expirationdate to your HOLD notice
5) Fill a hold for a patron
6) View the message, not that reserves.expirationdate is replaced
   with the date the hold will be marked as problematic

Signed-off-by: Karl Holton <kholten@switchinc.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c6d0202569)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
(cherry picked from commit 77aedf1f7f)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
This commit is contained in:
Kyle M Hall 2015-10-01 12:59:26 -04:00 committed by Liz Rea
parent 30a3ba393f
commit 67a3dc23f4
1 changed files with 2 additions and 3 deletions

View File

@ -785,11 +785,10 @@ sub _parseletter {
my @waitingdate = split /-/, $values->{'waitingdate'};
$values->{'expirationdate'} = '';
if( C4::Context->preference('ExpireReservesMaxPickUpDelay') &&
C4::Context->preference('ReservesMaxPickUpDelay') ) {
if ( C4::Context->preference('ReservesMaxPickUpDelay') ) {
my $dt = dt_from_string();
$dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') );
$values->{'expirationdate'} = output_pref({ dt => $dt, dateonly => 1 });
$values->{'expirationdate'} = output_pref( { dt => $dt, dateonly => 1 } );
}
$values->{'waitingdate'} = output_pref({ dt => dt_from_string( $values->{'waitingdate'} ), dateonly => 1 });