+ html_tag('span', $ret, class => 'part_picker');
+}
+
+sub picker { goto &part_picker }
+
+#
+# shortcut for article type
+#
+sub type_abbreviation {
+ my ($part_type) = @_;
+
+ return '' if !$part_type;
+ return $::locale->text('Assembly (typeabbreviation)') if $part_type eq 'assembly';
+ return $::locale->text('Part (typeabbreviation)') if $part_type eq 'part';
+ return $::locale->text('Assortment (typeabbreviation)') if $part_type eq 'assortment';
+ return $::locale->text('Service (typeabbreviation)');
+}
+
+#
+# Translations for Abbreviations:
+#
+# $::locale->text('None (typeabbreviation)')
+# $::locale->text('Purchase (typeabbreviation)')
+# $::locale->text('Sales (typeabbreviation)')
+# $::locale->text('Merchandise (typeabbreviation)')
+# $::locale->text('Production (typeabbreviation)')
+#
+# and for descriptions
+# $::locale->text('Purchase')
+# $::locale->text('Sales')
+# $::locale->text('Merchandise')
+# $::locale->text('Production')
+
+#
+# shortcut for article type
+#
+sub classification_abbreviation {
+ my ($id) = @_;
+
+ return '' if !$id;
+
+ SL::DB::Manager::PartClassification->cache_all();
+ my $obj = SL::DB::PartClassification->load_cached($id);
+ $obj && $obj->abbreviation ? t8($obj->abbreviation) : '';
+}
+
+sub typeclass_abbreviation {
+ my ($part) = @_;
+ return '' if !$part || !$part->isa('SL::DB::Part');
+ return type_abbreviation($part->part_type) . classification_abbreviation($part->classification_id);
+}
+
+#
+# shortcut for article type
+#
+sub separate_abbreviation {
+ my ($id) = @_;
+
+ return '' if !$id;
+
+ SL::DB::Manager::PartClassification->cache_all();
+ my $obj = SL::DB::PartClassification->load_cached($id);
+ $obj && $obj->abbreviation && $obj->report_separate ? t8($obj->abbreviation) : '';
+}
+
+#
+# generate selection tag
+#
+sub select_classification {
+ my ($name, %attributes) = @_;
+
+ $attributes{value_key} = 'id';
+ $attributes{title_key} = 'description';
+
+ my $classification_type_filter = delete $attributes{type} // [];
+
+ my $collection = SL::DB::Manager::PartClassification->get_all_sorted( where => $classification_type_filter );
+ $_->description($::locale->text($_->description)) for @{ $collection };
+ select_tag( $name, $collection, %attributes );