X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/400a18e91c4e1b2fd5847ad3da017e0d41afdc50..a93b3b648ec14f94c87176bb8d174da005446d97:/SL/DB/Helper/PriceTaxCalculator.pm diff --git a/SL/DB/Helper/PriceTaxCalculator.pm b/SL/DB/Helper/PriceTaxCalculator.pm index 6a3343548..63dde450a 100644 --- a/SL/DB/Helper/PriceTaxCalculator.pm +++ b/SL/DB/Helper/PriceTaxCalculator.pm @@ -70,6 +70,7 @@ sub _calculate_item { croak("Undefined unit " . $item->unit) if !$item_unit; $item->base_qty($item_unit->convert_to($item->qty, $part_unit)); + $item->fxsellprice($item->sellprice); my $num_dec = _num_decimal_places($item->sellprice); my $discount = _round($item->sellprice * ($item->discount || 0), $num_dec); @@ -108,8 +109,8 @@ sub _calculate_item { $tax_amount = $linetotal * $tax_rate; } - $data->{taxes}->{ $taxkey->chart_id } ||= 0; - $data->{taxes}->{ $taxkey->chart_id } += $tax_amount; + $data->{taxes}->{ $taxkey->tax->chart_id } ||= 0; + $data->{taxes}->{ $taxkey->tax->chart_id } += $tax_amount; $self->netamount($self->netamount + $sellprice * $item->qty / $item->price_factor);