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; |
Auch abrufbar als: Unified diff
Beim Ausdruck von Angeboten / Anfragen / Aufträgen / Rechnungen wurde der Rabatt ohne Nachkommastellen berechnet und dargestellt.