X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5bbb2def9ab6c1055f36d3aa75a060a2de9905e7..d22f2fe4829e8334eb28a17c8b45c19a3357d5f2:/SL/DATEV/CSV.pm diff --git a/SL/DATEV/CSV.pm b/SL/DATEV/CSV.pm index 38c7ad80c..65f6cf0d1 100644 --- a/SL/DATEV/CSV.pm +++ b/SL/DATEV/CSV.pm @@ -134,6 +134,7 @@ my @kivitendo_to_datev = ( my ($text) = @_; check_encoding($text); }, valid_check => sub { return 1 if $::instance_conf->get_datev_export_format eq 'cp1252'; my ($text) = @_; check_encoding($text); }, + formatter => sub { my ($input) = @_; return substr($input, 0, 60) }, }, # pos 14 { kivi_datev_name => 'not yet implemented', @@ -520,10 +521,6 @@ sub check_encoding { } } -sub _kivitendo_to_datev { - @kivitendo_to_datev, ({ kivi_datev_name => 'not yet implemented' }) x (116 - @kivitendo_to_datev); -} - sub header { my ($self) = @_; @@ -561,7 +558,7 @@ sub header { push @header, [ @header_row_1 ]; # second header row, just the column names - push @header, [ map { $_->{csv_header_name} } _kivitendo_to_datev() ]; + push @header, [ map { $_->{csv_header_name} } @kivitendo_to_datev ]; return \@header; } @@ -570,7 +567,6 @@ sub lines { my ($self) = @_; my (@array_of_datev, @warnings); - my @csv_columns = _kivitendo_to_datev(); foreach my $row (@{ $self->datev_lines }) { my @current_datev_row; @@ -578,7 +574,7 @@ sub lines { # 1. check all datev_lines and see if we have a defined value # 2. if we don't have a defined value set a default if exists # 3. otherwise die - foreach my $column (@csv_columns) { + foreach my $column (@kivitendo_to_datev) { if ($column->{kivi_datev_name} eq 'not yet implemented') { push @current_datev_row, ''; next;