From 62fc7ff8a4be6e3005c5955eb8cf4e7dc260ca72 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 12 Feb 2021 14:56:04 -0500 Subject: [PATCH] LP 1904737: Show copies with available status on the pull list The pull list code previously showed only copies with hard-coded status of 0 or 7. This commit changes that to any copy status that is both holdable and available (i.e. is_available: true). Signed-off-by: Jason Stephenson --- .../src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 14 +++++++++++--- .../lib/OpenILS/Application/Storage/Publisher/action.pm | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index d295fa2e72..1ad9713a40 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -2035,7 +2035,7 @@ sub print_hold_pull_list_stream { "field" => "id", "fkey" => "current_copy", "filter" => { - "circ_lib" => $$params{org_id}, "status" => [0,7] + "circ_lib" => $$params{org_id} }, "join" => { "acn" => { @@ -2059,6 +2059,14 @@ sub print_hold_pull_list_stream { "filter" => { "location" => {"=" => {"+acp" => "location"}} } + }, + "ccs" => { + "field" => "id", + "fkey" => "status", + "filter" => { + "holdable" => "t", + "is_available" => "t" + } } } } @@ -4238,10 +4246,10 @@ sub hold_has_copy_at { filter => { holdable => 't', deleted => 'f' }, fkey => 'location' }, - ccs => {field => 'id', filter => { holdable => 't'}, fkey => 'status' } + ccs => {field => 'id', filter => {holdable => 't', is_available => 't'}, fkey => 'status'} } }, - where => {'+acp' => { circulate => 't', deleted => 'f', holdable => 't', circ_lib => $org_unit, status => [0,7]}}, + where => {'+acp' => { circulate => 't', deleted => 'f', holdable => 't', circ_lib => $org_unit }}, limit => 1 }; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index 07a8bfe41d..57d0591bed 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -793,7 +793,8 @@ sub hold_pull_list { my $count = 1 if ($self->api_name =~/count$/o); my $status_filter = ''; - $status_filter = 'AND a.status IN (0,7)' if ($self->api_name =~/status_filtered/o); + $status_filter = 'AND a.status IN (SELECT id FROM config.copy_status WHERE holdable AND is_available)' + if ($self->api_name =~/status_filtered/); my $select = <<" SQL"; SELECT h.* -- 2.11.0