Bug 29196: (Bug 27068 follow-up) - Remove unnecessary check
[srvgit] / acqui / parcels.pl
index 139cc0b..9fa697a 100755 (executable)
@@ -68,14 +68,14 @@ To know how many results have to be display / page.
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 
-use C4::Acquisition;
-use C4::Budgets;
+use C4::Acquisition qw( GetInvoices GetInvoice AddInvoice );
+use C4::Budgets qw( GetBudgetHierarchy GetBudget CanUserUseBudget );
 
 use Koha::Acquisition::Booksellers;
-use Koha::DateUtils qw( output_pref dt_from_string );
+use Koha::DateUtils qw( dt_from_string );
 
 my $input          = CGI->new;
 my $booksellerid     = $input->param('booksellerid');
@@ -93,7 +93,6 @@ our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
         query           => $input,
         type            => 'intranet',
         flagsrequired   => { acquisition => 'order_receive' },
-        debug           => 1,
     }
 );
 
@@ -101,7 +100,6 @@ my $invoicenumber = $input->param('invoice');
 my $shipmentcost = $input->param('shipmentcost');
 my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
 my $shipmentdate = $input->param('shipmentdate');
-$shipmentdate and $shipmentdate = output_pref({ str => $shipmentdate, dateformat => 'iso', dateonly => 1 });
 
 if ( $op and $op eq 'new' ) {
     if ( C4::Context->preference('AcqWarnOnDuplicateInvoice') ) {
@@ -141,8 +139,8 @@ my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
 my @parcels = GetInvoices(
     supplierid => $booksellerid,
     invoicenumber => $code,
-    ( $datefrom ? ( shipmentdatefrom => output_pref({ dt => dt_from_string($datefrom), dateformat => 'iso' }) ) : () ),
-    ( $dateto   ? ( shipmentdateto   => output_pref({ dt => dt_from_string($dateto),   dateformat => 'iso' }) )    : () ),
+    ( $datefrom ? ( shipmentdatefrom => $datefrom ) : () ),
+    ( $dateto   ? ( shipmentdateto   => $dateto   ) : () ),
     order_by => $order
 );
 my $count_parcels = @parcels;