From: Jan Büren Date: Thu, 19 Oct 2017 10:00:16 +0000 (+0200) Subject: DATEV-Struktur params und lib X-Git-Tag: release-3.5.4~665 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2f2a0f414c419c559beb3c07340e995eae589c19;hp=a8fb17eaa5b626f00321bfa6b661488849c736e5;p=kivitendo-erp.git DATEV-Struktur params und lib --- diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index 4dfa06b35..24e9fd2cd 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -7,6 +7,7 @@ use SL::DB::Datev; use Carp; use DateTime; +use Encode qw(decode); my @kivitendo_to_datev = ( @@ -205,9 +206,7 @@ my @kivitendo_to_datev = ( ); sub check_encoding { - use Encode qw( decode ); - # counter test: arabic doesnt work: ݐ - my $test = shift; + my ($test) = @_; return undef unless $test; if (eval { decode('Windows-1252', $test, Encode::FB_CROAK|Encode::LEAVE_SRC); @@ -218,7 +217,7 @@ sub check_encoding { } sub kivitendo_to_datev { - my $self = shift; + my ($self) = @_; my $entries = scalar (@kivitendo_to_datev); push @kivitendo_to_datev, { kivi_datev_name => 'not yet implemented' } for 1 .. (116 - $entries); @@ -347,6 +346,7 @@ Line 3 - n: must contain 116 fields, a smaller subset is mandatory. =item check_encoding Helper function, returns true if a string is not empty and cp1252 encoded +For example some arabic utf-8 like ݐ will return false =item generate_csv_header(from => 'YYYYDDMM', to => 'YYYYDDMM', locked => 0, first_day_of_fiscal_year => 'YYYYDDMM')