From aea283038fc2981dfc49b0185978be821a21c757 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 4 Jul 2007 10:01:53 +0000 Subject: [PATCH] Kosmetik. --- bin/mozilla/io.pl | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 1a018a5cb..db50d4ae2 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -307,33 +307,29 @@ sub display_row { # marge calculations my ($marge_font_start, $marge_font_end); + $form->{"lastcost_$i"} *= 1; + if ($real_sellprice && ($form->{"qty_$i"} * 1)) { - $form->{"marge_percent_$i"} = - ($real_sellprice - $form->{"lastcost_$i"}) * 100 / $real_sellprice; + $form->{"marge_percent_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * 100 / $real_sellprice; + $myconfig{"marge_percent_warn"} = 15 unless (defined($myconfig{"marge_percent_warn"})); - $myconfig{"marge_percent_warn"} = 15 - unless (defined($myconfig{"marge_percent_warn"})); if ($form->{"id_$i"} && - ($form->{"marge_percent_$i"} < - (1 * $myconfig{"marge_percent_warn"}))) { + ($form->{"marge_percent_$i"} < (1 * $myconfig{"marge_percent_warn"}))) { $marge_font_start = ""; - $marge_font_end = ""; + $marge_font_end = ""; } + } else { $form->{"marge_percent_$i"} = 0; } - $form->{"marge_absolut_$i"} = - ($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"}; - $form->{"marge_total"} += $form->{"marge_absolut_$i"}; - $form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"}; - $form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; - map { - $form->{"${_}_$i"} = - $form->format_amount(\%myconfig, $form->{"${_}_$i"}, - 2) - } qw(marge_absolut marge_percent); + $form->{"marge_absolut_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"}; + $form->{"marge_total"} += $form->{"marge_absolut_$i"}; + $form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"}; + $form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; + + map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(marge_absolut marge_percent); # convert " to " map { $form->{"${_}_$i"} =~ s/\"/"/g } -- 2.20.1