Bug 25619: Add ability to adjust expiration date for waiting holds

There are times when an item that is waiting for pickup needs to have the expiration date extended. This would give staff the ability to modify one by one, as needed, the reserves.expirationdate for a given item awaiting pickup.

Test Plan:
1) Place a hold, trap an item for it such that is is waiting
2) Attempt to update the expiration date
3) Note the new date is not saved
4) Apply this patch, restart all the things!
5) Attempt to update the expiration date
6) The new date should be saved!

Signed-off-by: Abbey Holt <aholt@dubuque.lib.ia.us>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle Hall 2021-07-16 13:50:29 -04:00 committed by Jonathan Druart
parent 2b083cb82a
commit d303e49f09

View file

@ -1031,7 +1031,6 @@ sub ModReserve {
my $biblionumber = $params->{'biblionumber'};
my $cancellation_reason = $params->{'cancellation_reason'};
return if $rank eq "W";
return if $rank eq "n";
return unless ( $reserve_id || ( $borrowernumber && ( $biblionumber || $itemnumber ) ) );
@ -1049,6 +1048,16 @@ sub ModReserve {
if ( $rank eq "del" ) {
$hold->cancel({ cancellation_reason => $cancellation_reason });
}
elsif ($hold->found && $hold->priority eq '0') {
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
if C4::Context->preference('HoldsLog');
# The only column that can be updated for a found hold is the expiration date
my $date = $params->{expirationdate};
if ($date) {
$hold->expirationdate(dt_from_string($date))->store();
}
}
elsif ($rank =~ /^\d+/ and $rank > 0) {
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
if C4::Context->preference('HoldsLog');