From 9b8172859f7fa74099d86fd5abb45482ce4ba6a1 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 15 Aug 2024 16:04:25 +0200 Subject: [PATCH] Bug 37651: Add ConfirmFutureHolds to item->current_holds Test plan: Add future item level hold for another branch. Check in. Confirm and transfer. Note that without this patch, there is no patron info for the column On hold for on transferstoreceive. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens Signed-off-by: Lucas Gass (cherry picked from commit 503a81efe1e32c6b1bc7c36174b1dba3887b3596) Signed-off-by: Paul Derscheid --- Koha/Item.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 7587747803..d6c46b6a28 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1172,11 +1172,12 @@ sub current_holds { my ($self) = @_; my $attributes = { order_by => 'priority' }; my $dtf = Koha::Database->new->schema->storage->datetime_parser; + my $dt = dt_from_string()->add( days => C4::Context->preference('ConfirmFutureHolds') || 0 ); my $params = { itemnumber => $self->itemnumber, suspend => 0, -or => [ - reservedate => { '<=' => $dtf->format_date(dt_from_string) }, + reservedate => { '<=' => $dtf->format_date($dt) }, waitingdate => { '!=' => undef }, ], };