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);
$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);