From caea8b048d4b74a5156f86421e9f05678a865267 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 4 Apr 2022 12:21:43 +0000 Subject: [PATCH] Bug 30447: Check if transfers arrived or cancelled TO test: 1 - Find a bib with a single item 2 - Browse to Circulation->Transfer 3 - Transfer the item to another branch 4 - Check the item in at current branch and cancel the transfer on the dialog 5 - Place a hold on the biblio for a patron at current branch 6 - Browse to Circulation->Holds to pull 7 - Item does not show 8 - Apply patch, restart all 9 - Browse to Circulation->Holds to pull 10 - Item shows Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 206ba015c4a4b28b022ab9d6481a07ab76461747) Signed-off-by: Lucas Gass (cherry picked from commit 3f7363f6ca7c0862b9071fe956f97a1401aad50d) Signed-off-by: Arthur Suzuki --- Koha/Holds.pm | 4 +++- circ/pendingreserves.pl | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Koha/Holds.pm b/Koha/Holds.pm index 563a43ba40..b7f7cf1c45 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -122,7 +122,9 @@ sub get_items_that_can_fill { my @branchtransfers = map { $_->itemnumber } Koha::Item::Transfers->search( - { datearrived => undef }, + { datearrived => undef, + datecancelled => undef, + }, { columns => ['itemnumber'], collapse => 1, diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index b14c5ab8e9..314fd6d60d 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -161,7 +161,7 @@ my %where = ( 'itembib.itemlost' => 0, 'itembib.withdrawn' => 0, 'itembib.notforloan' => 0, - 'itembib.itemnumber' => { -not_in => \'SELECT itemnumber FROM branchtransfers WHERE datearrived IS NULL' } + 'itembib.itemnumber' => { -not_in => \'SELECT itemnumber FROM branchtransfers WHERE datearrived IS NULL AND datecancelled IS NULL' } ); # date boundaries @@ -190,6 +190,7 @@ my $holds = Koha::Holds->search( { %where }, { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } ); + my @biblionumbers = $holds->get_column('biblionumber'); my $all_items; -- 2.39.5