use SL::MoreCommon qw(save_form);
use Carp;
use SL::Presenter::EscapedText qw(escape is_escaped);
+use SL::Presenter::Tag qw(select_tag);
use Rose::Object::MakeMethods::Generic (
'scalar --get_set_init' => [ qw(parts models part p warehouses multi_items_models
%assembly_vars = %{ $self->prepare_assembly_render_vars } if $self->part->is_assembly;
$params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'IC', trans_id => $self->part->id);
+ $_->{valid} = 1 for @{ $params{CUSTOM_VARIABLES} };
CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id)
if (scalar @{ $params{CUSTOM_VARIABLES} });
$position++;
my $vendor = SL::DB::Manager::Vendor->find_by(id => $makemodel->{make}) || die "Can't find vendor from make";
+ my $id = $makemodels_map->{$makemodel->{id}} ? $makemodels_map->{$makemodel->{id}}->id : undef;
my $mm = SL::DB::MakeModel->new( # parts_id => $self->part->id, # will be assigned by row add_makemodels
- id => $makemodel->{id},
+ id => $id,
make => $makemodel->{make},
model => $makemodel->{model} || '',
lastcost => $::form->parse_amount(\%::myconfig, $makemodel->{lastcost_as_number}),
$position++;
my $customer = SL::DB::Manager::Customer->find_by(id => $customerprice->{customer_id}) || die "Can't find customer from id";
+ my $id = $customerprices_map->{$customerprice->{id}} ? $customerprices_map->{$customerprice->{id}}->id : undef;
my $cu = SL::DB::PartCustomerPrice->new( # parts_id => $self->part->id, # will be assigned by row add_customerprices
- id => $customerprice->{id},
+ id => $id,
customer_id => $customerprice->{customer_id},
customer_partnumber => $customerprice->{customer_partnumber} || '',
price => $::form->parse_amount(\%::myconfig, $customerprice->{price_as_number}),
}
sub build_bin_select {
- $_[0]->p->select_tag('part.bin_id', [ $_[0]->warehouse->bins ],
+ select_tag('part.bin_id', [ $_[0]->warehouse->bins ],
title_key => 'description',
default => $_[0]->bin->id,
);
}
+
# get_set_inits for partpicker
sub init_parts {
if ( $self->part->orphaned ) {
return SL::DB::Manager::Buchungsgruppe->get_all_sorted;
} else {
- return SL::DB::Manager::Buchungsgruppe->get_all(where => [ id => $self->part->buchungsgruppen_id ]);
+ return SL::DB::Manager::Buchungsgruppe->get_all_sorted(where => [ id => $self->part->buchungsgruppen_id ]);
}
}