X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/117fefacdfaf457a502b32bae2f0e10fd0e11414..2eb2bc5583f28aa5f9bb18c2cd314995d0570f8c:/SL/DB/Unit.pm diff --git a/SL/DB/Unit.pm b/SL/DB/Unit.pm index 927e31b2e..b133d8f13 100644 --- a/SL/DB/Unit.pm +++ b/SL/DB/Unit.pm @@ -27,10 +27,12 @@ sub unit_class { sub convertible_units { my $self = shift; + my $all_units = scalar(@_) && (ref($_[0]) eq 'ARRAY') ? $_[0] : \@_; + $all_units = SL::DB::Manager::Unit->get_all if !@{ $all_units }; return [ sort { $a->sortkey <=> $b->sortkey } grep { $_->unit_class->name eq $self->unit_class->name } - @{ SL::DB::Manager::Unit->get_all } + @{ $all_units } ]; }