X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FDATEV.pm;h=9c617dbb8a6809b67f63dde69e7835fd627599de;hb=e7530c83690d28dd9b1633c2e06062a092d9c8c9;hp=c2549dc7f2e4f869d76daa4ebde77fa7c7ce6aac;hpb=43550a3d3b924a75703d06ab297d05109c06cb37;p=kivitendo-erp.git
diff --git a/SL/DATEV.pm b/SL/DATEV.pm
index c2549dc7f..9c617dbb8 100644
--- a/SL/DATEV.pm
+++ b/SL/DATEV.pm
@@ -314,16 +314,12 @@ sub get_transactions {
$blubb{'amount'} =
$form->round_amount(($i->[$j]->{'amount'} * $test * -1), 2);
- #print(STDERR $test, " Taxrate\n\n");
$blubb{'umsatz'} =
abs($form->round_amount(($i->[$j]->{'amount'} * $test), 2)) * $ml;
$i->[$j]->{'umsatz'} =
abs($form->round_amount(($i->[$j]->{'amount'} * $test), 2)) * $ml;
- #print(STDERR $i->[$j]->{'umsatz'}, " Steuer Umsatz\n");
- #print(STDERR $i->[$j]->{'amount'}, " Steuer Betrag\n");
- #print(STDERR $blubb{'umsatz'}, " Umsatz NOTSPLIT\n");
push @{ $splits[$g] }, \%blubb;
push @{ $splits[$g] }, $i->[$j];
push @{ $form->{DATEV} }, \@{ $splits[$g] };
@@ -333,7 +329,6 @@ sub get_transactions {
}
}
if (abs($absumsatz) > 0.01) {
- print(STDERR $absumsatz, "ABSAUMSATZ\n");
$form->error("Datev-Export fehlgeschlagen!");
}
} else {
@@ -593,7 +588,7 @@ sub kne_buchungsexport {
my $evfile = "EV01";
my @ed_versionsets;
my $fileno = 0;
-
+
$form->header;
print qq|
@@ -621,8 +616,8 @@ sub kne_buchungsexport {
$remaining_bytes -= length($header);
while (scalar(@{ $form->{DATEV} }) > 0) {
- $transaction = shift @{ $form->{DATEV} };
- $trans_lines = scalar(@{$transaction});
+ $transaction = shift @{ $form->{DATEV} };
+ $trans_lines = scalar(@{$transaction});
$counter++;
if (($counter % 500) == 0) {
print("$counter ");
@@ -648,8 +643,14 @@ sub kne_buchungsexport {
'ß' => 'sz');
for (my $i = 0; $i < $trans_lines; $i++) {
- if (abs($transaction->[$i]->{'umsatz'}) > abs($umsatz)) {
- $umsatz = $transaction->[$i]->{'umsatz'};
+ if ($trans_lines == 2) {
+ if (abs($transaction->[$i]->{'amount'}) > abs($umsatz)) {
+ $umsatz = $transaction->[$i]->{'amount'};
+ }
+ } else {
+ if (abs($transaction->[$i]->{'umsatz'}) > abs($umsatz)) {
+ $umsatz = $transaction->[$i]->{'umsatz'};
+ }
}
if ($transaction->[$i]->{'datevautomatik'}) {
$datevautomatik = 1;
@@ -828,7 +829,7 @@ sub kne_buchungsexport {
print(EV $ed_versionset[$file]);
}
close(EV);
-print qq|
Done.
+ print qq|
Done.