Revision 21717dcd
Von Moritz Bunkus vor etwa 16 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
1011 | 1011 |
my $decimalplaces = max 2, length($dec); |
1012 | 1012 |
|
1013 | 1013 |
my $parsed_discount = $form->parse_amount($myconfig, $form->{"discount_$i"}); |
1014 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor}, $decimalplaces); |
|
1015 |
my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}, 2); |
|
1014 |
my $linetotal_exact = $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}; |
|
1015 |
my $linetotal = $form->round_amount($linetotal_exact, 2); |
|
1016 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor} - ($linetotal - $linetotal_exact), |
|
1017 |
$decimalplaces); |
|
1016 | 1018 |
my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2); |
1017 | 1019 |
$form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2); |
1018 | 1020 |
|
Auch abrufbar als: Unified diff
Bei Berechnung des absoluten Rabattes den Rundungsfehler mit einbeziehen.