From 3c4985fbd65d7d0690ecfa94eeb68f6cbc9afbbf Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Tue, 17 Nov 2020 18:35:07 +0000 Subject: [PATCH] Bug 24488: (QA follow-up) Make pending reserves faster Signed-off-by: Josef Moravec Signed-off-by: Michal Denar Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- circ/pendingreserves.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 15f7ac28e0..ccf7627ec2 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -194,9 +194,7 @@ my @biblionumbers = uniq $distinct_holds->get_column('biblionumber'); # make final reserves hash and fill with info my $reserves; foreach my $bibnum ( @biblionumbers ){ - my @branchtransfers = map { $_->itemnumber } Koha::Item::Transfers->search({ datearrived => undef }, { columns => [ 'itemnumber' ], collapse => 1 }); - my @checkouts = map { $_->itemnumber } Koha::Checkouts->search({}, { columns => [ 'itemnumber' ], collapse => 1 }); my @waiting_holds = map { $_->itemnumber } Koha::Holds->search({'found' => 'W'}, { columns => [ 'itemnumber' ], collapse => 1 }); my @items = Koha::Items->search( @@ -205,7 +203,8 @@ foreach my $bibnum ( @biblionumbers ){ itemlost => 0, withdrawn => 0, notforloan => 0, - itemnumber => { -not_in => [ @branchtransfers, @checkouts, @waiting_holds ] }, + onloan => undef, + itemnumber => { -not_in => [ @branchtransfers, @waiting_holds ] }, } ); -- 2.39.5