From: Bernd Bleßmann Date: Wed, 23 Oct 2019 09:48:53 +0000 (+0200) Subject: Form->prepare_for_printing: Einheiten übersetzen X-Git-Tag: release-3.5.6.1~447 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7ff6942c0add531c1e694575035271b4910ea751;p=kivitendo-erp.git Form->prepare_for_printing: Einheiten übersetzen --- diff --git a/SL/Form.pm b/SL/Form.pm index 59d69c37c..51483e631 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -3407,6 +3407,14 @@ sub prepare_for_printing { $self->reformat_numbers($output_numberformat, $precision, @{ $field_list }); } + # Translate units + if (($self->{language} // '') ne '') { + my $template_arrays = $self->{TEMPLATE_ARRAYS} || $self; + for my $idx (0..scalar(@{ $template_arrays->{unit} }) - 1) { + $template_arrays->{unit}->[$idx] = AM->translate_units($self, $self->{language}, $template_arrays->{unit}->[$idx], $template_arrays->{qty}->[$idx]) + } + } + $self->{template_meta} = { formname => $self->{formname}, language => SL::DB::Manager::Language->find_by_or_create(id => $self->{language_id} || undef),