From df0ca1fe6013573e9ff37f262018ec9a5318b4ea Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 29 Jul 2013 16:19:50 +0200 Subject: [PATCH] =?utf8?q?Artikelstammdatenmaske:=20bei=20"Erneuern"=20Fli?= =?utf8?q?e=C3=9Fkommazahlen=20exakt=20einmal=20parsen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixt #2341. --- bin/mozilla/ic.pl | 10 +++++++--- bin/mozilla/io.pl | 11 ++--------- 2 files changed, 9 insertions(+), 12 deletions(-) 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; -- 2.20.1