LP1182519 Per-Hold Behind Desk ML
authorBill Erickson <berick@esilibrary.com>
Thu, 23 May 2013 20:40:00 +0000 (16:40 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 23 May 2013 20:40:00 +0000 (16:40 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm

index d818454..e943fbd 100644 (file)
@@ -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)
     };
 }