Pflichtenhefte: Basisdaten verwalten, Such- und Listfunktion
[kivitendo-erp.git] / SL / DB / CustomVariable.pm
index 6073925..dd32ef9 100644 (file)
@@ -15,7 +15,7 @@ sub value {
   my $self = $_[0];
   my $type = $self->config->type;
 
-  goto &bool_value      if $type eq 'boolean';
+  goto &bool_value      if $type eq 'bool';
   goto &timestamp_value if $type eq 'timestamp';
   goto &number_value    if $type eq 'number';
 
@@ -70,8 +70,8 @@ sub value_as_text {
     require SL::DB::Part;
 
     my $id = int($self->number_value);
-    my $vendor = $id ? SL::DB::Part->new(id => $id)->load() : 0;
-    return $vendor ? $vendor->name : '';
+    my $part = $id ? SL::DB::Part->new(id => $id)->load() : 0;
+    return $part ? $part->description : '';
   }
 
   goto &text_value; # text, textfield, date and select