]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Presenter/Part.pm
Auftrags-Controller: Einstellungen/Höhe des Scrollbereichs berücksichtigen …
[mfinanz.git] / SL / Presenter / Part.pm
index 8131eff14ad590e4aea643e14845780ccaf0b060..145d9128f7c05cd74def69fc673bb58e3a81c61b 100644 (file)
@@ -61,6 +61,8 @@ sub picker { goto &part_picker }
 #
 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';
@@ -87,6 +89,9 @@ sub type_abbreviation {
 #
 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) : '';
@@ -103,6 +108,9 @@ sub typeclass_abbreviation {
 #
 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) : '';
@@ -221,6 +229,11 @@ If C<%params> contains C<part_type> only parts of this type will be used
 for autocompletion. You may comma separate multiple types as in
 C<part,assembly>.
 
+If C<%params> contains C<status> only parts of this status will be used
+for autocompletion. C<status> can be one of the following strings:
+C<active>, C<obsolete> or C<all>. C<active> is the default if C<status> is
+not given.
+
 If C<%params> contains C<unit> only parts with this unit will be used
 for autocompletion. You may comma separate multiple units as in
 C<h,min>.