X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/cb146b01ef65090e36e9ab95743176f64ab8eed3..e8b158e97c5a24c827f0c46873f2048e95cac35c:/SL/DB/CustomVariable.pm diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 83ee89db7..dd68cab3e 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -7,6 +7,7 @@ use strict; use SL::DB::MetaSetup::CustomVariable; use SL::DB::CustomVariableValidity; +use SL::DB::Customer; __PACKAGE__->meta->initialize; @@ -20,6 +21,15 @@ sub value { goto &bool_value if $type eq 'boolean'; goto ×tamp_value if $type eq 'timestamp'; goto &number_value if $type eq 'number'; + if ( $type eq 'customer' ) { + if ( defined($_[1]) ) { + goto &number_value; + } + else { + my $id = int($self->number_value); + return $id ? SL::DB::Customer->new(id => $id)->load() : 0; + } + } goto &text_value; # text and select }