From 30d4e2f70ea5fe8c6457b862f13e5835953e9e5c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 2 May 2013 14:33:51 +0200 Subject: [PATCH] =?utf8?q?SEPA:=20Bei=20Einz=C3=BCgen=20Feld=20"MndtId"=20?= =?utf8?q?mit=20Kundennummer=20belegen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Anstelle von bisher Rechnugnsnummer. Merkblätter diverser Banken sagen dazu: > SEPA-Mandat: Die Mandatsreferenz dient in Verbindung mit der > Gläubiger-ID der eindeutigen Identifizierung eines SEPA-Mandats. Sie > wird vom Lastschrifteinreicher individuell für jedes SEPA-Mandat > vergeben (z.B. Vertrags-/Kundennummer). --- SL/SEPA.pm | 4 ++-- SL/SEPA/XML.pm | 2 +- bin/mozilla/sepa.pl | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/SEPA.pm b/SL/SEPA.pm index 73a333030..d31204e3b 100644 --- a/SL/SEPA.pm +++ b/SL/SEPA.pm @@ -178,7 +178,7 @@ sub retrieve_export { my ($columns, $joins); if ($params{details}) { - $columns = qq|, arap.invnumber, arap.invoice, arap.transdate AS reference_date, vc.name AS vc_name, c.accno AS chart_accno, c.description AS chart_description|; + $columns = qq|, arap.invnumber, arap.invoice, arap.transdate AS reference_date, vc.name AS vc_name, vc.${vc}number AS vc_number, c.accno AS chart_accno, c.description AS chart_description|; $joins = qq|LEFT JOIN ${arap} arap ON (sei.${arap}_id = arap.id) LEFT JOIN ${vc} vc ON (arap.${vc}_id = vc.id) LEFT JOIN chart c ON (sei.chart_id = c.id)|; @@ -398,7 +398,7 @@ sub post_payment { # Record the payment in acc_trans offsetting AR/AP. do_statement($form, @{ $handles{add_acc_trans} }, $orig_item->{"${arap}_id"}, $arap_chart_id, -1 * $mult * $orig_item->{amount}, $item->{execution_date}, '', $arap_chart_id); - do_statement($form, @{ $handles{add_acc_trans} }, $orig_item->{"${arap}_id"}, $orig_item->{chart_id}, $mult * $orig_item->{amount}, $item->{execution_date}, $orig_item->{reference}, + do_statement($form, @{ $handles{add_acc_trans} }, $orig_item->{"${arap}_id"}, $orig_item->{chart_id}, $mult * $orig_item->{amount}, $item->{execution_date}, $orig_item->{reference}, $orig_item->{chart_id}); # Update the invoice to reflect the new paid amount. diff --git a/SL/SEPA/XML.pm b/SL/SEPA/XML.pm index 35f116a35..90c77ec3d 100644 --- a/SL/SEPA/XML.pm +++ b/SL/SEPA/XML.pm @@ -223,7 +223,7 @@ sub to_xml { $xml->startTag('DrctDbtTx'); $xml->startTag('MndtRltdInf'); - $xml->dataElement('MndtId', $self->_restricted_identification_sepa2($transaction->get('reference'))); + $xml->dataElement('MndtId', $self->_restricted_identification_sepa2($transaction->get('company_number'))); $xml->dataElement('DtOfSgntr', $transaction->get('reference_date', 2010-12-02)); $xml->endTag('MndtRltdInf'); diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl index 518b9a8fc..18f48b2f5 100755 --- a/bin/mozilla/sepa.pl +++ b/bin/mozilla/sepa.pl @@ -511,6 +511,7 @@ sub bank_transfer_download_sepa_xml { 'dst_iban' => $item->{vc_iban}, 'dst_bic' => $item->{vc_bic}, 'company' => $item->{vc_name}, + 'company_number' => $item->{vc_number}, 'amount' => $item->{amount}, 'reference' => $item->{reference}, 'reference_date' => $item->{reference_date}, -- 2.20.1