X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FRP.pm;h=f8fd245a831695ee7322f1d2653de7fd6e5b2003;hb=ff834130a049023b678b62032d31392a24082d07;hp=d536bf88a64bb2f81aa56d157c1a066f7b6e7e0e;hpb=94e596e55cef6b9ef9b80b5a4dba8204e0c29c9f;p=kivitendo-erp.git diff --git a/SL/RP.pm b/SL/RP.pm index d536bf88a..f8fd245a8 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -609,7 +609,7 @@ sub get_accounts_g { if ($form->{method} eq 'cash') { $subwhere .= " AND (transdate >= $fromdate)"; $glwhere = " AND (ac.transdate >= $fromdate)"; - $prwhere = " AND (ar.transdate >= $fromdate)"; + $prwhere = " AND (a.transdate >= $fromdate)"; } else { $where .= " AND (ac.transdate >= $fromdate)"; } @@ -619,7 +619,7 @@ sub get_accounts_g { $todate = conv_dateq($todate); $subwhere .= " AND (transdate <= $todate)"; $where .= " AND (ac.transdate <= $todate)"; - $prwhere .= " AND (ar.transdate <= $todate)"; + $prwhere .= " AND (a.transdate <= $todate)"; } if ($department_id) { @@ -666,13 +666,11 @@ sub get_accounts_g { WHERE $where $dpt_where $glwhere AND NOT ((c.link = 'AR') OR (c.link = 'AP')) $project - - $project_union - GROUP BY c.$category + GROUP BY c.$category |; if ($form->{project_id}) { - $project_union = qq| + $query .= qq| UNION SELECT SUM(ac.sellprice * ac.qty * chart_category_to_sgn(c.category)) AS amount, c.$category