From: Thomas Berezansky Date: Tue, 11 Oct 2011 20:42:03 +0000 (-0400) Subject: Make canceled but still on the shelf holds show up X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5b4b7003d59238ba04d745b21adbb1d8c2005b2f;p=evergreen%2Fpines.git Make canceled but still on the shelf holds show up Browse Hold Shelf otherwise can't see holds canceled after the item was placed on the shelf. This also causes the expired view to show canceled but still in on the hold shelf status holds to show up. Signed-off-by: Thomas Berezansky Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index ae72e81251..2c4772ac91 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4480,6 +4480,7 @@ SELECT usr, + @@ -4537,6 +4538,67 @@ SELECT usr, + + + SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL GROUP BY current_copy)x USING (current_copy, capture_time) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5164,6 +5226,7 @@ SELECT usr, + @@ -5183,6 +5246,7 @@ SELECT usr, + 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 4b7737c866..9e33de511d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1920,9 +1920,9 @@ sub fetch_captured_holds { $org ||= $e->requestor->ws_ou; my $query = { - select => { ahr => ['id'] }, + select => { alhr => ['id'] }, from => { - ahr => { + alhr => { acp => { field => 'id', fkey => 'current_copy' @@ -1931,18 +1931,22 @@ sub fetch_captured_holds { }, where => { '+acp' => { status => OILS_COPY_STATUS_ON_HOLDS_SHELF }, - '+ahr' => { + '+alhr' => { capture_time => { "!=" => undef }, current_copy => { "!=" => undef }, fulfillment_time => undef, pickup_lib => $org, - cancel_time => undef, +# cancel_time => undef, } } }; if($self->api_name =~ /expired/) { - $query->{'where'}->{'+ahr'}->{'shelf_expire_time'} = {'<' => 'now'}; - $query->{'where'}->{'+ahr'}->{'shelf_time'} = {'!=' => undef}; +# $query->{'where'}->{'+ahr'}->{'shelf_expire_time'} = {'<' => 'now'}; + $query->{'where'}->{'+alhr'}->{'shelf_time'} = {'!=' => undef}; + $query->{'where'}->{'+alhr'}->{'-or'} = { + shelf_expire_time => { '<' => 'now'}, + cancel_time => { '!=' => undef }, + }; } my $hold_ids = $e->json_query( $query );