From 797ad4c506d8e96342249155ddde80361b5ff9f9 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 7 Jan 2009 13:43:14 +0000 Subject: [PATCH] =?utf8?q?Bei=20Kreditorenbuchungen=20die=20Umsatzsteuer-S?= =?utf8?q?teuerschl=C3=BCssel=20und=20bei=20Debitorenbuchungen=20die=20Vor?= =?utf8?q?steuer-Steuerschl=C3=BCssel=20nicht=20anzeigen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 22 +++++++++++++++++++--- bin/mozilla/ap.pl | 13 +++++++------ bin/mozilla/ar.pl | 13 +++++++------ 3 files changed, 33 insertions(+), 15 deletions(-) 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); diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 1adf6b317..24f5f245d 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -298,12 +298,13 @@ selectvendor } | map({ push(@old_project_ids, $form->{"project_id_$_"}) if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 0, - "old_id" => \@old_project_ids }, - "charts" => { "key" => "ALL_CHARTS", - "transdate" => $form->{transdate} }, - "taxcharts" => "ALL_TAXCHARTS"); + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }, + "charts" => { "key" => "ALL_CHARTS", + "transdate" => $form->{transdate} }, + "taxcharts" => { "key" => "ALL_TAXCHARTS", + "module" => "AP" },); map({ $_->{link_split} = [ split(/:/, $_->{link}) ]; } @{ $form->{ALL_CHARTS} }); diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 9320bfaf9..caf48362f 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -340,12 +340,13 @@ sub form_header { map({ push(@old_project_ids, $form->{"project_id_$_"}) if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 0, - "old_id" => \@old_project_ids }, - "charts" => { "key" => "ALL_CHARTS", - "transdate" => $form->{transdate} }, - "taxcharts" => "ALL_TAXCHARTS"); + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }, + "charts" => { "key" => "ALL_CHARTS", + "transdate" => $form->{transdate} }, + "taxcharts" => { "key" => "ALL_TAXCHARTS", + "module" => "AR" },); map({ $_->{link_split} = [ split(/:/, $_->{link}) ]; } @{ $form->{ALL_CHARTS} }); -- 2.20.1