X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/30e4d5bfd0fbb9c65c7ce4097da09ef9902406dd..db7c3a525af246d3373e63b4e8b5b7edc82b0a9f:/SL/CVar.pm diff --git a/SL/CVar.pm b/SL/CVar.pm index e91a2366d..240822278 100644 --- a/SL/CVar.pm +++ b/SL/CVar.pm @@ -3,6 +3,7 @@ package CVar; use strict; use List::Util qw(first); +use Scalar::Util qw(blessed); use Data::Dumper; use SL::DBUtils; @@ -706,6 +707,15 @@ sub custom_variables_validity_by_trans_id { return sub { !$invalids{+shift} }; } +sub parse { + my ($self, $value, $config) = @_; + + return $::form->parse_amount(\%::myconfig, $value) if $config->{type} eq 'number'; + return DateTime->from_lxoffice($value) if $config->{type} eq 'date'; + return !ref $value ? SL::DB::Manager::Customer->find_by(id => $value * 1) : $value if $config->{type} eq 'customer'; + return $value; +} + 1; __END__