From 44f1433f7d769202cf99f828f7542cf7316a9ca3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Apr 2015 16:10:05 +0200 Subject: [PATCH] Bug 12204: Display the expiration date on RESERVESLIP If an expiration date is set on placing an item on hold, the date is not displayed on the reserve slip. It's only generated/displayed if the prefs ExpireReservesMaxPickUpDelay and ReservesMaxPickUpDelay are set. Test plan: 1/ Define RESERVESLIP with, at least, Hold until: <> 2/ Place an item on hold and define an expiration date 3/ Check the item in and print the slip 4/ Note that the expiration date is correctly displayed --- C4/Letters.pm | 6 ++++-- C4/Reserves.pm | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index bc60bc3..9a65cc1 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -806,8 +806,10 @@ sub _parseletter { if ( $table eq 'reserves' && $values->{'waitingdate'} ) { my @waitingdate = split /-/, $values->{'waitingdate'}; - $values->{'expirationdate'} = ''; - if ( C4::Context->preference('ReservesMaxPickUpDelay') ) { + if ( $values->{expirationdate} ) { + $values->{expirationdate} = output_pref({ dt => dt_from_string( $values->{expirationdate} ), dateonly => 1 }); + } + elsif ( C4::Context->preference('ReservesMaxPickUpDelay') ) { my $dt = dt_from_string(); $dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') ); $values->{'expirationdate'} = output_pref( { dt => $dt, dateonly => 1 } ); diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 6ed1543..b6cf4c3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1398,6 +1398,7 @@ sub GetReserveInfo { reserves.biblionumber, reserves.branchcode, reserves.waitingdate, + reserves.expirationdate, notificationdate, reminderdate, priority, -- 2.1.0