From: Moritz Bunkus Date: Thu, 26 Apr 2007 13:33:28 +0000 (+0000) Subject: Query-Vereinfachung wurde aus Versehen in r2296 committed. X-Git-Tag: release-2.4.3^2~434 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a0f1b42042cb4f7033d79244892647661803dadf;p=kivitendo-erp.git Query-Vereinfachung wurde aus Versehen in r2296 committed. --- diff --git a/SL/Form.pm b/SL/Form.pm index ef50f1dd6..da224ab74 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1928,7 +1928,7 @@ sub create_links { d.description AS department, e.name AS employee FROM $arap a - LEFT JOIN $table c ON (a.${table}_id = c.id) + JOIN $table c ON (a.${table}_id = c.id) LEFT JOIN employee e ON (e.id = a.employee_id) LEFT JOIN department d ON (d.id = a.department_id) WHERE a.id = ?|; @@ -1945,15 +1945,14 @@ sub create_links { # now get the account numbers $query = qq|SELECT c.accno, c.description, c.link, c.taxkey_id, tk.tax_id - FROM chart c - LEFT JOIN taxkeys tk ON (tk.chart_id = c.id) + FROM chart c, taxkeys tk WHERE c.link LIKE ? + AND ( tk.chart_id = c.id OR c.link LIKE '%_tax%') + AND (NOT tk.chart_id = c.id OR NOT c.link LIKE '%_tax%') AND (tk.id = (SELECT id FROM taxkeys WHERE taxkeys.chart_id = c.id AND startdate <= $transdate ORDER BY startdate DESC LIMIT 1) OR c.link LIKE '%_tax%') ORDER BY c.accno|; - dump_query(0, "wuff", $query, '%$module%'); - $sth = $dbh->prepare($query); do_statement($self, $sth, $query, "%$module%");