From ebbd278c2a66d0ba3165a2c42c07a85d174d3cda Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 1 Feb 2011 11:13:11 +0100 Subject: [PATCH] =?utf8?q?Revert=20von=20"Berichte=20->=20GuV,=20BWA=20(ge?= =?utf8?q?t=5Faccounts=5Fg)=20und=20Berichte=20->=20Bilanz=20(get=5Faccoun?= =?utf8?q?ts)=20k=C3=B6nnen=20jeweils=20nach=20E=C3=9CR=20oder=20Bilanz=20?= =?utf8?q?unterschieden=20werden."?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix zu Bug 1582. Die Joins sind leicht unterschiedlich, und nötig für Abteilungen. Die Bedenken bzgl. conv_i sind aber berechtigt, und so umgesetzt. --- SL/RP.pm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/SL/RP.pm b/SL/RP.pm index 84dd73e22..d875fb162 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -346,12 +346,10 @@ sub get_accounts { } } else { # if ($form->{method} eq 'cash') - # ich sehe keinen sinn das nochmal explizit ohne conv_i aufzurufen - # bitte prüfen und löschen jan 15.11.2009 - # if ($department_id) { - # $dpt_join = qq| JOIN dpt_trans t ON (t.trans_id = ac.trans_id) |; - # $dpt_where = qq| AND t.department_id = $department_id |; - # } + if ($department_id) { + $dpt_join = qq| JOIN dpt_trans t ON (t.trans_id = ac.trans_id) |; + $dpt_where = qq| AND t.department_id = | . conv_i($department_id); + } $query = qq| SELECT c.accno, sum(ac.amount) AS amount, c.description, c.category @@ -597,10 +595,10 @@ sub get_accounts_g { } } else { # if ($form->{method} eq 'cash') - # s.o. jan 15.11.2009 -# if ($department_id) { -# ($dpt_join, $dpt_where) = sql_department($department_id); -# } + if ($department_id) { + $dpt_join = qq| JOIN dpt_trans t ON (t.trans_id = ac.trans_id) |; + $dpt_where = qq| AND (t.department_id = | . conv_i($department_id, 'NULL') . qq|) |; + } $query = qq| SELECT sum(ac.amount * chart_category_to_sgn(c.category)) AS amount, c.$category -- 2.20.1