From: Philip Reetz Date: Tue, 15 Nov 2005 09:04:57 +0000 (+0000) Subject: Fehler bei der Umwandlung von Angeboten in Auftraege, Preise mit nur einer Nachkommas... X-Git-Tag: release-2.4.0^2~465 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2ceb6719379a2825dfd3f2ea41c94eb7ec06a491;p=kivitendo-erp.git Fehler bei der Umwandlung von Angeboten in Auftraege, Preise mit nur einer Nachkommastelle wurden falsch formatiert --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 8cbe24456..4f71b2818 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -82,7 +82,6 @@ use Data::Dumper; sub display_row { $lxdebug->enter_sub(); my $numrows = shift; -print STDERR "io.pl-display_row\n"; if ($lizenzen && $form->{vc} eq "customer") { if ($form->{type} =~ /sales_order/) { @column_index = (runningnumber, partnumber, description, ship, qty); @@ -263,10 +262,8 @@ print STDERR "io.pl-display_row\n"; - #print (STDERR "io.pl---111-i-$i", Dumper($form->{PRICES})); # build in dragdrop for pricesgroups if ($form->{"prices_$i"}) { - print STDERR " YES prices\n"; $price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, 2); $column_data{sellprice_drag} = @@ -274,12 +271,10 @@ print STDERR "io.pl-display_row\n"; $column_data{sellprice} = qq||; } else { - print STDERR " NO prices\n"; # for last row and report # set pricegroup dragdrop from report menu if ($form->{"sellprice_$i"} != 0) { -print STDERR " HIER NOCH FÜR RECHNUNGSAUFRUFE\n"; -print (STDERR "sellprice_$i ", Dumper($form->{"sellprice_$i"}), " pricegroup_id_$i ", Dumper($form->{"pricegroup_id_$i"})); + Dumper($form->{"pricegroup_id_$i"})); $prices = qq|\n|; @@ -303,7 +298,6 @@ print (STDERR "sellprice_$i ", Dumper($form->{"sellprice_$i"}), " pricegroup_i $decimalplaces) . qq|>|; } -#print (STDERR "io.pl---555-i-$i", Dumper($form->{"price_old_$i"})); $column_data{discount} = qq|format_amount(\%myconfig, $form->{"discount_$i"}) @@ -426,11 +420,9 @@ sub set_pricegroup { $prices = ''; $price = 0; foreach $item (@{ $form->{PRICES}{ $j } }) { -# print STDERR "-VOR PREIS--$item->{price}--PREISGRUOP-$item->{pricegroup_id}\n"; $price = $form->round_amount($myconfig, $item->{price},5); $price = $form->format_amount($myconfig, $item->{price},2); $price = $item->{price}; -# print STDERR "-NACH PREIS--$price--PREISGRUOP-$item->{pricegroup_id}\n"; $pricegroup_id = $item->{pricegroup_id}; $pricegroup = $item->{pricegroup}; # build dragdrop for pricegroups @@ -438,7 +430,6 @@ sub set_pricegroup { qq|\n|; $len += 1; -# print STDERR "prices---$prices\n"; # set new selectedpricegroup_id and prices for "Preis" if ($item->{selected}) { $form->{"pricegroup_old_$j"} = $pricegroup_id; @@ -456,7 +447,6 @@ sub set_pricegroup { sub select_item { $lxdebug->enter_sub(); -print STDERR "io.pl-select_item\n"; @column_index = qw(ndx partnumber description onhand sellprice); $column_data{ndx} = qq| |; @@ -509,10 +499,8 @@ print STDERR "io.pl-select_item\n"; map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description unit); #sk tradediscount -print STDERR "TRADEDISCOUNT $ref->{sellprice}\n"; $ref->{sellprice} = $form->round_amount($ref->{sellprice} * (1 - $form->{tradediscount}), 2); -print STDERR "TRADEDISCOUNT $ref->{sellprice}\n"; $column_data{ndx} = qq||; $column_data{partnumber} = @@ -594,7 +582,6 @@ print STDERR "TRADEDISCOUNT $ref->{sellprice}\n"; sub item_selected { $lxdebug->enter_sub(); -print STDERR "io.pl-item_selected\n"; # replace the last row with the checked row $i = $form->{rowcount}; $i = $form->{assembly_rows} if ($form->{item} eq 'assembly'); @@ -833,7 +820,6 @@ sub display_form { sub check_form { $lxdebug->enter_sub(); -print STDERR "io.pl-check_form\n"; my @a = (); my $count = 0; my @flds = ( @@ -994,7 +980,6 @@ sub invoicetotal { sub validate_items { $lxdebug->enter_sub(); -print STDERR "io.pl-validate_items\n"; # check if items are valid if ($form->{rowcount} == 1) { &update; @@ -1017,7 +1002,6 @@ sub order { $form->{ordnumber} = $form->{invnumber}; map { delete $form->{$_} } qw(id printed emailed queued); - if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') { $form->{title} = $locale->text('Add Purchase Order'); $form->{vc} = 'vendor'; @@ -1235,7 +1219,6 @@ sub send_email { sub print_options { $lxdebug->enter_sub(); -print STDERR "io.pl-print_options\n"; $form->{sendmode} = "attachment"; $form->{copies} = 3 unless $form->{copies}; @@ -1711,7 +1694,6 @@ sub print_form { sub customer_details { $lxdebug->enter_sub(); -print STDERR "io.pl-customer_details\n"; IS->customer_details(\%myconfig, \%$form); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index dbcc5fdf7..6c410c159 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -115,6 +115,7 @@ sub order_links { # retrieve order/quotation $form->{webdav} = $webdav; + # set jscalendar $form->{jscalendar} = $jscalendar; @@ -220,6 +221,23 @@ sub prepare_order { qw(partnumber description unit); $form->{rowcount} = $i; } + } elsif ($form->{rowcount}) { + for my $i (1 .. $form->{rowcount}) { + $form->{"discount_$i"} = + $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100); + + ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/); + $dec = length $dec; + $decimalplaces = ($dec > 2) ? $dec : 2; + + $form->{"sellprice_$i"} = + $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, + $decimalplaces); + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); + + map { $form->{"${_}_$i"} =~ s/\"/"/g } + qw(partnumber description unit); + } } $lxdebug->leave_sub(); @@ -987,6 +1005,8 @@ sub update { } } } + + $lxdebug->leave_sub(); }