From: Stephan Köhler Date: Sat, 26 Nov 2005 16:07:11 +0000 (+0000) Subject: Merge von 639,640 aus unstable: Rundungsfehler nach erneuern X-Git-Tag: release-2.2.0~81 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e44cbe168d7cdaedc952a23102d8c834bd3a2993;p=kivitendo-erp.git Merge von 639,640 aus unstable: Rundungsfehler nach erneuern -Bugfix: Angebot (Auch bei Rechnung): Menge mit Kommastelle, z.B 6,876, beim Erneuern wird die Menge gerundet und ohne Nachkommastelle angezeigt. In der Vorgaengerversion ging das noch. Der Positions-Preis wird korrekt berechnet, nur die Anzeige der Menge scheint das Problem zu sein -Bugfix: svn 639 - Auch die entsprechenden Buchungen sind falsch gewesen. Angepasst für Verkauf: Rechnungen, Aufträge, Angebote und Einkauf: Einkaufsrechnung, Lieferantenauftrag, Preisanfrage. --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 0fe78fd2a..c0ab3dc9a 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -254,10 +254,13 @@ sub display_row { qq||; } + (my $qty_dec) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $qty_dec = length $qty_dec; + $column_data{qty} = - qq|format_amount(\%myconfig, $form->{"qty_$i"}, 0) - . qq|>|; + qq|format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec) + .qq|>|; $column_data{ship} = qq|format_amount(\%myconfig, $form->{"ship_$i"}) diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index caa8a0e6d..ee0e813a4 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -176,8 +176,12 @@ print STDERR "ir.pl-prepare_invoice\n"; $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + $form->{"qty_$i"} = - $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1)); + $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1), $dec_qty); $form->{rowcount} = $i; } @@ -823,7 +827,7 @@ sub update { $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); $form->{"qty_$i"} = - $form->format_amount(\%myconfig, $form->{"qty_$i"}); + $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); } &display_form; diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index ae8c7748f..c6afe176c 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -210,7 +210,12 @@ sub prepare_invoice { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, + $dec_qty); map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit partnotes); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 6c410c159..cf6bd40b2 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -215,7 +215,11 @@ sub prepare_order { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit); @@ -233,7 +237,10 @@ sub prepare_order { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit); @@ -973,7 +980,7 @@ sub update { $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); $form->{"qty_$i"} = - $form->format_amount(\%myconfig, $form->{"qty_$i"}); + $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); # get pricegroups for parts IS->get_pricegroups_for_parts(\%myconfig, \%$form); @@ -1857,7 +1864,10 @@ sub invoice { $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); - $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit); @@ -2356,7 +2366,7 @@ sub display_ship_receive { qq|$description|; $column_data{qty} = qq|| - . $form->format_amount(\%myconfig, $form->{"qty_$i"}) + . $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty) . qq||; $column_data{ship} = qq|{warehouse_id}>$ref->{warehouse} |; $column_data{qty} = qq|{qty}>| - . $form->format_amount(\%myconfig, $ref->{qty}) + . $form->format_amount(\%myconfig, $ref->{qty}, $dec_qty) . qq||; $column_data{transfer} = qq||;