X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/82515b2d93dc5632f24d6e0b6f8f05f3fd19fbb0..cbbcefbbb1b2b58752bd9dd9d374c6092323ef27:/SL/DB/Helpers/AttrPercent.pm diff --git a/SL/DB/Helpers/AttrPercent.pm b/SL/DB/Helpers/AttrPercent.pm index 24f816404..e4c44ae90 100644 --- a/SL/DB/Helpers/AttrPercent.pm +++ b/SL/DB/Helpers/AttrPercent.pm @@ -12,24 +12,14 @@ sub define { $params{places} = 2 if !defined($params{places}); - my $code = <$attribute($::form->parse_amount(\%::myconfig, $string) / 100) if @_ > 1; - if (scalar \@_) { - \$self->${attribute}(\$::form->parse_amount(\\\%::myconfig, \$_[0]) / 100); - } - - return \$::form->format_amount(\\\%::myconfig, 100 * \$self->${attribute}, $params{places}); -} - -1; -CODE - - eval $code; - croak "Defining '${attribute}_as_number' failed: $EVAL_ERROR" if $EVAL_ERROR; + return $::form->format_amount(\%::myconfig, 100 * $self->$attribute, $params{places}); + }; return 1; }