From: Moritz Bunkus Date: Mon, 22 May 2017 10:59:31 +0000 (+0200) Subject: Einkaufs- & Verkaufsbelege: Bearbeiter*in & Verkäufer*in mit aktueller Benutzer*in... X-Git-Tag: release-3.5.4~1073 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=08e820fa7a9aa4beae1da564b69a1362e6020121;p=kivitendo-erp.git Einkaufs- & Verkaufsbelege: Bearbeiter*in & Verkäufer*in mit aktueller Benutzer*in vorbelegen Dies ist nur ein Fallback, wenn bis zur Ausgabe des Form-Headers noch nichts für die beiden Felder festgelegt wurde. Damit wird also weiterhin eine Verkäufer*in aus den Kunden-/Lieferantenstammdaten genommen, sofern dort eine hinterlegt ist. Behebt #258. --- diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 7340e6648..adaeb2757 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -401,8 +401,11 @@ sub form_header { my $class = "SL::DB::" . ($form->{vc} eq 'customer' ? 'Customer' : 'Vendor'); $form->{VC_OBJ} = $class->load_cached($form->{ $form->{vc} . '_id' }); - $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; - $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + my $current_employee = SL::DB::Manager::Employee->current; + $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; + $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + $form->{employee_id} ||= $current_employee->id; + $form->{salesman_id} ||= $current_employee->id; my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; $form->get_lists("price_factors" => "ALL_PRICE_FACTORS", diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 2d196cc2b..1fe448ff7 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -391,8 +391,11 @@ sub form_header { $TMPL_VAR{customer_obj} = SL::DB::Customer->load_cached($form->{customer_id}) if $form->{customer_id}; $TMPL_VAR{invoice_obj} = SL::DB::Invoice->load_cached($form->{id}) if $form->{id}; - $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; - $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + my $current_employee = SL::DB::Manager::Employee->current; + $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; + $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + $form->{employee_id} ||= $current_employee->id; + $form->{salesman_id} ||= $current_employee->id; $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 1a4f5ca26..8f4f28ac4 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -486,8 +486,11 @@ sub form_header { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; - $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + my $current_employee = SL::DB::Manager::Employee->current; + $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; + $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; + $form->{employee_id} ||= $current_employee->id; + $form->{salesman_id} ||= $current_employee->id; # openclosed checkboxes my @tmp;