my ($query, $sth, $null, $project_id, $deliverydate, @values);
my $exchangerate = 0;
- ($null, $form->{employee_id}) = split(/--/, $form->{employee});
- unless ($form->{employee_id}) {
+ if (!$form->{employee_id}) {
$form->get_employee($dbh);
}
@values = ();
foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
push(@values, $item->{"id"});
- $labels{$item->{"id"}} = $item->{"name"};
+ $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
}
my $employees = qq|
<tr>
<th align="right">| . $locale->text('Employee') . qq|</th>
<td>| .
- NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee_id"},
+ NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
'-values' => \@values, '-labels' => \%labels)) . qq|
</td>
</tr>|;
'-default' => $form->{"globalproject_id"}));
%labels = ();
- @values = ("");
+ @values = ();
foreach my $item (@{ $form->{ALL_SALESMEN} }) {
push(@values, $item->{id});
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
qq|<tr>
<th align="right">| . $locale->text('Salesman') . qq|</th>
<td>| .
- NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
- '-values' => \@values, '-labels' => \%labels))
+ NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id} ? $form->{salesman_id} : $form->{employee_id},
+ '-values' => \@values, '-labels' => \%labels))
. qq|</td>
</tr>|;