Bugfix (teil) #406 abzurechnender Betrag bei Aufträgen manchmal falsch falls Gutschriften
[kivitendo-erp.git] / SL / Presenter / Part.pm
index 8131eff..bc5ee8a 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>.
@@ -228,6 +241,10 @@ C<h,min>.
 If C<%params> contains C<convertible_unit> only parts with a unit
 that's convertible to unit will be used for autocompletion.
 
+If C<%params> contains C<with_makemodel> or C<with_customer_partnumber> even
+parts will be used for autocompletion which partnumber is a vendor partnumber
+(makemodel) or a customer partnumber.
+
 Obsolete parts will by default not be displayed for selection. However they are
 accepted as default values and can persist during updates. As with other
 selectors though, they are not selectable once overridden.