From 26410c270171db5edd4092474579ef0d2c71089c Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Wed, 4 Nov 2020 11:34:29 +0100 Subject: [PATCH] Bug 20125: Make Koha::Acquisition::Orders->filter_by_lates usable in command line scripts --- Koha/Acquisition/Orders.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm index b8ee2f7..c1e8a36 100644 --- a/Koha/Acquisition/Orders.pm +++ b/Koha/Acquisition/Orders.pm @@ -113,6 +113,7 @@ sub filter_by_lates { ( @delivery_time_conditions ? ( -and => \@delivery_time_conditions ) : ()), ( C4::Context->preference('IndependentBranches') + && defined(C4::Context->userenv) && !C4::Context->IsSuperLibrarian ? ( 'borrower.branchcode' => C4::Context->userenv->{branch} ) : () -- 2.7.4