X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/8915e7750d73593e86979e9a6a9016016a70c808..3c22e5f4b953f463a33b722d6f4f122e4a20c99a:/SL/DB/TimeRecording.pm diff --git a/SL/DB/TimeRecording.pm b/SL/DB/TimeRecording.pm index 970fa8738..9b1a2e351 100644 --- a/SL/DB/TimeRecording.pm +++ b/SL/DB/TimeRecording.pm @@ -33,7 +33,6 @@ sub validate { my @errors; - push @errors, t8('Start time must not be empty.') if !$self->start_time; push @errors, t8('Customer must not be empty.') if !$self->customer_id; push @errors, t8('Staff member must not be empty.') if !$self->staff_member_id; push @errors, t8('Employee must not be empty.') if !$self->employee_id; @@ -109,6 +108,10 @@ sub is_time_in_wrong_order { return; } +sub is_duration_used { + return !$_[0]->start_time; +} + sub displayable_times { my ($self) = @_; @@ -119,14 +122,4 @@ sub displayable_times { return ($self->start_time_as_timestamp||$ph) . ' - ' . ($self->end_time_as_timestamp||$ph); } -sub duration { - my ($self) = @_; - - if ($self->start_time && $self->end_time) { - return ($self->end_time->subtract_datetime_absolute($self->start_time))->seconds/60.0; - } else { - return; - } -} - 1;