X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FChart.pm;h=718d42251cab9ae6e8664a0d5b2b0f55357c8d2b;hb=f88b542e60f214a912f4f99f204837f2ee67f65c;hp=42cd6c947281f31d60f920a5283e970e4e994b3c;hpb=e2013e83d2ada0ba4ca439d972dbeaf56cbc16c0;p=kivitendo-erp.git diff --git a/SL/DB/Chart.pm b/SL/DB/Chart.pm index 42cd6c947..718d42251 100644 --- a/SL/DB/Chart.pm +++ b/SL/DB/Chart.pm @@ -3,7 +3,7 @@ package SL::DB::Chart; use strict; use SL::DB::MetaSetup::Chart; -use SL::DB::TaxKey; +use SL::DB::Manager::Chart; __PACKAGE__->meta->add_relationships(taxkeys => { type => 'one to many', class => 'SL::DB::TaxKey', @@ -12,12 +12,12 @@ __PACKAGE__->meta->add_relationships(taxkeys => { type => 'one to many', ); __PACKAGE__->meta->initialize; -__PACKAGE__->meta->make_manager_class; 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]; }