Bei Rechnungen mit sehr vielen sehr kleinen Positionen wurde die
Rundungsfehlerakkumulation _nur_ in den finalen netamounts
berücksichtigt, nicht aber in den daraus berechneten grossamounts was zu
Cent-Abweichungen geführt hat.
(cherry picked from commit
061180a3a9cd5ddffc5d9b40fc1751653fc8ef09)
die "tax_amount != 0 but no chart_id for taxkey " . $taxkey->id . " tax " . $taxkey->tax->id;
}
- $self->netamount($self->netamount + $sellprice * (1 - $item->discount) * $item->qty / $item->price_factor);
-
my $chart = $part->get_chart(type => $data->{is_sales} ? 'income' : 'expense', taxzone => $self->taxzone_id);
$data->{amounts}->{ $chart->id } ||= { taxkey => $taxkey->taxkey_id, tax_id => $taxkey->tax_id, amount => 0 };
$data->{amounts}->{ $chart->id }->{amount} += $linetotal;
$data->{taxes}->{$chart_id} = $rounded;
}
+ $self->netamount(sum map { $_->{amount} } values %{ $data->{amounts} });
+
my $amount = _round(($self->netamount + $tax_diff) * $data->{exchangerate}, 2);
my $diff = $amount - ($self->netamount + $tax_diff) * $data->{exchangerate};
my $netamount = $amount;