From 18dbf96b1ccf4f2600b45d485511391ec7714121 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 23 May 2013 16:40:00 -0400 Subject: [PATCH] LP1182519 Per-Hold Behind Desk ML Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index d818454d14..e943fbdabb 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -1933,7 +1933,7 @@ sub hold_request_count { } my $holds = $e->json_query({ - select => {ahr => ['pickup_lib', 'current_shelf_lib']}, + select => {ahr => ['pickup_lib', 'current_shelf_lib', 'behind_desk']}, from => 'ahr', where => { usr => $user_id, @@ -1942,14 +1942,15 @@ sub hold_request_count { } }); + my @ready = grep { + $_->{current_shelf_lib} and # avoid undef warnings + $_->{pickup_lib} eq $_->{current_shelf_lib} + } @$holds; + return { total => scalar(@$holds), - ready => scalar( - grep { - $_->{current_shelf_lib} and # avoid undef warnings - $_->{pickup_lib} eq $_->{current_shelf_lib} - } @$holds - ) + ready => scalar(@ready), + behind_desk => scalar(grep { $_->{behind_desk} eq 't' } @ready) }; } -- 2.11.0