my $pending_article_requests = Koha::ArticleRequests->search_limited(
{
status => Koha::ArticleRequest::Status::Pending,
$branch ? ( branchcode => $branch ) : (),
$branch ? ( 'me.branchcode' => $branch ) : (),
}
)->count;
-