$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"});
if $form->{"formel_$i"};
$column_data{ship} = !$form->{"id_$i"} ? '' : $form->format_amount_units('amount' => $form->{"ship_$i"} * 1,
'part_unit' => $form->{"partunit_$i"},
- 'max_places' => 2,);
+ 'conv_units' => 'convertible_not_smaller',
+ 'max_places' => 2);
# build in drop down list for pricesgroups
if ($form->{"prices_$i"}) {
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};