X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c0158b6b111fa98fbde66a300237133c999bfb9f..068f652cd376ffcaa392d2fc32f9d194e17daa44:/SL/Controller/Letter.pm diff --git a/SL/Controller/Letter.pm b/SL/Controller/Letter.pm index 8e588d9f8..0f1a40f5f 100644 --- a/SL/Controller/Letter.pm +++ b/SL/Controller/Letter.pm @@ -354,7 +354,7 @@ sub prepare_report { obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, callback => $self->models->get_callback) } }, letternumber => { text => t8('Letternumber'), sub => sub { $_[0]->letternumber }, obj_link => sub { $self->url_for(action => 'edit', 'letter.id' => $_[0]->id, callback => $self->models->get_callback) } }, - vc_id => { text => t8('Customer'), sub => sub { $_[0]->customer->displayable_name } }, + vc_id => { text => t8('Customer'), sub => sub { SL::DB::Manager::Customer->find_by_or_create(id => $_[0]->vc_id)->displayable_name } }, contact => { text => t8('Contact'), sub => sub { $_[0]->contact ? $_[0]->contact->full_name : '' } }, ); @@ -542,13 +542,7 @@ sub init_models { SL::Controller::Helper::GetModels->new( controller => $self, model => 'Letter', - sorted => { - _default => { - by => 'letternumber', - dir => 1, - }, - %sort_columns, - }, + sorted => \%sort_columns, with_objects => [ 'contact', 'salesman', 'employee' ], ); }