diff --git a/Koha/Acquisition/Orders.pm b/Koha/Acquisition/Orders.pm index 5240d699a5..2438886ac8 100644 --- a/Koha/Acquisition/Orders.pm +++ b/Koha/Acquisition/Orders.pm @@ -130,10 +130,7 @@ sub filter_by_lates { && !C4::Context->IsSuperLibrarian ? ( 'borrower.branchcode' => C4::Context->userenv->{branch} ) : () - ), - - ( orderstatus => { '-not_in' => ['cancelled', 'complete'] } ), - + ) }, { '+select' => [ @@ -145,7 +142,7 @@ sub filter_by_lates { join => { 'basketno' => 'booksellerid' }, prefetch => {'basketno' => 'booksellerid'}, } - ); + )->filter_by_active; } =head3 filter_by_active diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 7ce5683ae5..6e8dbb9269 100755 --- a/acqui/lateorders.pl +++ b/acqui/lateorders.pl @@ -50,7 +50,7 @@ use C4::Output qw( output_html_with_http_headers ); use C4::Context; use C4::Letters qw( SendAlerts GetLetters ); use Koha::DateUtils qw( dt_from_string ); -use Koha::Acquisition::Orders qw( filter_by_lates ); +use Koha::Acquisition::Orders; use Koha::CsvProfiles; my $input = CGI->new;