X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FForm.pm;h=37451ad935df33c5a122bc40252953ac4a656fa2;hb=3b1eaa1a8b1265a0ecc5a27cf5d557d9e4f8ac46;hp=8e109cea7756218dccf5cfdc49ff0191c202744d;hpb=b8da8785c1b6d313518202acb307adfb50ebdb65;p=kivitendo-erp.git 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);