X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fsepa.pl;h=0f5a242a8f5d241cae18422c251b5096fec27db2;hb=df41380a9c1150938985322c48ef20fe7f2cd98b;hp=2e45511c7bddda0e0294cab00de0910ca8319886;hpb=1206c3f6c69d774367856daa80d00f3369c62719;p=kivitendo-erp.git diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl index 2e45511c7..0f5a242a8 100755 --- a/bin/mozilla/sepa.pl +++ b/bin/mozilla/sepa.pl @@ -24,6 +24,7 @@ sub bank_transfer_add { my $form = $main::form; my $locale = $main::locale; my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor'; + my $vc_no = $form->{vc} eq 'customer' ? $::locale->text('VN') : $::locale->text('CN'); $form->{title} = $vc eq 'customer' ? $::locale->text('Prepare bank collection via SEPA XML') : $locale->text('Prepare bank transfer via SEPA XML'); @@ -56,6 +57,13 @@ sub bank_transfer_add { my $prefix = $translations{ $invoice->{language_id} } || $translations{default} || $::locale->text('Invoice'); $prefix .= ' ' unless $prefix =~ m/ $/; $invoice->{reference_prefix} = $prefix; + + # add c_vendor_id or v_vendor_id as a prefix if a entry exists + next unless $invoice->{vc_vc_id}; + + my $prefix_vc_number = $translations{ $invoice->{language_id} } || $translations{default} || $vc_no; + $prefix_vc_number .= ' ' unless $prefix_vc_number =~ m/ $/; + $invoice->{reference_prefix_vc} = ' ' . $prefix_vc_number unless $prefix_vc_number =~ m/^ /; } $form->header();