Revision 1ed2662d
Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
1007 | 1007 |
my ($dec) = ($sellprice =~ /\.(\d+)/); |
1008 | 1008 |
my $decimalplaces = max 2, length($dec); |
1009 | 1009 |
|
1010 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $form->{"discount_$i"} / 100 / $price_factor->{factor}, $decimalplaces); |
|
1011 |
my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $form->{"discount_$i"}) / 100 / $price_factor->{factor}, 2); |
|
1010 |
my $parsed_discount = $form->parse_amount($myconfig, $form->{"discount_$i"}); |
|
1011 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor}, $decimalplaces); |
|
1012 |
my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}, 2); |
|
1012 | 1013 |
my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2); |
1013 | 1014 |
$form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2); |
1014 | 1015 |
|
... | ... | |
1016 | 1017 |
|
1017 | 1018 |
$linetotal = ($linetotal != 0) ? $linetotal : ''; |
1018 | 1019 |
|
1019 |
push @{ $form->{discount} }, ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, $decimalplaces) : '';
|
|
1020 |
push @{ $form->{discount} }, ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, 2) : '';
|
|
1020 | 1021 |
push @{ $form->{p_discount} }, $form->{"discount_$i"}; |
1021 | 1022 |
|
1022 | 1023 |
$form->{ordtotal} += $linetotal; |
Auch abrufbar als: Unified diff
Beim Ausdruck von Angeboten / Anfragen / Aufträgen / Rechnungen wurde der Rabatt ohne Nachkommastellen berechnet und dargestellt.