Bug 38239: Incorrect number of items to pull (in Holds to pull) with partially filled holds

With a over-sufficient number of items, when more than one patron has
placed hold, and the holds have been partially filled (checked-in =
waiting for pick up), the number of items to pull in the Holds
to pull table shows the total number of holds, including those waiting.
This erroneously suggests to the librarian to pull an excessive number
of items from the shelves.

Test plan:
==========

1. For a bibliographic record with more than two items (in ktd, e.g.
   "Lanark a life in four books"), place hold for two patrons.
2. On the Holds to pull page control that there are two items to pull.
3. As a librarian from the library of one of the patrons, Check-in one
   item.
4. Note that in Holds to pull table you still see two items to pull,
   which is misleading.
5. Apply the patch; restart_all.
6. Now you should see only one item to be pulled.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit abfba936fb)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Janusz Kaczmarek 2024-10-23 13:27:52 +00:00 committed by Lucas Gass
parent 5a07b6a869
commit dd6240343a
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ if ( $holds->count ) {
# patrons count per biblio
my $patrons_count = {
map { $_->{biblionumber} => $_->{patrons_count} } @{ Koha::Holds->search(
{ 'suspend' => 0 },
{ 'suspend' => 0, 'found' => undef },
{
select => [ 'biblionumber', { count => { distinct => 'borrowernumber' } } ],
as => [qw( biblionumber patrons_count )],