$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)";
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};
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 {
</td>
<td>
[% 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") %]
</td>
<td>
[% temp = "project_id_"_ i %]