From: Moritz Bunkus Date: Wed, 2 Nov 2011 17:10:15 +0000 (+0100) Subject: Variablen in Druckvorlagen optional unformatiert ausgeben lassen X-Git-Tag: release-2.7.0beta1~157^2~8 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ac9bfb42f5de6eced6baaa0b571fdbb120c45569;p=kivitendo-erp.git Variablen in Druckvorlagen optional unformatiert ausgeben lassen --- diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index 9960908da..d29ec8f5c 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -125,10 +125,12 @@ sub substitute_vars { while ($text =~ /$self->{substitute_vars_re}/) { my ($tag_pos, $tag_len) = ($-[0], $+[0] - $-[0]); - my ($var, @options) = split(/\s+/, $1); + my ($var, @option_list) = split(/\s+/, $1); + my %options = map { ($_ => 1) } @option_list; my $value = $self->_get_loop_variable($var, 0, @indices); - $value = $self->format_string($value) unless (grep(/^NOESCAPE$/, @options)); + $value = $form->parse_amount({ numberformat => $::myconfig{output_numberformat} || $::myconfig{numberformat} }, $value) if $options{NOFORMAT}; + $value = $self->format_string($value) unless $options{NOESCAPE}; substr($text, $tag_pos, $tag_len, $value); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 2d23c76ae..62cdfdd7e 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1341,6 +1341,10 @@ sub print_form { $output_longdates = 1; } + # Store the output number format so that the template modules know + # how to parse the amounts back if requested. + $myconfig{output_numberformat} = $output_numberformat; + ($form->{employee}) = split /--/, $form->{employee}; # create the form variables