X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDATEV.pm;h=7f38c88c11fbb3a8e4a8f4fec8182318ec186ccd;hb=72be9c763f3b7f7df1fae4fe10011e45f9e2ad1d;hp=508ed958d50c0712d036e879b22aeb63231a5cb0;hpb=6a8787147ad643549eb26cb4f9a373b5b354b8b9;p=kivitendo-erp.git diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 508ed958d..7f38c88c1 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]; @@ -399,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); @@ -867,7 +868,7 @@ sub kne_buchungsexport { $kne_file->add_block($mandantenendsumme); $kne_file->flush(); - open(ED, "> $ed_filename") or die "can't open outputfile: $!\n"; + open(ED, ">", $ed_filename) or die "can't open outputfile: $!\n"; print(ED $kne_file->get_data()); close(ED); @@ -879,7 +880,7 @@ sub kne_buchungsexport { my $ev_header = &make_ev_header($form, $fileno); my $ev_filename = $export_path . $evfile; push(@filenames, $evfile); - open(EV, "> $ev_filename") or die "can't open outputfile: EV01\n"; + open(EV, ">", $ev_filename) or die "can't open outputfile: EV01\n"; print(EV $ev_header); foreach my $file (@ed_versionset) { @@ -921,7 +922,7 @@ sub kne_stammdatenexport { $filename++; my $ed_filename = $export_path . $filename; push(@filenames, $filename); - open(ED, "> $ed_filename") or die "can't open outputfile: $!\n"; + open(ED, ">", $ed_filename) or die "can't open outputfile: $!\n"; my $header = &make_kne_data_header($myconfig, $form, ""); $remaining_bytes -= length($header); @@ -941,7 +942,7 @@ sub kne_stammdatenexport { push @values, $form->{accnoto}; } - my $where_str = ' WHERE ' . join(' AND ', map { "($_)" } @where) if (scalar @where); + my $where_str = @where ? ' WHERE ' . join(' AND ', map { "($_)" } @where) : ''; my $query = qq|SELECT c.accno, c.description FROM chart c @@ -993,7 +994,7 @@ sub kne_stammdatenexport { my $ev_header = &make_ev_header($form, $fileno); my $ev_filename = $export_path . $evfile; push(@filenames, $evfile); - open(EV, "> $ev_filename") or die "can't open outputfile: EV01\n"; + open(EV, ">", $ev_filename) or die "can't open outputfile: EV01\n"; print(EV $ev_header); foreach my $file (@ed_versionset) {