X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=f3e92dc94c27878685050db2a2bf2f7e4f10217b;hb=61ab3c630bf655d54cb44f70f871eed5879f9693;hp=51326c4b1843cd87d55143a7ffb0a7c9be9afe6c;hpb=6376d92f01632a5dccf74ef58d17738779741e4e;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 51326c4b1..f3e92dc94 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -372,7 +372,7 @@ sub display_row { $form->{invsubtotal} += $linetotal; # Benutzerdefinierte Variablen für Waren/Dienstleistungen/Erzeugnisse - _render_custom_variables_inputs(ROW2 => \@ROW2, row => $i); + _render_custom_variables_inputs(ROW2 => \@ROW2, row => $i, part_id => $form->{"id_$i"}); push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, error => $form->{"row_error_$i"}, }; } @@ -895,7 +895,7 @@ sub order { $script =~ s|.pl$||; $locale = new Locale($language, $script); - map { $form->{"select$_"} = "" } ($form->{vc}, currency); + map { $form->{"select$_"} = "" } ($form->{vc}, "currency"); $currency = $form->{currency}; @@ -1449,10 +1449,9 @@ sub print_form { } if ($form->{language} ne "") { - map({ $form->{"unit"}->[$_] = - AM->translate_units($form, $form->{"language"}, - $form->{"unit"}->[$_], $form->{"qty"}->[$_]); } - (0..scalar(@{$form->{"unit"}}) - 1)); + my $template_arrays = $form->{TEMPLATE_ARRAYS} || $form; + map { $template_arrays->{unit}->[$_] = AM->translate_units($form, $form->{language}, $template_arrays->{unit}->[$_], $template_arrays->{qty}->[$_]); } (0..scalar(@{ $template_arrays->{unit} }) - 1); + $form->{language} = "_" . $form->{language}; } @@ -1980,6 +1979,10 @@ sub _render_custom_variables_inputs { } foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { + $cvar->{valid} = $params{part_id} + ? CVar->get_custom_variables_validity(config_id => $cvar->{id}, trans_id => $params{part_id}) + : 1; + $cvar->{value} = $form->{"ic_cvar_" . $cvar->{name} . "_$params{row}"}; } @@ -1991,7 +1994,7 @@ sub _render_custom_variables_inputs { my $num_visible_cvars = 0; foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { my $description = ''; - if ($cvar->{flag_editable}) { + if ($cvar->{flag_editable} && $cvar->{valid}) { $num_visible_cvars++; $description = $cvar->{description} . ' '; }