From: Niclas Zimmermann Date: Tue, 4 Sep 2012 10:01:00 +0000 (+0200) Subject: Rundung in Verkaufsrechnung X-Git-Tag: release-3.0.0beta1~251^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e2b15672816b9ceac6a8c70178a4c83781f301c1;p=kivitendo-erp.git Rundung in Verkaufsrechnung In der Verkaufsrechnung wird jetzt beim EK Preis und beim Verkaufspreis die gleicht Anzahl an Nachkommastellen angezeigt. --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index e25f963a8..7e1970bbe 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -248,7 +248,10 @@ sub display_row { $column_data{"unit"} = AM->unit_select_html($all_units, "unit_$i", $this_unit, $form->{"id_$i"} ? $form->{"unit_$i"} : undef); # / unit ending +#count the max of decimalplaces of sellprice and lastcost, so the same number of decimalplaces +#is shown for lastcost and sellprice. my $decimalplaces = ($form->{"sellprice_$i"} =~ /\.(\d+)/) ? max 2, length $1 : 2; + $decimalplaces = ($form->{"lastcost_$i"} =~ /\.(\d+)/) ? max $decimalplaces, length $1 : $decimalplaces; my $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || 1; my $discount = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100 / $price_factor, 2); @@ -377,7 +380,7 @@ sub display_row {  %s |, $marge_color, $locale->text('Ertrag'),$form->{"marge_absolut_$i"}, $form->{"marge_percent_$i"}, $locale->text('LP'), $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2), - $locale->text('EK'), $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, 2) } + $locale->text('EK'), $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces) } if $form->{"id_$i"} && ($form->{type} =~ /^sales_/ || $form->{type} =~ /invoice/ || $form->{type} =~ /^credit_note$/ ) && !$is_delivery_order; $form->{"listprice_$i"} = $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2)