X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FCustomVariable.pm;h=560a2de6fcd69db8c408ef4a0307a7f14995c358;hb=b9d2f81497c6ff60be298ed1e7697c0c6a4316fa;hp=7e6b5008079dff871a9d51ca7ec30e0106284677;hpb=fe4751dee76f518853a0546a2b0ef4149c2324c4;p=kivitendo-erp.git diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 7e6b50080..560a2de6f 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -64,17 +64,17 @@ sub value { require SL::DB::Customer; my $id = int($self->number_value); - return $id ? SL::DB::Customer->new(id => $id)->load() : 0; + return $id ? SL::DB::Customer->new(id => $id)->load() : undef; } elsif ( $type eq 'vendor' ) { require SL::DB::Vendor; my $id = int($self->number_value); - return $id ? SL::DB::Vendor->new(id => $id)->load() : 0; + return $id ? SL::DB::Vendor->new(id => $id)->load() : undef; } elsif ( $type eq 'part' ) { require SL::DB::Part; my $id = int($self->number_value); - return $id ? SL::DB::Part->new(id => $id)->load() : 0; + return $id ? SL::DB::Part->new(id => $id)->load() : undef; } goto &text_value; # text, textfield, date and select @@ -103,7 +103,8 @@ sub value_as_text { require SL::DB::Vendor; my $id = int($self->number_value); - return $id ? SL::DB::Vendor->new(id => $id)->load() : 0; + my $vendor = $id ? SL::DB::Vendor->new(id => $id)->load() : 0; + return $vendor ? $vendor->name : ''; } elsif ( $type eq 'part' ) { require SL::DB::Part;