X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a599a88144d9c90c2d1c717204ad775b721bf736..54cadc0bfed7183c19b160a4320cf04fda1e955b:/SL/USTVA.pm diff --git a/SL/USTVA.pm b/SL/USTVA.pm index b01ebac9a..122a17a16 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -691,7 +691,7 @@ sub get_accounts_ustva { SUM( ac.amount * -- Bezahlt / Rechnungssumme ( - SELECT SUM(acc.amount), t.rate, c.accno + SELECT SUM(acc.amount) FROM acc_trans acc INNER JOIN chart c ON (acc.chart_id = c.id AND c.link like '%AR_paid%') @@ -699,13 +699,12 @@ sub get_accounts_ustva { 1=1 $ARwhere AND acc.trans_id = ac.trans_id - ) - / + ) / ( SELECT amount FROM ar WHERE id = ac.trans_id ) ) AS amount, - tk.pos_ustva + tk.pos_ustva, t.rate, c.accno FROM acc_trans ac LEFT JOIN chart c ON (c.id = ac.chart_id) LEFT JOIN ar ON (ar.id = ac.trans_id) @@ -875,6 +874,12 @@ sub get_accounts_ustva { # Dont rely on dates of taxkeys $corr = 1; $form->{"81"} += $ref->{amount}; + } elsif ($ref->{rate} == 0.07) { + # pos_ustva says 5, but rate says 7 + # see comment above: + # Dont rely on dates of taxkeys + $corr = 1; + $form->{"86"} += $ref->{amount}; } else {die ("No valid tax rate for pos 35" . Dumper($ref)); } } # USTVA Pos 36 (Steuerkonten)