X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5d44361c86fe35b3fb0485f2dbface7cf6d73b1d..797ad4c506d8e96342249155ddde80361b5ff9f9:/SL/Form.pm diff --git a/SL/Form.pm b/SL/Form.pm index 8e109cea7..37451ad93 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2077,11 +2077,27 @@ sub _get_charts { sub _get_taxcharts { $main::lxdebug->enter_sub(); - my ($self, $dbh, $key) = @_; + my ($self, $dbh, $params) = @_; + + my $key = "all_taxcharts"; + my @where; + + if (ref $params eq 'HASH') { + $key = $params->{key} if ($params->{key}); + if ($params->{module} eq 'AR') { + push @where, 'taxkey NOT IN (8, 9, 18, 19)'; + + } elsif ($params->{module} eq 'AP') { + push @where, 'taxkey NOT IN (1, 2, 3, 12, 13)'; + } + + } elsif ($params) { + $key = $params; + } - $key = "all_taxcharts" unless ($key); + my $where = ' WHERE ' . join(' AND ', map { "($_)" } @where) if (@where); - my $query = qq|SELECT * FROM tax ORDER BY taxkey|; + my $query = qq|SELECT * FROM tax $where ORDER BY taxkey|; $self->{$key} = selectall_hashref_query($self, $dbh, $query);