_copy($item, $form, '', "_${idx}", 0, qw(description project_id ship serialnumber pricegroup_id ordnumber donumber cusordnumber unit
subtotal longdescription price_factor_id marge_price_factor reqdate transdate
active_price_source active_discount_source));
- _copy($item, $form, '', "_${idx}", $format_noround, qw(qty sellprice));
+ _copy($item, $form, '', "_${idx}", $format_noround, qw(qty sellprice fxsellprice));
_copy($item, $form, '', "_${idx}", $format_amounts, qw(marge_total marge_percent lastcost));
_copy($item, $form, '', "_${idx}", $format_percent, qw(discount));
_copy($item->project, $form, 'project', "_${idx}", 0, qw(number description)) if _has($item, 'project_id');
$item->fxsellprice($item->sellprice) if $data->{is_invoice};
my $num_dec = max 2, _num_decimal_places($item->sellprice);
+ $num_dec = 5;
my $discount = _round($item->sellprice * ($item->discount || 0), $num_dec);
my $sellprice = _round($item->sellprice - $discount, $num_dec);
# flatten_to_form sets payment_terms from customer/vendor - we do not want that here
# really ??
delete $form->{payment_terms} if !$form->{payment_id};
+ for my $i (1 .. $form->{rowcount}) {
+ $form->{"sellprice_$i"} = $form->{"fxsellprice_$i"};
+ }
$form->prepare_for_printing;
$form->{attachment_filename} = $form->generate_attachment_filename;