}
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,
}
});
+ 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)
};
}