From: Moritz Bunkus Date: Thu, 18 Mar 2021 11:17:55 +0000 (+0100) Subject: MT940: Multi-Line-Varianten von Tag 86 unterstützen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~422 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=429a7c2179e2c3c4fe9bfcbb52ebb22e55c8519a;p=kivitendo-erp.git MT940: Multi-Line-Varianten von Tag 86 unterstützen --- diff --git a/SL/MT940.pm b/SL/MT940.pm index 2fbbad696..dd965deea 100644 --- a/SL/MT940.pm +++ b/SL/MT940.pm @@ -37,15 +37,25 @@ sub parse { } }; + my ($active_field); foreach my $line (read_file($file_name)) { chomp $line; $line = Encode::decode('UTF-8', $line); $line =~ s{\r+}{}; $line_number++; + my $current_field; + if ($line =~ m{^:(\d+[a-z]*):}i) { + $current_field = $1; + $active_field = $1; + } + if (@lines && ($line =~ m{^\%})) { $lines[-1]->[0] .= substr($line, 1); + } elsif (@lines && ($active_field eq '86') && !$current_field) { + $lines[-1]->[0] .= $line; + } else { push @lines, [ $line, $line_number ]; }