From 960160dc2ab886f3a478e7207b3b7952fc414865 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 20 Feb 2007 09:12:26 +0000 Subject: [PATCH] =?utf8?q?Fix=20f=C3=BCr=20SQL-Fehler,=20dass=20transdate?= =?utf8?q?=20mehrdeutig=20ist,=20wenn=20auch=20nach=20Projekten=20gefilter?= =?utf8?q?t=20wird.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/RP.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/SL/RP.pm b/SL/RP.pm index 89e81359c..4c817f8a1 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -918,6 +918,7 @@ sub get_accounts_g { my $project; my $where = "1 = 1"; my $glwhere = ""; + my $prwhere = ""; my $subwhere = ""; my $item; @@ -925,6 +926,7 @@ sub get_accounts_g { if ($form->{method} eq 'cash') { $subwhere .= " AND transdate >= '$fromdate'"; $glwhere = " AND ac.transdate >= '$fromdate'"; + $prwhere = " AND ar.transdate >= '$fromdate'"; } else { $where .= " AND ac.transdate >= '$fromdate'"; } @@ -933,6 +935,7 @@ sub get_accounts_g { if ($todate) { $where .= " AND ac.transdate <= '$todate'"; $subwhere .= " AND transdate <= '$todate'"; + $prwhere .= " AND ar.transdate <= '$todate'"; } if ($department_id) { @@ -1025,8 +1028,7 @@ sub get_accounts_g { JOIN parts p ON (ac.parts_id = p.id) JOIN chart c on (p.income_accno_id = c.id) $dpt_join - -- use transdate from subwhere - WHERE 1 = 1 $subwhere + WHERE 1 = 1 $prwhere AND c.category = 'I' $dpt_where AND ac.trans_id IN @@ -1050,7 +1052,7 @@ sub get_accounts_g { JOIN parts p ON (ac.parts_id = p.id) JOIN chart c on (p.expense_accno_id = c.id) $dpt_join - WHERE 1 = 1 $subwhere + WHERE 1 = 1 $prwhere AND c.category = 'E' $dpt_where AND ac.trans_id IN @@ -1104,8 +1106,7 @@ sub get_accounts_g { JOIN parts p ON (ac.parts_id = p.id) JOIN chart c on (p.income_accno_id = c.id) $dpt_join - -- use transdate from subwhere - WHERE 1 = 1 $subwhere + WHERE 1 = 1 $prwhere AND c.category = 'I' $dpt_where $project @@ -1120,7 +1121,7 @@ sub get_accounts_g { JOIN parts p ON (ac.parts_id = p.id) JOIN chart c on (p.expense_accno_id = c.id) $dpt_join - WHERE 1 = 1 $subwhere + WHERE 1 = 1 $prwhere AND c.category = 'E' $dpt_where $project -- 2.20.1