X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FChart.pm;h=718d42251cab9ae6e8664a0d5b2b0f55357c8d2b;hb=064d15bb6c59188be545d75e895689cdfea04ad6;hp=bda45128c584aec1234163fc190c79da8115ae4f;hpb=e055700faea1906bea6c03184ba4516b57cac887;p=kivitendo-erp.git diff --git a/SL/DB/Chart.pm b/SL/DB/Chart.pm index bda45128c..718d42251 100644 --- a/SL/DB/Chart.pm +++ b/SL/DB/Chart.pm @@ -4,7 +4,6 @@ use strict; use SL::DB::MetaSetup::Chart; use SL::DB::Manager::Chart; -use SL::DB::TaxKey; __PACKAGE__->meta->add_relationships(taxkeys => { type => 'one to many', class => 'SL::DB::TaxKey', @@ -17,7 +16,8 @@ __PACKAGE__->meta->initialize; sub get_active_taxkey { my ($self, $date) = @_; $date ||= DateTime->today_local; - return SL::DB::Manager::TaxKey->get_all(where => [ and => [ chart_id => $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]; }