From 557beaacf48471b594d47c3d019d1c90a4d66812 Mon Sep 17 00:00:00 2001 From: Rolf Fluehmann Date: Wed, 31 Jul 2013 13:32:41 +0200 Subject: [PATCH] new number-format 1'000.00 Conflicts: bin/mozilla/am.pl --- SL/Form.pm | 12 +++++------- bin/mozilla/am.pl | 4 ++-- templates/webpages/csv_import/form.html | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 099a6736e..50c66d4d3 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -945,17 +945,15 @@ sub parse_amount { return 0; } - if ( ($myconfig->{numberformat} eq '1.000,00') - || ($myconfig->{numberformat} eq '1000,00')) { + if ($myconfig->{numberformat} eq '1,000.00') { + $amount =~ s/,//g; + } elsif ($myconfig->{numberformat} eq '1.000,00') { $amount =~ s/\.//g; - $amount =~ s/,/\./g; - } - - if ($myconfig->{numberformat} eq "1'000.00") { + } elsif ($myconfig->{numberformat} eq "1'000.00") { $amount =~ s/\'//g; } - $amount =~ s/,//g; + $amount =~ s/,/\./g; $main::lxdebug->leave_sub(2); diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 56c48f3a9..ad17f3123 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -750,7 +750,7 @@ sub language_header { $::form->header; print $::form->parse_html_template('am/language_header', { - numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ], + numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00" ], dateformats => [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], }); @@ -816,7 +816,7 @@ sub config { _build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); _build_cfg_options('timeformat', qw(hh:mm hh:mm:ss)); - _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); + _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00")); my @formats = (); if ($::lx_office_conf{print_templates}->{opendocument} diff --git a/templates/webpages/csv_import/form.html b/templates/webpages/csv_import/form.html index c40c563d4..12162f6a7 100644 --- a/templates/webpages/csv_import/form.html +++ b/templates/webpages/csv_import/form.html @@ -168,7 +168,7 @@ [%- LxERP.t8('Number Format') %]: - [% L.select_tag('settings.numberformat', ['1.000,00', '1000,00', '1,000.00', '1000.00'], default = SELF.profile.get('numberformat'), style = 'width: 300px') %] + [% L.select_tag('settings.numberformat', ['1.000,00', '1000,00', '1,000.00', '1000.00', "1'000.00"], default = SELF.profile.get('numberformat'), style = 'width: 300px') %] -- 2.20.1