From 2f2a0f414c419c559beb3c07340e995eae589c19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 19 Oct 2017 12:00:16 +0200 Subject: [PATCH] DATEV-Struktur params und lib --- SL/DATEV/CSV.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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') -- 2.20.1