From: Moritz Bunkus Date: Fri, 2 Oct 2009 10:10:44 +0000 (+0200) Subject: Das Umformatieren der Daten und Zahlen beim Ausdruck wegen der Umstellung auf TEMPLAT... X-Git-Tag: release-2.6.1beta1~260 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/5701782ce5c29c5ef4244088b895cf8d13ee016e?ds=inline Das Umformatieren der Daten und Zahlen beim Ausdruck wegen der Umstellung auf TEMPLATE_ARRAYS gefixt. --- diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index c8d7d6bb2..f03911c32 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -351,6 +351,14 @@ sub format_dates { $dateformat = $myconfig{"dateformat"} unless ($dateformat); foreach my $idx (@indices) { + if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) { + for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) { + $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = + $locale->reformat_date(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i], + $dateformat, $longformat); + } + } + next unless (defined($form->{$idx})); if (!ref($form->{$idx})) { @@ -364,13 +372,6 @@ sub format_dates { $dateformat, $longformat); } } - if (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY") { - for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) { - $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = - $locale->reformat_date(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i], - $dateformat, $longformat); - } - } } $lxdebug->leave_sub(); @@ -385,6 +386,12 @@ sub reformat_numbers { if (!$numberformat || ($numberformat eq $myconfig{"numberformat"})); foreach my $idx (@indices) { + if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) { + for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) { + $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = $form->parse_amount(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i]); + } + } + next unless (defined($form->{$idx})); if (!ref($form->{$idx})) { @@ -402,6 +409,12 @@ sub reformat_numbers { $myconfig{"numberformat"} = $numberformat; foreach my $idx (@indices) { + if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) { + for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) { + $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = $form->format_amount(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i], $places); + } + } + next unless (defined($form->{$idx})); if (!ref($form->{$idx})) {