From 3347bf8da6baf6198b82eeac2f7e690970dc357c 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 --- Koha/Holds.pm | 5 ++++- circ/pendingreserves.pl | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Koha/Holds.pm b/Koha/Holds.pm index 2a117f5f66..7d070f8513 100644 --- a/Koha/Holds.pm +++ b/Koha/Holds.pm @@ -121,7 +121,10 @@ sub get_items_that_can_fill { push @bibs_or_items, 'me.biblionumber' => { in => \@biblionumbers } if @biblionumbers; my @branchtransfers = 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 1f853554b5..3f2f39b83d 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.30.2