$form->{"partsgroup_${idx}"} = $item->part->partsgroup->partsgroup if _has($item->part, 'partsgroup_id');
_copy($item->part, $form, '', "_${idx}", 0, qw(id partnumber weight));
- _copy($item->part, $form, '', "_${idx}", $format_amounts, qw(listprice));
+ _copy($item->part, $form, '', "_${idx}", 0, qw(listprice));
_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 approved_sellprice reqdate transdate));
_copy($item, $form, '', "_${idx}", $format_amounts, qw(qty sellprice marge_total marge_percent lastcost));
push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description};
push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"};
- push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"});
+ push @{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->format_amount($myconfig, $form->{"listprice_$i"}, 2);
+ push(@{ $form->{TEMPLATE_ARRAYS}->{listprice_nofmt} }, $form->{"listprice_$i"});
my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
my ($dec) = ($sellprice =~ /\.(\d+)/);
push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{sellprice} }, $form->{"sellprice_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{sellprice_nofmt} }, $form->parse_amount($myconfig, $form->{"sellprice_$i"});
- push @{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->format_amount($myconfig, $form->{"listprice_$i"}, 2);
+ push @{ $form->{TEMPLATE_ARRAYS}->{listprice_nofmt} }, $form->{"listprice_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{price_factor} }, $price_factor->{formatted_factor};
push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description};
push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"};
}
}
}
- map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor);
+ map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice lastcost basefactor);
$form->{"donumber_$i"} = $form->{donumber};
$form->{"converted_from_delivery_order_items_id_$i"} = delete $form->{"delivery_order_items_id_$i"};
}
$locale->text('EK'), $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces) }
if $form->{"id_$i"} && ($form->{type} =~ /^sales_/ || $form->{type} =~ /invoice/ || $form->{type} =~ /^credit_note$/ ) && !$is_delivery_order;
- $form->{"listprice_$i"} = $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2)
- if $form->{"id_$i"} && ($form->{type} =~ /^sales_/ || $form->{type} =~ /invoice/) ;
# / marge calculations ending
# Calculate total weight
}
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
- qw(sellprice listprice weight);
+ qw(sellprice weight);
if ( $mode eq 'IC' ) {
# assembly mode:
map {
$form->{"${_}_$i"} =
$form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces)
- } qw(sellprice listprice lastcost qty) if $form->{item} ne 'assembly';
+ } qw(sellprice lastcost qty) if $form->{item} ne 'assembly';
$form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100.0) if $form->{item} ne 'assembly';
delete $form->{nextsub};
#$form->{sellprice} = 0;
$form->{weight} = 0;
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
- qw(listprice sellprice rop stock);
+ qw(sellprice rop stock);
my @flds = qw(id qty unit bom partnumber description sellprice weight runningnumber partsgroup lastcost);
for my $i (1 .. $form->{rowcount}) {
map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"})
if ($form->{"${_}_${i}"}) }
- qw(ship qty sellprice listprice basefactor discount));
+ qw(ship qty sellprice basefactor discount));
$form->{"converted_from_invoice_id_$i"} = delete $form->{"invoice_id_$i"};
}
map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
$form->{"${_}_${i}"})
if ($form->{"${_}_${i}"}) }
- qw(ship qty sellprice listprice basefactor discount lastcost));
+ qw(ship qty sellprice basefactor discount lastcost));
}
&prepare_order;
# map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
# qw(creditlimit creditremaining);
- for my $i (1 .. $form->{rowcount}) {
- for (qw(listprice)) {
- $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"};
- }
- }
# set new persistent ids for credit note and link previous invoice id
$form->{"converted_from_invoice_id_$_"} = delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"};
$form->{cp_id} *= 1;
for my $i (1 .. $form->{rowcount}) {
- for (qw(ship qty sellprice listprice basefactor)) {
+ for (qw(ship qty sellprice basefactor)) {
$form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"};
}
$form->{"converted_from_orderitems_id_$i"} = delete $form->{"orderitems_id_$i"};
};
for my $i (1 .. $form->{rowcount}) {
- map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice basefactor discount lastcost);
+ map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice basefactor discount lastcost);
}
my %saved_vars = map { $_ => $form->{$_} } grep { $form->{$_} } qw(currency);
delete @{$form}{qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal closed delivered)};
for my $i (1 .. $form->{rowcount}) {
- map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice lastcost basefactor discount);
+ map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice lastcost basefactor discount);
$form->{"converted_from_orderitems_id_$i"} = delete $form->{"orderitems_id_$i"};
}