Bug 16474: Standardize spelling of EDIFACT
[koha-ffzg.git] / acqui / invoice.pl
index 026fd13..08e3ee8 100755 (executable)
@@ -36,6 +36,8 @@ use C4::Acquisition;
 use C4::Budgets;
 
 use Koha::Acquisition::Bookseller;
+use Koha::Acquisition::Currencies;
+use Koha::DateUtils;
 use Koha::Misc::Files;
 
 my $input = new CGI;
@@ -76,14 +78,12 @@ elsif ( $op && $op eq 'reopen' ) {
     }
 }
 elsif ( $op && $op eq 'mod' ) {
-    my $shipmentdate       = $input->param('shipmentdate');
-    my $billingdate        = $input->param('billingdate');
     my $shipmentcost       = $input->param('shipmentcost');
     my $shipment_budget_id = $input->param('shipment_budget_id');
     ModInvoice(
         invoiceid             => $invoiceid,
-        shipmentdate          => C4::Dates->new($shipmentdate)->output("iso"),
-        billingdate           => C4::Dates->new($billingdate)->output("iso"),
+        shipmentdate          => output_pref( { str => scalar $input->param('shipmentdate'), dateformat => 'iso', dateonly => 1 } ),
+        billingdate           => output_pref( { str => scalar $input->param('billingdate'),  dateformat => 'iso', dateonly => 1 } ),
         shipmentcost          => $shipmentcost,
         shipmentcost_budgetid => $shipment_budget_id
     );
@@ -92,7 +92,7 @@ elsif ( $op && $op eq 'mod' ) {
     } elsif ($input->param('close')) {
         CloseInvoice($invoiceid);
     } elsif ($input->param('merge')) {
-        my @sources = $input->param('merge');
+        my @sources = $input->multi_param('merge');
         MergeInvoices($invoiceid, \@sources);
         defined($invoice_files) && $invoice_files->MergeFileRecIds(@sources);
     }
@@ -113,7 +113,6 @@ my $details = GetInvoiceDetails($invoiceid);
 my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $details->{booksellerid} });
 my @orders_loop = ();
 my $orders = $details->{'orders'};
-my $qty_total;
 my @foot_loop;
 my %foot;
 my $total_quantity = 0;
@@ -179,7 +178,7 @@ $template->param(
     total_gste_shipment => sprintf( $format, $total_gste + $details->{shipmentcost}),
     total_gsti_shipment => sprintf( $format, $total_gsti + $details->{shipmentcost}),
     invoiceincgst    => $bookseller->{invoiceincgst},
-    currency         => GetCurrency()->{currency},
+    currency         => Koha::Acquisition::Currencies->get_active,
     budgets_loop     => \@budgets_loop,
 );