Revision 1ed2662d
Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
212 | 212 |
my ($dec) = ($sellprice =~ /\.(\d+)/); |
213 | 213 |
my $decimalplaces = max 2, length($dec); |
214 | 214 |
|
215 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $form->{"discount_$i"} / 100 / $price_factor->{factor}, $decimalplaces); |
|
216 |
my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $form->{"discount_$i"}) / 100 / $price_factor->{factor}, 2); |
|
215 |
my $parsed_discount = $form->parse_amount($myconfig, $form->{"discount_$i"}); |
|
216 |
my $discount = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor}, $decimalplaces); |
|
217 |
my $linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor}, 2); |
|
217 | 218 |
my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2); |
218 | 219 |
$form->{"netprice_$i"} = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2); |
219 | 220 |
|
... | ... | |
221 | 222 |
|
222 | 223 |
$linetotal = ($linetotal != 0) ? $linetotal : ''; |
223 | 224 |
|
224 |
push @{ $form->{discount} }, ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, $decimalplaces) : '';
|
|
225 |
push @{ $form->{discount} }, ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, 2) : '';
|
|
225 | 226 |
push @{ $form->{p_discount} }, $form->{"discount_$i"}; |
226 | 227 |
|
227 | 228 |
$form->{total} += $linetotal; |
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.