X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FTimeRecording.pm;h=d326522be5636f5f2068f828ee8c6180eaefc889;hb=9db8b697e257cef1e8ffaef832cd650873eb971e;hp=e97c3c1d8cd79942eb7b67371b73e490a9775169;hpb=c381d6c41b2c6a0da6811525fb5a0fc5ea716975;p=kivitendo-erp.git diff --git a/SL/Controller/TimeRecording.pm b/SL/Controller/TimeRecording.pm index e97c3c1d8..d326522be 100644 --- a/SL/Controller/TimeRecording.pm +++ b/SL/Controller/TimeRecording.pm @@ -165,7 +165,7 @@ sub init_time_recording { my %attributes = %{ $::form->{time_recording} || {} }; if ($self->use_duration) { - if ($::form->{duration_h} || $::form->{duration_m}) { + if (exists $::form->{duration_h} || exists $::form->{duration_m}) { $attributes{duration} = _round_number(_parse_number($::form->{duration_h}) * 60 + _parse_number($::form->{duration_m}), 0); } @@ -237,8 +237,9 @@ sub init_all_time_recording_articles { } sub init_all_orders { - SL::DB::Manager::Order->get_all_sorted(query => [or => [ closed => 0, closed => undef ], - '!customer_id' => undef]); + my $orders = SL::DB::Manager::Order->get_all(query => [or => [ closed => 0, closed => undef ], + '!customer_id' => undef]); + return [ map { [$_->id, sprintf("%s %s", $_->number, $_->customervendor->name) ] } sort { $a->number <=> $b->number } @{$orders||[]} ]; } sub init_use_duration {