Revision 1ee0a247
Von G. Richardson vor fast 13 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
341 | 341 |
$form->{"marge_percent_$i"} = 0; |
342 | 342 |
|
343 | 343 |
my $marge_color; |
344 |
my $real_sellprice = $linetotal; |
|
344 |
my $real_sellprice; |
|
345 |
if ( $form->{taxincluded} and $form->{"qty_$i"} * 1 and $form->{$form->{"taxaccounts_$i"} . "_rate"} * 1) { |
|
346 |
# if we use taxincluded we need to calculate the marge from the net_value |
|
347 |
# all the marge calculations are based on linetotal which we need to |
|
348 |
# convert to net first |
|
349 |
|
|
350 |
# there is no direct form value for the tax_rate of the item, but |
|
351 |
# form->{taxaccounts_$i} gives the tax account (e.g. 3806) and 3806_rate |
|
352 |
# gives the tax percentage (e.g. 0.19) |
|
353 |
$real_sellprice = $linetotal / (1 + $form->{$form->{"taxaccounts_$i"} . "_rate"}); |
|
354 |
} else { |
|
355 |
$real_sellprice = $linetotal; |
|
356 |
}; |
|
345 | 357 |
my $real_lastcost = $form->{"lastcost_$i"} * $form->{"qty_$i"} / ( $form->{"marge_price_factor_$i"} || 1 ); |
346 | 358 |
my $marge_percent_warn = $myconfig{marge_percent_warn} * 1 || 15; |
347 | 359 |
my $marge_adjust_credit_note = $form->{type} eq 'credit_note' ? -1 : 1; |
Auch abrufbar als: Unified diff
Bug 1756 - Ertrag in Bruttorechnung gefixed
Bei Rechnungen mit "Steuer im Preis inbegriffen":
Ertrag wurde berechnet als ob sellprice netto und lastcost netto war.
Sellprice wird jetzt erst auf den Nettobetrag umgerechnet, bevor der Ertrag berechnet wird.