From 2819d504f3081d3a5ce9821ba8d85fab36d65af5 Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Fri, 1 Jun 2007 09:16:15 +0000 Subject: [PATCH] =?utf8?q?=C3=9Cberarbeitung=20der=20Ausgabe=20der=20Konte?= =?utf8?q?nansichten.=20Alle=20Buchungen=20-=20bis=20auf=20stornierte=20-?= =?utf8?q?=20werden=20gruppiert=20(je=20nach=20Sortierung)=20angezeigt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/CA.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/SL/CA.pm b/SL/CA.pm index 0c2a24f37..3df961307 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -247,7 +247,7 @@ sub all_transactions { @values = (); foreach my $id (@id) { - + # NOTE: Postgres is really picky about the order of implicit CROSS # JOINs with ',' if you alias the tables and want to use the # alias later in another JOIN. the alias you want to use has to @@ -266,7 +266,6 @@ sub all_transactions { $dpt_join . qq|WHERE | . $where . $dpt_where . $project . qq| AND ac.chart_id = ? | . - qq| AND ac.trans_id = a.id | . qq|UNION | . @@ -275,9 +274,9 @@ sub all_transactions { qq|FROM acc_trans ac, customer c, ar a | . $dpt_join . qq|WHERE | . $where . $dpt_where . $project . - qq| AND ac.chart_id = ? | . - qq| AND ac.trans_id = a.id | . - qq| AND a.customer_id = c.id | . + qq| AND ac.chart_id = ? | . + qq| AND NOT a.storno | . + qq| AND a.customer_id = c.id | . qq|UNION | . @@ -286,9 +285,9 @@ sub all_transactions { qq|FROM acc_trans ac, vendor v, ap a | . $dpt_join . qq|WHERE | . $where . $dpt_where . $project . - qq| AND ac.chart_id = ? | . - qq| AND ac.trans_id = a.id | . - qq| AND a.vendor_id = v.id |; + qq| AND ac.chart_id = ? | . + qq| AND NOT a.storno | . + qq| AND a.vendor_id = v.id |; push(@values, @where_values, @department_values, @project_values, $id, @@ -345,7 +344,7 @@ sub all_transactions { $union = qq|UNION ALL|; } - $query .= qq|ORDER BY | . $sortorder; + $query .= qq|ORDER BY | . $form->{sort}; $sth = prepare_execute_query($form, $dbh, $query, @values); $form->{CA} = []; -- 2.20.1