From c8d21015d7e94fcf8852985b8b2312db3676b034 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 18 Apr 2007 14:39:06 +0000 Subject: [PATCH] Geladene Buchungen zeigten nach r2145 keine Steuern mehr an. Das Query zum Abfragen der Kontodaten war falsch verkuerzt worden. --- SL/Form.pm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 1a6fa4be8..85370dd40 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1886,17 +1886,17 @@ 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) - WHERE (c.link LIKE ?) AND (tk.chart_id = c.id) AND NOT (c.link LIKE '%_tax%') - ORDER BY c.accno|; + $query = qq|SELECT c.accno, c.description, c.link, c.taxkey_id, tk.tax_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|; $sth = $dbh->prepare($query); - do_statement($self, $sth, $query, "%" . $module . "%"); + do_statement($self, $sth, $query, "%$module%"); $self->{accounts} = ""; while ($ref = $sth->fetchrow_hashref(NAME_lc)) { -- 2.20.1