$form->{vc} = $vc if ref($self) =~ m{^SL::DB::(?:.*Invoice|.*Order)};
my @vc_fields = (qw(account_number bank bank_code bic business city contact country creditlimit
$form->{vc} = $vc if ref($self) =~ m{^SL::DB::(?:.*Invoice|.*Order)};
my @vc_fields = (qw(account_number bank bank_code bic business city contact country creditlimit
phone street taxnumber ustid zipcode),
"${vc}number",
($vc eq 'customer')? 'c_vendor_id': 'v_customer_id');
phone street taxnumber ustid zipcode),
"${vc}number",
($vc eq 'customer')? 'c_vendor_id': 'v_customer_id');
- $form->{"partsgroup_${idx}"} = $item->part->partsgroup->partsgroup if _has($item->part, 'partsgroup_id');
+ $form->{"std_warehouse_${idx}"} = $item->part->warehouse->description if _has($item->part, 'warehouse_id');
+ $form->{"std_bin_${idx}"} = $item->part->bin->description if _has($item->part, 'bin_id');
+ $form->{"partsgroup_${idx}"} = $item->part->partsgroup->partsgroup if _has($item->part, 'partsgroup_id');
_copy($item, $form, "${items_name}_", "_${idx}", 0, qw(id)) if $items_name;
# TODO: is part_type correct here? Do we need to set part_type as default?
_copy($item->part, $form, '', "_${idx}", 0, qw(id partnumber weight part_type));
_copy($item, $form, "${items_name}_", "_${idx}", 0, qw(id)) if $items_name;
# TODO: is part_type correct here? Do we need to set part_type as default?
_copy($item->part, $form, '', "_${idx}", 0, qw(id partnumber weight part_type));
}
_copy_custom_variables($self, $form, 'vc_cvar_', '', $cvar_validity{vc});
}
_copy_custom_variables($self, $form, 'vc_cvar_', '', $cvar_validity{vc});
sub _copy_custom_variables {
my ($src, $form, $prefix, $postfix, $cvar_validity) = @_;
sub _copy_custom_variables {
my ($src, $form, $prefix, $postfix, $cvar_validity) = @_;