From f1665af3f5f3cffda90f062322d69ac9e422d783 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Tue, 22 Mar 2022 14:14:52 -0400 Subject: [PATCH] Bug 30337: Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended Holds to Pull ( pendingreserves.pl ) ignores holds if priority 1 hold is suspended, and shows the wrong number of "patrons with holds" which presumably tells the librarian how many copies to pull from the shelves. Test Plan: 1) Create a record with one or more holdable items 2) Place two holds on the record 3) Note they show in the holds to pull report 4) Suspend the priority 2 hold 5) Note the report continues showing that 2 patrons have holds 6) Resume the priority 2 hold 7) Suspend the priority 1 hold 8) Note the hold disappears from the holds to pull report 9) Apply this patch 10) Restart all the things! 11) Reload the holds to pull report 12) The report should show one hold that needs an item pulled to fill it! --- circ/pendingreserves.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 14f0dc8983..ddade0ec96 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -156,7 +156,7 @@ unless ( $enddate ) { # building query parameters my %where = ( 'me.found' => undef, - 'me.priority' => 1, + 'me.priority' => { '!=' => 0 }, 'me.suspend' => 0, 'itembib.itemlost' => 0, 'itembib.withdrawn' => 0, @@ -188,7 +188,7 @@ if ( C4::Context->preference('IndependentBranches') ){ # get all distinct unfulfilled reserves my $holds = Koha::Holds->search( { %where }, - { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } + { join => 'itembib', distinct => 1, columns => qw[me.biblionumber] } ); my @biblionumbers = $holds->get_column('biblionumber'); @@ -202,7 +202,7 @@ if ( $holds->count ) { # patrons count per biblio my $patrons_count = { map { $_->{biblionumber} => $_->{patrons_count} } @{ Koha::Holds->search( - {}, + { 'suspend' => 0 }, { select => [ 'biblionumber', { count => { distinct => 'borrowernumber' } } ], as => [qw( biblionumber patrons_count )], -- 2.30.2