X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=0ec6b8a85c23bf5d4c536a4443591044762af55d;hb=115d9bb0740b874e6b68637db5847bac38f00996;hp=f42fc985a42073f669b900ad6904266ca32cf68c;hpb=752642dd833d795ac8d97bfe2fd6e6d97e3de496;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index f42fc985a..0ec6b8a85 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -36,6 +36,9 @@ #====================================================================== package Form; + +#use strict; + use Data::Dumper; use CGI; @@ -2074,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);