X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDATEV.pm;h=e3cecef119d5cba52f407dcaa79dcc515f9e3fa1;hb=b1da1af530f16c240cd8090e060fc8680663bac9;hp=d0ca5b2a3850ce038fb5660b1521938dadf126da;hpb=05c6840d4fbb90cbe81e14427617793c45ba4714;p=kivitendo-erp.git diff --git a/SL/DATEV.pm b/SL/DATEV.pm index d0ca5b2a3..e3cecef11 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -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);