X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBankAccount.pm;h=5f4a3e4765899c9155b20228939491a9cb6bf5e0;hb=2b01bfef4afb04fe2b2f0e7e1e79bffe5e38b281;hp=9ac755beb59b7c390977ceefc542ed4e5385313c;hpb=28fee2e2ebc6746bcfeb47c0318e79789ba1c850;p=kivitendo-erp.git diff --git a/SL/DB/BankAccount.pm b/SL/DB/BankAccount.pm index 9ac755beb..5f4a3e476 100644 --- a/SL/DB/BankAccount.pm +++ b/SL/DB/BankAccount.pm @@ -24,8 +24,9 @@ sub validate { # chart_id) my $chart_id = $self->chart_id; - my $chart = SL::DB::Chart->new( id => $chart_id ); - if ( $chart->load(speculative => 1) ) { + require SL::DB::Chart; + my $chart = SL::DB::Manager::Chart->find_by( id => $chart_id ); + if ( $chart ) { my $linked_bank = SL::DB::Manager::BankAccount->find_by( chart_id => $chart_id ); if ( $linked_bank ) { if ( not $self->{id} or ( $self->{id} && $linked_bank->id != $self->{id} )) { @@ -42,4 +43,10 @@ sub validate { return @errors; } +sub displayable_name { + my ($self) = @_; + + return join ' ', grep $_, $self->name, $self->bank, $self->iban; +} + 1;