From: Thomas Berezansky Date: Mon, 7 May 2012 19:42:35 +0000 (-0400) Subject: Fix hold has copy at lookup X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bd190b0b66baaeb669f042b90053732596771311;p=evergreen%2Fmasslnc.git 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 --- 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} = {