X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fsepa.pl;h=6fb9907d2e58ba13793f64ffd6f35258a8869f5f;hb=85c4af4a97e002a6ec7804c7fb28d3c4c0972398;hp=e7ca5ecd455677aaa9e49ea0684e7b259f409412;hpb=66e2fdcc4f89a4f13c77f6e44f2969fd46aa7aba;p=kivitendo-erp.git diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl index e7ca5ecd4..6fb9907d2 100755 --- a/bin/mozilla/sepa.pl +++ b/bin/mozilla/sepa.pl @@ -110,11 +110,14 @@ sub bank_transfer_create { my ($vc_bank_info); my $error_message; + my @bank_columns = qw(iban bic); + push @bank_columns, qw(mandator_id mandate_date_of_signature) if $vc eq 'customer'; + if ($form->{confirmation}) { $vc_bank_info = { map { $_->{id} => $_ } @{ $form->{vc_bank_info} || [] } }; foreach my $info (values %{ $vc_bank_info }) { - if (any { !$info->{$_} } qw(iban bic)) { + if (any { !$info->{$_} } @bank_columns) { $error_message = $locale->text('The bank information must not be empty.'); last; } @@ -143,7 +146,7 @@ sub bank_transfer_create { } else { foreach my $bank_transfer (@bank_transfers) { - foreach (qw(iban bic)) { + foreach (@bank_columns) { $bank_transfer->{"vc_${_}"} = $vc_bank_info->{ $bank_transfer->{vc_id} }->{$_}; $bank_transfer->{"our_${_}"} = $bank_account->{$_}; } @@ -506,6 +509,10 @@ sub bank_transfer_download_sepa_xml { my ($yy, $mm, $dd) = $locale->parse_date($myconfig, $item->{reference_date}); $item->{reference_date} = sprintf '%04d-%02d-%02d', $yy, $mm, $dd; $mandator_id = $item->{mandator_id}; + if ($item->{mandate_date_of_signature}) { + ($yy, $mm, $dd) = $locale->parse_date($myconfig, $item->{mandate_date_of_signature}); + $item->{mandate_date_of_signature} = sprintf '%04d-%02d-%02d', $yy, $mm, $dd; + } } $sepa_xml->add_transaction({ 'src_iban' => $item->{our_iban}, @@ -519,7 +526,8 @@ sub bank_transfer_download_sepa_xml { 'mandator_id' => $mandator_id, 'reference_date' => $item->{reference_date}, 'execution_date' => $requested_execution_date, - 'end_to_end_id' => $item->{end_to_end_id} }); + 'end_to_end_id' => $item->{end_to_end_id}, + 'date_of_signature' => $item->{mandate_date_of_signature}, }); } my $xml = $sepa_xml->to_xml();