From 91bfa82dacd3335c2534d84c52bf30b627ce95d1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 1 Mar 2007 08:17:12 +0000 Subject: [PATCH] Projektnummer nicht doppelt und schon gar nicht mit einem Subquery abholen. --- SL/GL.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/GL.pm b/SL/GL.pm index 43b4c53d6..527b69b73 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -638,8 +638,8 @@ sub transaction { # retrieve individual rows $query = qq|SELECT c.accno, t.taxkey AS accnotaxkey, a.amount, a.memo, - a.transdate, a.cleared, a.project_id, p.projectnumber,(SELECT p.projectnumber FROM project p - WHERE a.project_id = p.id) AS projectnumber, a.taxkey, t.rate AS taxrate, t.id, (SELECT c1.accno FROM chart c1, tax t1 WHERE t1.id=t.id AND c1.id=t.chart_id) AS taxaccno, (SELECT tk.tax_id FROM taxkeys tk WHERE tk.chart_id =a.chart_id AND tk.startdate<=a.transdate ORDER BY tk.startdate desc LIMIT 1) AS tax_id + a.transdate, a.cleared, a.project_id, p.projectnumber, + a.taxkey, t.rate AS taxrate, t.id, (SELECT c1.accno FROM chart c1, tax t1 WHERE t1.id=t.id AND c1.id=t.chart_id) AS taxaccno, (SELECT tk.tax_id FROM taxkeys tk WHERE tk.chart_id =a.chart_id AND tk.startdate<=a.transdate ORDER BY tk.startdate desc LIMIT 1) AS tax_id FROM acc_trans a JOIN chart c ON (c.id = a.chart_id) LEFT JOIN project p ON (p.id = a.project_id) -- 2.20.1