The availability of a hold can now be determined by
hold.current_shelf_lib == hold.pickup_lib.
This change updates the API call for open hold counts for a patron.
open-ils.actor.user.hold_requests.count
Signed-off-by: Bill Erickson <berick@esilibrary.com>
}
my $holds = $e->json_query({
- select => {ahr => ['shelf_time']},
+ select => {ahr => ['pickup_lib', 'current_shelf_lib']},
from => 'ahr',
where => {
usr => $user_id,
return {
total => scalar(@$holds),
- ready => scalar(grep { $_->{shelf_time} } @$holds)
+ ready => scalar(
+ grep {
+ $_->{current_shelf_lib} and # avoid undef warnings
+ $_->{pickup_lib} eq $_->{current_shelf_lib}
+ } @$holds
+ )
};
}