X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/93f06915a1f2444585aeb8ed32f849d08da7b07a..a9bbf9c652f83d910b1bd4dc256adf10ea115817:/SL/DATEV/CSV.pm diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index 5c1e7ec44..c93241b2a 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -3,7 +3,7 @@ package SL::DATEV::CSV; use strict; use Carp; use DateTime; -use Encode qw(decode); +use Encode qw(encode); use Scalar::Util qw(looks_like_number); use SL::DB::Datev; @@ -56,7 +56,7 @@ my @kivitendo_to_datev = ( }, { kivi_datev_name => 'not yet implemented', - sv_header_name => t8('Base Transaction Value'), + csv_header_name => t8('Base Transaction Value'), }, { kivi_datev_name => 'not yet implemented', @@ -119,7 +119,7 @@ my @kivitendo_to_datev = ( type => 'Value', }, { - kivi_datev_name => 'buchungsbes', + kivi_datev_name => 'buchungstext', csv_header_name => t8('Posting Text'), max_length => 60, type => 'Text', @@ -231,10 +231,10 @@ my @kivitendo_to_datev = ( input_check => sub { my ($ustid) = @_; return 1 if ('' eq $ustid); - $ustid =~ s{[\s.]+}{}g; + $ustid =~ s{\s+}{}g; return ($ustid =~ m/^CH|^[A-Z]{2}\w{5,13}$/); }, - formatter => sub { my ($input) = @_; $input =~ s/[\s.]+//g; return $input }, + formatter => sub { my ($input) = @_; $input =~ s/\s//g; return $input }, valid_check => sub { my ($ustid) = @_; return 1 if ('' eq $ustid); @@ -260,7 +260,7 @@ sub check_encoding { my ($test) = @_; return undef unless $test; if (eval { - decode('Windows-1252', $test, Encode::FB_CROAK|Encode::LEAVE_SRC); + encode('Windows-1252', $test, Encode::FB_CROAK|Encode::LEAVE_SRC); 1 }) { return 1;