if ($form->{all_customer}) {
unless ($form->{customer_id}) {
$form->{customer_id} = $form->{all_customer}->[0]->{id};
+ $form->{salesman_id} = $form->{all_customer}->[0]->{salesman_id};
}
}
"shipto" => "ALL_SHIPTO",
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
- "old_id" => \@old_project_ids });
+ "old_id" => \@old_project_ids },
+ "employees" => "ALL_SALESMEN");
my (%labels, @values);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
'-labels' => \%labels,
'-default' => $form->{"globalproject_id"}));
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{ALL_SALESMEN} }) {
+ push(@values, $item->{id});
+ $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
+ }
+
+ $salesman =
+ 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))
+ . qq|</td>
+ </tr>|;
+
# set option selected
foreach $item (qw(AR customer currency department employee)) {
$form->{"select$item"} =~ s/ selected//;
<td colspan=2><select name=employee>$form->{selectemployee}</select></td>
<input type=hidden name=selectemployee value="$form->{selectemployee}">
<td></td>
- </tr>|;
+ </tr>
+ $salesman
+|;
if ($form->{type} eq "credit_note") {
print qq| <tr>
<th align=right nowrap>| . $locale->text('Credit Note Number') . qq|</th>
sub e_mail {
$lxdebug->enter_sub();
- $form->{postasnew} = 1;
- $print_post = 1;
-
- map { delete $form->{$_} } qw(printed emailed queued);
+ $print_post = 1;
&post;