&get_employee($self, $dbh);
}
- my $query =
- qq|INSERT INTO history_erp (trans_id, employee_id, addition, what_done, snumbers) | .
- qq|VALUES (?, ?, ?, ?, ?)|;
- my @values = (conv_i($self->{id}), conv_i($self->{employee_id}),
- $self->{addition}, $self->{what_done}, "$self->{snumbers}");
- do_query($self, $dbh, $query, @values);
+my $query =
+ qq|INSERT INTO history_erp (trans_id, employee_id, addition, what_done, snumbers) | .
+ qq|VALUES (?, (SELECT id FROM employee WHERE login = ?), ?, ?, ?)|;
+ my @values = (conv_i($self->{id}), $self->{login},
+ $self->{addition}, $self->{what_done}, "$self->{snumbers}");
+ do_query($self, $dbh, $query, @values);
$main::lxdebug->leave_sub();
}
@values = ();
foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
- push(@values, $item->{name}.qq|--|.$item->{"id"});
- $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
+ push(@values, $item->{"name"}.qq|--|.$item->{"id"});
+ $labels{$item->{"name"}.qq|--|.$item->{"id"}} = $item->{name};
}
$vc = qq|
<th align="right">| . $locale->text(ucfirst($form->{vc})) . qq|</th>
<td>| .
(($myconfig{vclimit} <= scalar(@values))
- ? qq|<input type="text" value="| . H($form->{"old$form->{vc}"}) . qq|" name="$form->{vc}">|
+ ? qq|<input type="text" value="| . H(($form->{"old$form->{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
: (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
$form->get_lists("projects" => { "key" => "ALL_PROJECTS",
"all" => 1 },
+ "employees" => "ALL_EMPLOYEES",
$vc => "ALL_" . uc($vc));
my %labels = ();
NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
'-labels' => \%labels));
+ #employees
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
+ }
+
+ my $employee = qq|
+ <tr>
+ <th align="right">| . $locale->text('Employee') . qq|</th>
+ <td>| .
+ NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ </td>
+ </tr>|;
+
%labels = ();
@values = ("");
foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
push(@values, $item->{name}.qq|--|.$item->{"id"});
- $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
+ $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"};
}
my $vc_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor');
$vc =
$myconfig{vclimit} <= scalar(@values)
- ? qq|<input type="text" value="| . H($form->{"old$form->{vc}"}) . qq|" name="$form->{vc}">|
+ ? qq|<input type="text" value="| . H(($form->{"old$form->{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
: NTI($cgi->popup_menu('-name' => "$form->{vc}",
'-default' => $form->{"old$form->{vc}"},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values,
'-labels' => \%labels));
-
$form->header;
print qq|
<th align=right>$ordlabel</th>
<td colspan=3><input name="$ordnumber" size=20></td>
</tr>
+ $employee
<tr>
<th align="right">| . $locale->text('Transaction description') . qq|</th>
<td colspan="3"><input name="transaction_description" size=20></td>