Bug 30063: Remove svc/members/search
[srvgit] / acqui / lateorders.pl
index 65d4703..a47088c 100755 (executable)
@@ -45,25 +45,21 @@ To know on which branch this script have to display late order.
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Koha;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 use C4::Context;
-use C4::Acquisition;
-use C4::Letters;
-use Koha::DateUtils;
-use Koha::Acquisition::Orders;
+use C4::Letters qw( SendAlerts GetLetters );
+use Koha::DateUtils qw( dt_from_string output_pref );
+use Koha::Acquisition::Orders qw( filter_by_lates );
 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,
     }
 );
 
@@ -123,15 +119,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,
@@ -170,6 +157,6 @@ $template->param(
     estimateddeliverydatefrom => $estimateddeliverydatefrom,
     estimateddeliverydateto   => $estimateddeliverydateto,
        intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
-    csv_profiles         => [ Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_orders' }) ],
+    csv_profiles         => Koha::CsvProfiles->search({ type => 'sql', used_for => 'late_orders' }),
 );
 output_html_with_http_headers $input, $cookie, $template->output;