X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/0682dd7ebd3f16a8b7cf282df5c8343d6fa10068..bba2bff3e15b5e5d2852822f6e060166fe0c51fe:/SL/DB/Chart.pm?ds=sidebyside diff --git a/SL/DB/Chart.pm b/SL/DB/Chart.pm index 7c50b43d3..40ac530d4 100644 --- a/SL/DB/Chart.pm +++ b/SL/DB/Chart.pm @@ -18,14 +18,13 @@ sub get_active_taxkey { $date ||= DateTime->today_local; my $cache = $::request->cache("get_active_taxkey")->{$date} //= {}; - if ($cache->{$self->id}) { - return $cache->{$self->id}; - } + return $cache->{$self->id} if $cache->{$self->id}; require SL::DB::TaxKey; - return SL::DB::Manager::TaxKey->get_all(query => [ and => [ chart_id => $self->id, - startdate => { le => $date } ] ], - sort_by => "startdate DESC")->[0]; + return $cache->{$self->id} = SL::DB::Manager::TaxKey->get_all( + query => [ and => [ chart_id => $self->id, + startdate => { le => $date } ] ], + sort_by => "startdate DESC")->[0]; } 1;