Konfigurationsort für viele Flags ist Abschnitt 'features', nicht 'system'
[kivitendo-erp.git] / bin / mozilla / sepa.pl
index 7971b7d..9f9f31a 100755 (executable)
@@ -8,6 +8,7 @@ use SL::BankAccount;
 use SL::Chart;
 use SL::CT;
 use SL::Form;
+use SL::GenericTranslations;
 use SL::ReportGenerator;
 use SL::SEPA;
 use SL::SEPA::XML;
@@ -41,6 +42,15 @@ sub bank_transfer_add {
 
   my $bank_account_label_sub = sub { $locale->text('Account number #1, bank code #2, #3', $_[0]->{account_number}, $_[0]->{bank_code}, $_[0]->{bank}) };
 
+  my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx');
+  my %translations     = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list };
+
+  foreach my $invoice (@{ $invoices }) {
+    my $prefix                    = $translations{ $invoice->{language_id} } || $translations{default} || $::locale->text('Invoice');
+    $prefix                      .= ' ' unless $prefix =~ m/ $/;
+    $invoice->{reference_prefix}  = $prefix;
+  }
+
   $form->header();
   print $form->parse_html_template('sepa/bank_transfer_add',
                                    { 'INVOICES'           => $invoices,
@@ -238,6 +248,7 @@ sub bank_transfer_list {
                        'attachment_basename'   => $locale->text('banktransfers') . strftime('_%Y%m%d', localtime time),
     );
   $report->set_options_from_form();
+  $locale->set_numberformat_wo_thousands_separator(\%::myconfig) if lc($report->{options}->{output_format}) eq 'csv';
 
   $report->set_columns(%column_defs);
   $report->set_column_order(@columns);
@@ -470,7 +481,7 @@ sub bank_transfer_download_sepa_xml {
 
   my $sepa_xml   = SL::SEPA::XML->new('company'     => $myconfig->{company},
                                       'creditor_id' => $myconfig->{sepa_creditor_id},
-                                      'src_charset' => $main::dbcharset || 'ISO-8859-15',
+                                      'src_charset' => $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15',
                                       'message_id'  => $message_id,
                                       'grouped'     => 1,
                                       'collection'  => $vc eq 'customer',