From: Bernd Bleßmann Date: Mon, 13 Sep 2021 12:01:10 +0000 (+0200) Subject: Employee::current statt manuell an weiteren Stellen X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~352 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=eabfa79517bccb2dd56220ffd7f381605944bc7f;p=kivitendo-erp.git Employee::current statt manuell an weiteren Stellen --- diff --git a/SL/AM.pm b/SL/AM.pm index 57e6b445a..9780078f5 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -556,7 +556,7 @@ sub save_preferences { my ($self, $form) = @_; - my $employee = SL::DB::Manager::Employee->find_by(login => $::myconfig{login}); + my $employee = SL::DB::Manager::Employee->current; $employee->update_attributes(name => $form->{name}); my $user = SL::DB::Manager::AuthUser->find_by(login => $::myconfig{login}); diff --git a/SL/Controller/CsvImport/Helper/Consistency.pm b/SL/Controller/CsvImport/Helper/Consistency.pm index d1ce92bb1..5538a738c 100644 --- a/SL/Controller/CsvImport/Helper/Consistency.pm +++ b/SL/Controller/CsvImport/Helper/Consistency.pm @@ -208,7 +208,7 @@ sub handle_salesman { if ($vc_obj && $vc_obj->salesman_id) { $object->salesman(SL::DB::Manager::Employee->find_by(id => $vc_obj->salesman_id)); } else { - $object->salesman(SL::DB::Manager::Employee->find_by(login => $::myconfig{login})); + $object->salesman(SL::DB::Manager::Employee->current); } } } diff --git a/SL/Controller/CsvImport/Inventory.pm b/SL/Controller/CsvImport/Inventory.pm index c724fb8fc..7dbe364d8 100644 --- a/SL/Controller/CsvImport/Inventory.pm +++ b/SL/Controller/CsvImport/Inventory.pm @@ -370,7 +370,7 @@ sub handle_employee { # employee from login if not given if (!$object->employee_id) { - $object->employee_id(SL::DB::Manager::Employee->find_by(login => $::myconfig{login})->id); + $object->employee_id(SL::DB::Manager::Employee->current->id) if SL::DB::Manager::Employee->current; } if ($object->employee_id) {