Revision 99dd63d7
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DB/Helper/PriceTaxCalculator.pm | ||
---|---|---|
90 | 90 |
$item->marge_percent(0); |
91 | 91 |
|
92 | 92 |
} else { |
93 |
my $lastcost = ! ($item->lastcost * 1) ? ($item->part->lastcost || 0) : $item->lastcost; |
|
93 |
my $lastcost = ! ($item->lastcost * 1) ? ($item->part->lastcost || 0) : $item->lastcost; |
|
94 |
my $linetotal_cost = _round($lastcost * $item->qty / $item->marge_price_factor, 2); |
|
94 | 95 |
|
95 |
$item->marge_total( $linetotal - $lastcost / $item->marge_price_factor);
|
|
96 |
$item->marge_total( $linetotal - $linetotal_cost);
|
|
96 | 97 |
$item->marge_percent($item->marge_total * 100 / $linetotal); |
97 | 98 |
|
98 | 99 |
$self->marge_total( $self->marge_total + $item->marge_total); |
99 |
$data->{lastcost_total} += $lastcost;
|
|
100 |
$data->{lastcost_total} += $linetotal_cost;
|
|
100 | 101 |
} |
101 | 102 |
|
102 | 103 |
my $taxkey = $item->part->get_taxkey(date => $self->transdate, is_sales => $data->{is_sales}, taxzone => $self->taxzone_id); |
Auch abrufbar als: Unified diff
SL::DB::Helper::PriceTaxCalculator: Margenberechnung gefixt
Die Margenberechnung hat die Stückzahl nicht bei der Kostenberechnung
berücksichtigt.