From: Moritz Bunkus Date: Mon, 29 Jul 2013 14:19:50 +0000 (+0200) Subject: Artikelstammdatenmaske: bei "Erneuern" Fließkommazahlen exakt einmal parsen X-Git-Tag: release-3.1.0beta1~129 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=df0ca1fe6013573e9ff37f262018ec9a5318b4ea;p=kivitendo-erp.git Artikelstammdatenmaske: bei "Erneuern" Fließkommazahlen exakt einmal parsen Fixt #2341. --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index cfe6451d7..267c427b6 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1773,14 +1773,18 @@ sub update { # parse pricegroups. and no, don't rely on check_form for this... map { $form->{"price_$_"} = $form->parse_amount(\%myconfig, $form->{"price_$_"}) } 1 .. $form->{price_rows}; - $form->{sellprice} = $form->parse_amount(\%myconfig, $form->{sellprice}); + $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) for qw(sellprice listprice ve gv); + + if ($form->{item} eq 'part') { + $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) for qw(weight rop); + } # same for makemodel lastcosts # but parse_amount not necessary for assembly component lastcosts unless ($form->{item} eq "assembly") { map { $form->{"lastcost_$_"} = $form->parse_amount(\%myconfig, $form->{"lastcost_$_"}) } 1 .. $form->{"makemodel_rows"}; - }; - $form->{listprice} = $form->parse_amount(\%myconfig, $form->{listprice}); + $form->{lastcost} = $form->parse_amount(\%myconfig, $form->{lastcost}); + } if ($form->{item} eq "assembly") { my $i = $form->{assembly_rows}; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 0ca15d4e2..8f2882e04 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -669,11 +669,7 @@ sub check_form { my $count = 0; # remove any makes or model rows - if ($form->{item} eq 'part') { - map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } - qw(listprice sellprice lastcost weight rop); - - } elsif ($form->{item} eq 'assembly') { + if ($form->{item} eq 'assembly') { # fuer assemblies auskommentiert. seiteneffekte? ;-) wird die woanders benoetigt? #$form->{sellprice} = 0; @@ -706,10 +702,7 @@ sub check_form { $form->redo_rows(\@flds, \@a, $count, $form->{assembly_rows}); $form->{assembly_rows} = $count; - } elsif ($form->{item} eq 'service') { - map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice lastcost); - - } else { + } elsif ($form->{item} !~ m{^(?:part|service)$}) { remove_emptied_rows(1); $form->{creditremaining} -= &invoicetotal;