Revision 050ff24c
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
- ID 050ff24c60d340ce8ab0a9b28b98a76c5cb04b9a
- Vorgänger 07fe52c9
SL/Controller/TimeRecording.pm | ||
---|---|---|
5 | 5 |
|
6 | 6 |
use DateTime; |
7 | 7 |
use English qw(-no_match_vars); |
8 |
use List::Util qw(sum0); |
|
8 | 9 |
use POSIX qw(strftime); |
9 | 10 |
|
10 | 11 |
use SL::Controller::Helper::GetModels; |
... | ... | |
17 | 18 |
use SL::DB::TimeRecording; |
18 | 19 |
use SL::DB::TimeRecordingArticle; |
19 | 20 |
use SL::Helper::Flash qw(flash); |
20 |
use SL::Helper::Number qw(_round_number _parse_number); |
|
21 |
use SL::Helper::Number qw(_round_number _parse_number _round_total);
|
|
21 | 22 |
use SL::Helper::UserPreferences::TimeRecording; |
22 | 23 |
use SL::Locale::String qw(t8); |
23 | 24 |
use SL::ReportGenerator; |
... | ... | |
63 | 64 |
$self->make_filter_summary; |
64 | 65 |
$self->prepare_report; |
65 | 66 |
|
66 |
$self->report_generator_list_objects(report => $self->{report}, objects => $self->models->get); |
|
67 |
my $objects = $self->models->get; |
|
68 |
|
|
69 |
my $total = sum0 map { _round_total($_->duration_in_hours) } @$objects; |
|
70 |
my $total_h = int($total); |
|
71 |
my $total_m = int($total * 60.0 + 0.5) % 60; |
|
72 |
my $total_s = sprintf('%d:%02d', $total_h, $total_m); |
|
73 |
|
|
74 |
push @$objects, $self->report_generator_make_control_row(is_separator => 1); |
|
75 |
push @$objects, $self->report_generator_make_control_row(data => { description => t8('Total'), |
|
76 |
duration => $total_s, }); |
|
77 |
|
|
78 |
$self->report_generator_list_objects(report => $self->{report}, objects => $objects); |
|
67 | 79 |
} |
68 | 80 |
|
69 | 81 |
sub action_edit { |
Auch abrufbar als: Unified diff
Zeiterfassung: Summe der Dauern mit Kontroll-Zeile anzeigen