From: Moritz Bunkus Date: Fri, 20 Jan 2017 13:21:06 +0000 (+0100) Subject: Kreditorenbuchungen: nur zur Kontenkategorie passende Steuerschlüsselauswahl anbieten X-Git-Tag: release-3.5.4~1671 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6e594d280bad75ff06bd9bfb4ffdb61f159036b5;p=kivitendo-erp.git Kreditorenbuchungen: nur zur Kontenkategorie passende Steuerschlüsselauswahl anbieten --- diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index dc02d137b..ca88e920c 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -324,11 +324,6 @@ sub form_header { $charts{$item->{accno}} = $item; } - my %taxcharts = (); - foreach my $item (@{ $form->{ALL_TAXCHARTS} }) { - $taxcharts{$item->{id}} = $item; - } - my $follow_up_vc = $form->{vendor}; $follow_up_vc =~ s/--.*?//; my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; @@ -348,8 +343,9 @@ sub form_header { my ($default_taxchart, $taxchart_to_use); my $amount_chart_id = $form->{"AP_amount_chart_id_$i"} || $default_ap_amount_chart_id; my $chart_has_changed = $::form->{"previous_AP_amount_chart_id_$i"} && ($amount_chart_id != $::form->{"previous_AP_amount_chart_id_$i"}); + my @taxcharts = GL->get_active_taxes_for_chart($amount_chart_id, $transdate); - foreach my $item ( GL->get_active_taxes_for_chart($amount_chart_id, $transdate) ) { + foreach my $item (@taxcharts) { my $key = $item->id . "--" . $item->rate; $first_taxchart //= $item; $default_taxchart = $item if $item->{is_default}; @@ -360,6 +356,7 @@ sub form_header { my $selected_taxchart = $taxchart_to_use->id . '--' . $taxchart_to_use->rate; $form->{"selected_taxchart_$i"} = $selected_taxchart; $form->{"AP_amount_chart_id_$i"} = $amount_chart_id; + $form->{"taxcharts_$i"} = \@taxcharts; } $form->{taxchart_value_title_sub} = sub { diff --git a/templates/webpages/ap/form_header.html b/templates/webpages/ap/form_header.html index 8c8a17333..9623a712b 100644 --- a/templates/webpages/ap/form_header.html +++ b/templates/webpages/ap/form_header.html @@ -202,7 +202,8 @@ [% temp = 'selected_taxchart_'_ i %] - [% L.select_tag('taxchart_'_ i, ALL_TAXCHARTS, value_title_sub = \taxchart_value_title_sub, default = $temp) %] + [% taxcharts = 'taxcharts_' _ i %] + [% L.select_tag('taxchart_'_ i, $taxcharts, value_title_sub = \taxchart_value_title_sub, default = $temp, style="width: 250px") %] [% temp = "project_id_"_ i %]