From bd190b0b66baaeb669f042b90053732596771311 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Mon, 7 May 2012 15:42:35 -0400 Subject: [PATCH] Fix hold has copy at lookup Filter on available or reshelving, and add more hold type support for lookup purposes (parts and issuance holds). Signed-off-by: Thomas Berezansky Signed-off-by: Lebbeous Fogle-Weekley --- .../lib/OpenILS/Application/Circ/Holds.pm | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 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 70325f9788..906ec5347f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -3540,7 +3540,7 @@ sub hold_has_copy_at { ccs => {field => 'id', filter => { holdable => 't'}, fkey => 'status' } } }, - where => {'+acp' => { circulate => 't', deleted => 'f', holdable => 't', circ_lib => $org_unit}}, + where => {'+acp' => { circulate => 't', deleted => 'f', holdable => 't', circ_lib => $org_unit, status => [0,7]}}, limit => 1 }; @@ -3551,7 +3551,23 @@ sub hold_has_copy_at { } elsif($hold_type eq 'V') { $query->{where}->{'+acp'}->{call_number} = $hold_target; - + + } elsif($hold_type eq 'P') { + + $query->{from}->{acp}->{acpm} = { + field => 'target_copy', + fkey => 'id', + filter => {part => $hold_target}, + }; + + } elsif($hold_type eq 'I') { + + $query->{from}->{acp}->{sitem} = { + field => 'unit', + fkey => 'id', + filter => {issuance => $hold_target}, + }; + } elsif($hold_type eq 'T') { $query->{from}->{acp}->{acn} = { -- 2.43.2