From: Moritz Bunkus Date: Fri, 3 Dec 2010 15:09:21 +0000 (+0100) Subject: Bei SEPA-Überweisungen Verwendungszweke mit "Rechnung" (übersetzt) präfixen X-Git-Tag: release-2.6.2beta1~73^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7ad942750f0294bdbbbb6f0693bea17dcc75f18b;p=kivitendo-erp.git Bei SEPA-Überweisungen Verwendungszweke mit "Rechnung" (übersetzt) präfixen --- diff --git a/SL/SEPA.pm b/SL/SEPA.pm index 38341eccd..9a2978314 100644 --- a/SL/SEPA.pm +++ b/SL/SEPA.pm @@ -22,7 +22,7 @@ sub retrieve_open_invoices { my $query = qq| SELECT ${arap}.id, ${arap}.invnumber, ${arap}.${vc}_id, ${arap}.amount AS invoice_amount, ${arap}.invoice, - vc.name AS vcname, ${arap}.duedate as duedate, + vc.name AS vcname, vc.language_id, ${arap}.duedate as duedate, COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' AS vc_bank_info_ok, diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl index 7971b7d9d..f6041fbcd 100755 --- a/bin/mozilla/sepa.pl +++ b/bin/mozilla/sepa.pl @@ -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, diff --git a/templates/webpages/sepa/bank_transfer_add.html b/templates/webpages/sepa/bank_transfer_add.html index 0954d1dbc..56d36d042 100644 --- a/templates/webpages/sepa/bank_transfer_add.html +++ b/templates/webpages/sepa/bank_transfer_add.html @@ -73,7 +73,7 @@ [% LxERP.format_amount(invoice.invoice_amount, -2) %] [% LxERP.format_amount(invoice.open_amount, -2) %] [% invoice.duedate %] - +