X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=524ccdb7e3233a07834a2ae5d748f454aba44b3f;hb=74c7135dd76391b581476daffe240f2829493744;hp=236bd186b8580a1b570aef78c9947bdf4e438ec8;hpb=9ed219326c93dba30f4170ed5ac174f195c7c173;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 236bd186b..524ccdb7e 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -235,9 +235,8 @@ sub display_row { $decimalplaces = max 2, length $1; $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || 1; - $discount = $form->round_amount($form->{"sellprice_$i"} * $form->{"discount_$i"} / 100, $decimalplaces); - $linetotal = $form->round_amount(($form->{"sellprice_$i"} - $discount) / $price_factor, $decimalplaces); - $linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2); + $discount = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * $form->{"discount_$i"} / 100 / $price_factor, 2); + $linetotal = $form->round_amount($form->{"qty_$i"} * $form->{"sellprice_$i"} * (100 - $form->{"discount_$i"}) / 100 / $price_factor, 2); $column_data{runningnumber} = $cgi->textfield(-name => "runningnumber_$i", -size => 5, -value => $i); # HuT $column_data{partnumber} = $cgi->textfield(-name => "partnumber_$i", -size => 12, -value => $form->{"partnumber_$i"}); @@ -1892,7 +1891,7 @@ sub _update_ship { next if (!$ship_entry || ($ship_entry->{qty} <= 0)); my $rowqty = - $form->parse_amount(\%myconfig, $form->{"qty_$i"}) + ($form->{simple_save} ? $form->{"qty_$i"} : $form->parse_amount(\%myconfig, $form->{"qty_$i"})) * $all_units->{$form->{"unit_$i"}}->{factor} / $all_units->{$form->{"partunit_$i"}}->{factor};