From be418943f8d231dab72bdb1849cc7d0dfdc5ae06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 3 Sep 2014 07:49:42 +0200 Subject: [PATCH] if-Abfrage eindeutiger geschrieben und Variablenname klarer definiert --- SL/RP.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/RP.pm b/SL/RP.pm index 358d71e34..fd58de602 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -884,7 +884,7 @@ sub trial_balance { my $glwhere = ''; my $glsumwhere = ''; my $tofrom; - my ($fromdate, $todate, $hotfix_query); + my ($fromdate, $todate, $fetch_accounts_before_from); if ($form->{fromdate} || $form->{todate}) { if ($form->{fromdate}) { @@ -924,7 +924,7 @@ sub trial_balance { # get all entries before fromdate, which are not yet fetched # TODO dpt_where_without_arapgl and project - $hotfix_query = qq|SELECT c.accno, c.description, c.category, SUM(ac.amount) AS amount + $fetch_accounts_before_from = qq|SELECT c.accno, c.description, c.category, SUM(ac.amount) AS amount FROM acc_trans ac JOIN chart c ON (c.id = ac.chart_id) WHERE 1 = 1 AND (ac.transdate <= $fromdate) AND (ac.transdate >= (SELECT date_trunc('YEAR', | . $fromdate . qq|::date))) AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) AND (NOT ac.cb_transaction OR ac.cb_transaction IS NULL) @@ -988,8 +988,8 @@ sub trial_balance { } $sth->finish; - if (! $form->{method} eq "cash") { - $sth = prepare_execute_query($form, $dbh, $hotfix_query); + if ($form->{method} ne "cash") { + $sth = prepare_execute_query($form, $dbh, $fetch_accounts_before_from); while ($ref = $sth->fetchrow_hashref("NAME_lc")) { $trb{ $ref->{accno} }{description} = $ref->{description}; $trb{ $ref->{accno} }{charttype} = 'A'; -- 2.20.1