X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCA.pm;h=8122b9d4eeecab9497b2176a93c533793c739565;hb=8815371268e0e1f627835d5f8344f04730cbf0af;hp=4453a9fd6b9568ff5acec224eb6b3116f8c4bd8d;hpb=72539cb39a3d19f930a8e0e41e46bf41afe9a8f1;p=kivitendo-erp.git diff --git a/SL/CA.pm b/SL/CA.pm index 4453a9fd6..8122b9d4e 100644 --- a/SL/CA.pm +++ b/SL/CA.pm @@ -42,7 +42,7 @@ sub all_accounts { my ($self, $myconfig, $form) = @_; - my $amount = (); + my %amount; # connect to database my $dbh = $form->dbconnect($myconfig); @@ -65,7 +65,7 @@ sub all_accounts { $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - my $gifi = (); + my %gifi; while (my ($accno, $description) = $sth->fetchrow_array) { $gifi{$accno} = $description; } @@ -141,31 +141,14 @@ sub all_transactions { if ($form->{todate}) { $fromto .= " AND ac.transdate <= '$form->{todate}'"; $subwhere .= " AND transdate <= '$form->{todate}'"; + $glwhere .= " AND ac.transdate <= '$form->{todate}'"; } - if ($form->{eur}) { - $AR_PAID = qq|AND ac.trans_id IN - ( - SELECT trans_id - FROM acc_trans - JOIN chart ON (chart_id = id) - WHERE link LIKE '%AR_paid%' - $subwhere - )|; - $AP_PAID = qq|AND ac.trans_id IN - ( - SELECT trans_id - FROM acc_trans - JOIN chart ON (chart_id = id) - WHERE link LIKE '%AP_paid%' - $subwhere - )|; - } else { - $where .= $fromto; - $AR_PAID = ""; - $AP_PAID = ""; - $glwhere = ""; # note! gl will be aliased as "a" later... - } + + $where .= $fromto; + $AR_PAID = ""; + $AP_PAID = ""; + $glwhere = ""; # note! gl will be aliased as "a" later... my $sortorder = join ', ', $form->sort_columns(qw(transdate reference description)); my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE: q|'0'|;