X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FUSTVA.pm;h=af189660276330b4811752743c9d5c3f921271ae;hb=5d0d3d8188b690453f84f7d3d829a58f55f21f78;hp=8b3ca5f96c4bdd1ddb7ff6361547e27f955ba180;hpb=981b670e29449b7ebffe6c910439a05e6613ec6b;p=kivitendo-erp.git diff --git a/SL/USTVA.pm b/SL/USTVA.pm index 8b3ca5f96..af1896602 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -595,9 +595,9 @@ sub ustva { $form->{"86r"} = $form->{"861"}; $form->{"97r"} = $form->{"971"}; $form->{"93r"} = $form->{"931"}; - $form->{"Z43"} = $form->{"51r"}+ $form->{"86r"} + + $form->{"Z43"} = $form->{"511"}+ $form->{"861"} + $form->{"36"} + $form->{"80"} + - $form->{"97r"}+ $form->{"93r"} + + $form->{"971"}+ $form->{"931"} + $form->{"96"} + $form->{"98"}; $form->{"Z45"} = $form->{"Z43"}; $form->{"Z53"} = $form->{"Z43"}; @@ -638,6 +638,7 @@ sub get_accounts_ustva { my $glwhere = ""; my $subwhere = ""; my $ARwhere = ""; + my $arwhere = ""; my $item; if ($fromdate) { @@ -646,13 +647,13 @@ sub get_accounts_ustva { $glwhere = " AND ac.transdate >= '$fromdate'"; $ARwhere .= " AND acc.transdate >= '$fromdate'"; $where .= " AND ac.transdate >= '$fromdate'"; + } } if ($todate) { $where .= " AND ac.transdate <= '$todate'"; $ARwhere .= " AND acc.transdate <= '$todate'"; - $arwhere .= " AND ac.transdate <= '$todate'"; $subwhere .= " AND transdate <= '$todate'"; } @@ -695,10 +696,11 @@ sub get_accounts_ustva { c.pos_ustva FROM acc_trans ac JOIN chart c ON (c.id = ac.chart_id) - JOIN ar ON (ar.id = ac.trans_id) + --JOIN ar ON (ar.id = ac.trans_id) where 1=1 - $arwhere + -- Here no where, please. All Transactions ever should be + -- testet if they are paied in the USTVA report period. GROUP BY c.pos_ustva UNION @@ -715,7 +717,7 @@ sub get_accounts_ustva { SELECT trans_id FROM acc_trans JOIN chart ON (chart_id = id) - WHERE link LIKE '%AP_paid%' + WHERE link LIKE '%AP_amount%' $subwhere )