X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDATEV.pm;h=e3cecef119d5cba52f407dcaa79dcc515f9e3fa1;hb=417cc3a7e5d4a96713b71b1d723196bddeeb01cc;hp=eacda097db0b474970d6b5930caf199bb56ec11a;hpb=b2945bf61775161f9ce9be9bdbd106ad44247a14;p=kivitendo-erp.git diff --git a/SL/DATEV.pm b/SL/DATEV.pm index eacda097d..e3cecef11 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -26,7 +26,8 @@ package DATEV; -use List::Util qw(max); +use utf8; +use strict; use SL::DBUtils; use SL::DATEV::KNEFile; @@ -34,10 +35,9 @@ use SL::Taxkeys; use Data::Dumper; use File::Path; +use List::Util qw(max); use Time::HiRes qw(gettimeofday); -use strict; - sub _get_export_path { $main::lxdebug->enter_sub(); @@ -58,7 +58,7 @@ sub get_path_for_download_token { my $path; if ($token =~ m|^(\d+)-(\d+)-(\d+)$|) { - $path = "${main::userspath}/datev-export-${1}-${2}-${3}"; + $path = $::lx_office_conf{paths}->{userspath} . "/datev-export-${1}-${2}-${3}"; } $main::lxdebug->leave_sub(); @@ -84,7 +84,7 @@ sub get_download_token_for_path { sub clean_temporary_directories { $main::lxdebug->enter_sub(); - foreach my $path (glob "${main::userspath}/datev-export-*") { + foreach my $path (glob($::lx_office_conf{paths}->{userspath} . "/datev-export-*")) { next unless (-d $path); my $mtime = (stat($path))[9]; @@ -386,6 +386,7 @@ sub _get_transactions { ORDER BY trans_id, acc_trans_id|; my $sth = prepare_execute_query($form, $dbh, $query); + $form->{DATEV} = []; my $counter = 0; while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { @@ -398,8 +399,9 @@ sub _get_transactions { my $count = $ref->{amount}; my $firstrun = 1; + my $subcent = abs($count) < 0.02; - while (abs($count) > 0.01 || $firstrun) { + while (abs($count) > 0.01 || $firstrun || ($subcent && abs($count) > 0.005)) { my $ref2 = $sth->fetchrow_hashref("NAME_lc"); last unless ($ref2); @@ -776,14 +778,14 @@ sub kne_buchungsexport { my $taxkey = 0; my $charttax = 0; my ($haben, $soll); - my $iconv = $main::locale->{iconv_iso8859}; - my %umlaute = ($iconv->convert('ä') => 'ae', - $iconv->convert('ö') => 'oe', - $iconv->convert('ü') => 'ue', - $iconv->convert('Ä') => 'Ae', - $iconv->convert('Ö') => 'Oe', - $iconv->convert('Ü') => 'Ue', - $iconv->convert('ß') => 'sz'); + my $iconv = $::locale->{iconv_utf8}; + my %umlaute = ($iconv->convert('ä') => 'ae', + $iconv->convert('ö') => 'oe', + $iconv->convert('ü') => 'ue', + $iconv->convert('Ä') => 'Ae', + $iconv->convert('Ö') => 'Oe', + $iconv->convert('Ü') => 'Ue', + $iconv->convert('ß') => 'sz'); for (my $i = 0; $i < $trans_lines; $i++) { if ($trans_lines == 2) { if (abs($transaction->[$i]->{'amount'}) > abs($umsatz)) {