From fdb3de6969b279fa5d385c4e2c664e6c12823707 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 29 Apr 2021 14:37:12 +0200 Subject: [PATCH] Zeiterfassung: Auftrag im Bericht anzeigen --- SL/Controller/TimeRecording.pm | 6 ++++-- SL/DB/Manager/TimeRecording.pm | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index 709b6b672..6e0493b40 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -35,6 +35,7 @@ my %sort_columns = ( date => t8('Date'), start_time => t8('Start'), end_time => t8('End'), + order => t8('Sales Order'), customer => t8('Customer'), part => t8('Article'), project => t8('Project'), @@ -189,7 +190,7 @@ sub init_models { sorted => \%sort_columns, disable_plugin => 'paginated', query => \@where, - with_objects => [ 'customer', 'part', 'project', 'staff_member', 'employee' ], + with_objects => [ 'customer', 'part', 'project', 'staff_member', 'employee', 'order' ], ); } @@ -239,7 +240,7 @@ sub prepare_report { my $report = SL::ReportGenerator->new(\%::myconfig, $::form); $self->{report} = $report; - my @columns = qw(date start_time end_time customer part project description staff_member duration booked); + my @columns = qw(date start_time end_time order customer part project description staff_member duration booked); my %column_defs = ( date => { text => t8('Date'), sub => sub { $_[0]->date_as_date }, @@ -248,6 +249,7 @@ sub prepare_report { obj_link => sub { $self->url_for(action => 'edit', 'id' => $_[0]->id, callback => $self->models->get_callback) } }, end_time => { text => t8('End'), sub => sub { $_[0]->end_time_as_timestamp }, obj_link => sub { $self->url_for(action => 'edit', 'id' => $_[0]->id, callback => $self->models->get_callback) } }, + order => { text => t8('Sales Order'), sub => sub { $_[0]->order && $_[0]->order->number } }, customer => { text => t8('Customer'), sub => sub { $_[0]->customer->displayable_name } }, part => { text => t8('Article'), sub => sub { $_[0]->part && $_[0]->part->displayable_name } }, project => { text => t8('Project'), sub => sub { $_[0]->project && $_[0]->project->displayable_name } }, diff --git a/SL/DB/Manager/TimeRecording.pm b/SL/DB/Manager/TimeRecording.pm index 6992aa10d..edb6d1bd0 100644 --- a/SL/DB/Manager/TimeRecording.pm +++ b/SL/DB/Manager/TimeRecording.pm @@ -25,6 +25,7 @@ sub _sort_spec { start_time => [ 'date', 'start_time' ], end_time => [ 'date', 'end_time' ], customer => [ 'lower(customer.name)', 'date','start_time'], + order => [ 'order.ordnumber', 'date','start_time'], } ); } -- 2.20.1