From: G. Richardson Date: Wed, 14 Sep 2016 11:15:30 +0000 (+0200) Subject: FlattenToForm - Employee-Daten mit integrieren X-Git-Tag: release-3.5.4~2038 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=91a32996446e5f7cc637ae2f3eb5188dd5042b31;p=kivitendo-erp.git FlattenToForm - Employee-Daten mit integrieren Wenn Rechnungen per flatten_to_form gedruckt werden, sollten auch die Druckvorlagenvariablen employee_tel, employee_fax und employee_email im Template zur Verfügung stehen. Diese Daten stehen aber nur in der $::auth. --- diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index 7a3922c99..cda59e7d6 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -52,6 +52,11 @@ sub flatten_to_form { _copy($self->salesman, $form, 'salesman_', '', 0, map { $_->name } SL::DB::Employee->meta->columns) if _has($self, 'salesman_id'); _copy($self->acceptance_confirmed_by, $form, 'acceptance_confirmed_by_', '', 0, map { $_->name } SL::DB::Employee->meta->columns) if _has($self, 'acceptance_confirmed_by_id'); + if (_has($self, 'employee_id')) { + my $user = User->new(login => $self->employee->login); + $form->{"employee_$_"} = $user->{$_} for qw(tel email fax); + } + $form->{employee} = $self->employee->name if _has($self, 'employee_id'); $form->{language} = $self->language->template_code if _has($self, 'language_id'); $form->{department} = $self->department->description if _has($self, 'department_id');