diff --git a/reports/borrowers_out.pl b/reports/borrowers_out.pl index dce275b56e..d2b5af6d77 100755 --- a/reports/borrowers_out.pl +++ b/reports/borrowers_out.pl @@ -207,6 +207,11 @@ sub calculate { $strcalc .= " , " . $dbh->quote($colfield) if ($colfield); $strcalc .= " FROM borrowers "; $strcalc .= "WHERE 1 "; + if(C4::Context->preference('IndependentBranches') && !C4::Context->IsSuperLibrarian()){ + $strcalc .= "AND branchcode = '".C4::Context->userenv->{branch}."' "; + } + + my @query_args; if ( @$filters[0] ) { @$filters[0]=~ s/\*/%/g;