1107 |
1107 |
# Copy the notes from the invoice/sales order etc. back to the variable "notes" because that is where most templates expect it to be.
|
1108 |
1108 |
$self->{"notes"} = $self->{ $self->{"formname"} . "notes" };
|
1109 |
1109 |
|
1110 |
|
map({ $self->{"employee_${_}"} = $myconfig->{$_}; }
|
1111 |
|
qw(email tel fax name signature company address businessnumber
|
1112 |
|
co_ustid taxnumber duns));
|
|
1110 |
if (!$self->{employee_id}) {
|
|
1111 |
map { $self->{"employee_${_}"} = $myconfig->{$_}; } qw(email tel fax name signature company address businessnumber co_ustid taxnumber duns);
|
|
1112 |
}
|
1113 |
1113 |
|
1114 |
1114 |
map({ $self->{"${_}"} = $myconfig->{$_}; }
|
1115 |
1115 |
qw(co_ustid));
|
... | ... | |
1883 |
1883 |
$main::lxdebug->leave_sub();
|
1884 |
1884 |
}
|
1885 |
1885 |
|
1886 |
|
sub get_salesman {
|
|
1886 |
sub get_employee_data {
|
1887 |
1887 |
$main::lxdebug->enter_sub();
|
1888 |
1888 |
|
1889 |
|
my ($self, $myconfig, $salesman_id) = @_;
|
|
1889 |
my $self = shift;
|
|
1890 |
my %params = @_;
|
|
1891 |
|
|
1892 |
Common::check_params(\%params, qw(prefix));
|
|
1893 |
Common::check_params_x(\%params, qw(id));
|
|
1894 |
|
|
1895 |
if (!$params{id}) {
|
|
1896 |
$main::lxdebug->leave_sub();
|
|
1897 |
return;
|
|
1898 |
}
|
1890 |
1899 |
|
1891 |
|
$main::lxdebug->leave_sub() and return unless $salesman_id;
|
|
1900 |
my $myconfig = \%main::myconfig;
|
|
1901 |
my $dbh = $params{dbh} || $self->get_standard_dbh($myconfig);
|
1892 |
1902 |
|
1893 |
|
my $dbh = $self->get_standard_dbh($myconfig);
|
1894 |
|
my ($login) = selectrow_query($self, $dbh, qq|SELECT login FROM employee WHERE id = ?|, $salesman_id);
|
|
1903 |
my ($login) = selectrow_query($self, $dbh, qq|SELECT login FROM employee WHERE id = ?|, conv_i($params{id}));
|
1895 |
1904 |
|
1896 |
1905 |
if ($login) {
|
1897 |
1906 |
my $user = User->new($login);
|
1898 |
|
map { $self->{"salesman_$_"} = $user->{$_}; } qw(address businessnumber co_ustid company duns email fax name signature taxnumber tel);
|
|
1907 |
map { $self->{$params{prefix} . "_${_}"} = $user->{$_}; } qw(address businessnumber co_ustid company duns email fax name signature taxnumber tel);
|
1899 |
1908 |
|
1900 |
|
$self->{salesman_login} = $login;
|
1901 |
|
$self->{salesman_name} ||= $login;
|
|
1909 |
$self->{$params{prefix} . '_login'} = $login;
|
|
1910 |
$self->{$params{prefix} . '_name'} ||= $login;
|
1902 |
1911 |
}
|
1903 |
1912 |
|
1904 |
1913 |
$main::lxdebug->leave_sub();
|
Bei $form->parse_template() nur dann die ganzen Variablen employee_* überschreiben, wenn employee_id nicht gesetzt ist. In io.pl die ganzen employee_*-Variablen mit denen des ausgewählten Bearbeiters belegen und nicht mit denen des aktuellen Benutzers.