From 0a3d4b1595fad7895702b947272ce52381ff3589 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 4 Aug 2017 15:07:22 +0200 Subject: [PATCH] Einkaufslieferscheine: Fix: Anzeige Ansprechperson wenn geliefert --- bin/mozilla/do.pl | 1 + templates/webpages/do/form_header.html | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 4652e7c00..5d86682c6 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -401,6 +401,7 @@ sub form_header { my $class = "SL::DB::" . ($form->{vc} eq 'customer' ? 'Customer' : 'Vendor'); $form->{VC_OBJ} = $class->load_cached($form->{ $form->{vc} . '_id' }); + $form->{CONTACT_OBJ} = $form->{cp_id} ? SL::DB::Contact->load_cached($form->{cp_id}) : undef; 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}; diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index 06ef6da05..62ba79f4a 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -147,10 +147,8 @@ [% 'Contact Person' | $T8 %] [%- IF delivered %] - - [%- IF cp_id == row.cp_id %] - [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%] - [%- END %] + [% L.hidden_tag("cp_id", cp_id) %] + [% HTML.escape(CONTACT_OBJ.full_name) %][% IF CONTACT_OBJ.cp_abteilung %] ([% HTML.escape(CONTACT_OBJ.cp_abteilung) %])[% END %] [%- ELSE %] [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style='width: 250px') %] [%- END %] -- 2.20.1