query => [
obsolete => 0,
SL::DB::Manager::Part->type_filter($::form->{filter}{part_type}),
+ SL::DB::Manager::PartClassification->classification_filter($::form->{filter}{classification_id}),
or => [
description => { ilike => $::form->{filter}{'all:substr:multi::ilike'} },
partnumber => { ilike => $::form->{filter}{'all:substr:multi::ilike'} },
partnumber => t8('Partnumber'),
description => t8('Description'),
},
- with_objects => [ qw(unit_obj) ],
+ with_objects => [ qw(unit_obj classification) ],
);
}
SL::Controller::Helper::GetModels->new(
controller => $_[0],
model => 'Part',
- with_objects => [ qw(unit_obj partsgroup) ],
+ with_objects => [ qw(unit_obj partsgroup classification) ],
disable_plugin => 'paginated',
source => $::form->{multi_items},
sorted => {
__PACKAGE__->make_manager_methods;
+sub classification_filter {
+ my ($class, $classification, $prefix) = @_;
+
+ return () unless $classification;
+
+ $prefix //= '';
+
+ my @classifications = grep { $_ } listify($classification);
+ return ( $prefix . 'classification_id' => \@classifications );
+}
+
1;
my $ret =
$self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id) .
- join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(part_type unit convertible_unit)) .
+ join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(part_type classification_id unit convertible_unit)) .
$self->input_tag("", ref $value ? $value->displayable_name : '', id => "${id}_name", %params);
$::request->layout->add_javascripts('autocomplete_part.js');
UNDEFINED: CLASSES.UNDEFINED
}
var real_id = $real.attr('id');
- var $dummy = $('#' + real_id + '_name');
- var $part_type = $('#' + real_id + '_part_type');
- var $unit = $('#' + real_id + '_unit');
- var $convertible_unit = $('#' + real_id + '_convertible_unit');
+ var $dummy = $('#' + real_id + '_name');
+ var $part_type = $('#' + real_id + '_part_type');
+ var $classification_id = $('#' + real_id + '_classification_id');
+ var $unit = $('#' + real_id + '_unit');
+ var $convertible_unit = $('#' + real_id + '_convertible_unit');
var state = STATES.PICKED;
var last_real = $real.val();
var last_dummy = $dummy.val();
if ($part_type && $part_type.val())
data['filter.part_type'] = $part_type.val().split(',');
+ if ($classification_id && $classification_id.val())
+ data['filter.classification_id'] = $classification_id.val().split(',');
+
if ($unit && $unit.val())
data['filter.unit'] = $unit.val().split(',');
popup_button.click(open_dialog);
var pp = {
- real: function() { return $real },
- dummy: function() { return $dummy },
- part_type: function() { return $part_type },
- unit: function() { return $unit },
- convertible_unit: function() { return $convertible_unit },
+ real: function() { return $real },
+ dummy: function() { return $dummy },
+ part_type: function() { return $part_type },
+ classification_id: function() { return $classification_id },
+ unit: function() { return $unit },
+ convertible_unit: function() { return $convertible_unit },
update_results: update_results,
result_timer: result_timer,
set_item: set_item,
set_item({
id: $(this).children('input.part_picker_id').val(),
name: $(this).children('input.part_picker_description').val(),
+ classification_id: $(this).children('input.part_picker_classification_id').val(),
unit: $(this).children('input.part_picker_unit').val(),
partnumber: $(this).children('input.part_picker_partnumber').val(),
description: $(this).children('input.part_picker_description').val(),
[%- USE T8 %]
[%- USE HTML %]
[%- USE L %]
+[%- USE P %]
[%- USE LxERP %]
[%# L.dump(SELF.parts) %]
<span class='ppp_block_description'>[% part.description | html %]</span>
<div style='clear:both;'></div>
<span class='ppp_block_sellprice'>[% 'Sellprice' | $T8 %]: [% part.sellprice_as_number | html %]</span>
+ <span class='ppp_block_description'>[% P.typeclass_abbreviation(part) %]</span>
</div>
[%- END %]
[% L.part_picker('part_id4', undef, part_type='assembly') %]<br>
Waren und Dienstleistungen: <br>
[% L.part_picker('part_id5', undef, part_type='part,service') %]<br>
+Artikel-Klassifizierung: Einkauf <br>
+[% L.part_picker('part_id10', undef, classification_id='1') %]<br>
+Artikel-Klassifizierung: Verkauf <br>
+[% L.part_picker('part_id11', undef, classification_id='2') %]<br>
+Artikel-Klassifizierung: Handelsware <br>
+[% L.part_picker('part_id12', undef, classification_id='3') %]<br>
+Artikel-Klassifizierung: Produktion <br>
+[% L.part_picker('part_id13', undef, classification_id='4') %]<br>
+Artikel-Klassifizierung: Eink.,Verk.,Prod. <br>
+[% L.part_picker('part_id14', undef, classification_id='1,2,4') %]<br>
Pre-filled:<br>
[% L.part_picker('part_id6', pre_filled_part) %]<br>
Convertible unit 'Std': (only select parts with unit Tag/Std/Min)<br>