From 08e820fa7a9aa4beae1da564b69a1362e6020121 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 May 2017 12:59:31 +0200 Subject: [PATCH] =?utf8?q?Einkaufs-=20&=20Verkaufsbelege:=20Bearbeiter*in?= =?utf8?q?=20&=20Verk=C3=A4ufer*in=20mit=20aktueller=20Benutzer*in=20vorbe?= =?utf8?q?legen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- bin/mozilla/do.pl | 7 +++++-- bin/mozilla/is.pl | 7 +++++-- bin/mozilla/oe.pl | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) 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; -- 2.20.1