From 7933b6bd762c5bac0f0a6bc401ede33c30ece67b Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Fri, 18 Nov 2005 01:52:17 +0000 Subject: [PATCH] Bugfix: svn 639 - Auch die entsprechenden Buchungen sind falsch gewesen. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Angepasst für Verkauf: Rechnungen, Aufträge, Angebote und Einkauf: Einkaufsrechnung, Lieferantenauftrag, Preisanfrage. --- bin/mozilla/ir.pl | 8 ++++++-- bin/mozilla/is.pl | 7 ++++++- bin/mozilla/oe.pl | 22 ++++++++++++++++------ 3 files changed, 28 insertions(+), 9 deletions(-) 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||; -- 2.20.1