From: Moritz Bunkus Date: Tue, 25 Nov 2014 12:51:10 +0000 (+0100) Subject: SL::DB::CustomVariable->value: undef anstelle von 0 wenn ref.Objekt nicht existiert X-Git-Tag: release-3.2.0beta~226^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d8559071bff2c32e29f70441a8de3c7a729812e8;p=kivitendo-erp.git SL::DB::CustomVariable->value: undef anstelle von 0 wenn ref.Objekt nicht existiert --- diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 7e6b50080..4be4b6ef2 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