@@ -, +, @@ Koha::Acq::Orders->filter_by_late --- Koha/Acquisition/Orders.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) --- a/Koha/Acquisition/Orders.pm +++ a/Koha/Acquisition/Orders.pm @@ -128,7 +128,7 @@ sub filter_by_lates { ( C4::Context->preference('IndependentBranches') && !C4::Context->IsSuperLibrarian - ? ( 'borrower.branchcode' => C4::Context->userenv->{branch} ) + ? ( 'authorisedby.branchcode' => C4::Context->userenv->{branch} ) : () ), @@ -142,7 +142,14 @@ sub filter_by_lates { '+as' => [qw/ calculated_estimated_delivery_date /], - join => { 'basketno' => 'booksellerid' }, + join => ( + ( + C4::Context->preference('IndependentBranches') + && !C4::Context->IsSuperLibrarian + ) + ? { 'basketno' => [ 'authorisedby', 'booksellerid' ] } + : { 'basketno' => 'booksellerid' } + ), prefetch => {'basketno' => 'booksellerid'}, } ); --