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};
<th align="right">[% 'Contact Person' | $T8 %]</th>
<td>
[%- IF delivered %]
- <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
- [%- 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 %]