Bug 27049: Add /misc/cronjobs/writeoff_debts.pl
[koha-ffzg.git] / acqui / lateorders.pl
index ff3ce70..be12b32 100755 (executable)
@@ -45,7 +45,6 @@ To know on which branch this script have to display late order.
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Bookseller qw( GetBooksellersWithLateOrders );
 use C4::Auth;
 use C4::Koha;
 use C4::Output;
@@ -56,13 +55,12 @@ use Koha::DateUtils;
 use Koha::Acquisition::Orders;
 use Koha::CsvProfiles;
 
-my $input = new CGI;
+my $input = CGI->new;
 my ($template, $loggedinuser, $cookie) = get_template_and_user(
     {
         template_name   => "acqui/lateorders.tt",
         query           => $input,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { acquisition => 'order_receive' },
         debug           => 1,
     }
@@ -124,15 +122,6 @@ if ($op and $op eq "send_alert"){
     }
 }
 
-my @parameters = ( $delay );
-push @parameters, $estimateddeliverydatefrom_dt
-    ? $estimateddeliverydatefrom_dt->ymd()
-    : undef;
-
-push @parameters, $estimateddeliverydateto_dt
-    ? $estimateddeliverydateto_dt->ymd()
-    : undef;
-
 my @lateorders = Koha::Acquisition::Orders->filter_by_lates(
     {
         delay        => $delay,
@@ -152,7 +141,7 @@ my @lateorders = Koha::Acquisition::Orders->filter_by_lates(
 my $booksellers = Koha::Acquisition::Booksellers->search(
     {
         id => {
-            -in => map { $_->basket->booksellerid } @lateorders
+            -in => [ map { $_->basket->booksellerid } @lateorders ]
         },
     }
 );