From afe8a81b6245af6a09f5dc822f311be19bc90ca6 Mon Sep 17 00:00:00 2001
From: Moritz Bunkus
Date: Mon, 26 Mar 2007 08:30:12 +0000
Subject: [PATCH] =?utf8?q?Beim=20Ausdruck=20die=20Variablen=20f=C3=BCr=20d?=
=?utf8?q?en=20Verk=C3=A4ufer=20(salesman=5F*)=20f=C3=BCllen.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
---
SL/Form.pm | 52 +++++++++++---------
bin/mozilla/io.pl | 3 ++
doc/dokumentenvorlagen-und-variablen.html | 60 ++++++++++++++++++++++-
3 files changed, 91 insertions(+), 24 deletions(-)
diff --git a/SL/Form.pm b/SL/Form.pm
index 3f1e877d2..d690be1c1 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -44,6 +44,7 @@ use SL::Template;
use CGI::Ajax;
use SL::DBUtils;
use SL::Menu;
+use SL::User;
use CGI;
sub _input_to_hash {
@@ -1377,6 +1378,35 @@ sub get_employee {
$main::lxdebug->leave_sub();
}
+sub get_salesman {
+ $main::lxdebug->enter_sub();
+
+ my ($self, $myconfig, $salesman_id) = @_;
+
+ my $dbh = $self->dbconnect($myconfig);
+
+ my ($login) =
+ selectrow_query($self, $dbh, qq|SELECT login FROM employee WHERE id = ?|,
+ $salesman_id);
+
+ if ($login) {
+ my $user = new User($main::memberfile, $login);
+ map({ $self->{"salesman_$_"} = $user->{$_}; }
+ qw(address businessnumber co_ustid company duns email fax name
+ taxnumber tel));
+ $self->{salesman_login} = $login;
+
+ $self->{salesman_name} = $login
+ if ($self->{salesman_name} eq "");
+
+ map({ $self->{"salesman_$_"} =~ s/\\n/\n/g; } qw(address company));
+ }
+
+ $dbh->disconnect();
+
+ $main::lxdebug->leave_sub();
+}
+
sub get_duedate {
$main::lxdebug->enter_sub();
@@ -2498,28 +2528,6 @@ sub update_business {
return $var;
}
-sub get_salesman {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $salesman) = @_;
-
- my $dbh = $self->dbconnect($myconfig);
- my $query =
- qq|SELECT id, name FROM customer WHERE (customernumber ilike '%$salesman%' OR name ilike '%$salesman%') AND business_id in (SELECT id from business WHERE salesman)|;
- my $sth = $dbh->prepare($query);
- $sth->execute || $self->dberror($query);
-
- my $i = 0;
- while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
- push(@{ $self->{salesman_list} }, $ref);
- $i++;
- }
- $dbh->commit;
- $main::lxdebug->leave_sub();
-
- return $i;
-}
-
sub get_partsgroup {
$main::lxdebug->enter_sub();
diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl
index 56cdd2f84..f20d4e5d2 100644
--- a/bin/mozilla/io.pl
+++ b/bin/mozilla/io.pl
@@ -1894,6 +1894,7 @@ sub print_form {
$language_saved = $form->{language_id};
$payment_id_saved = $form->{payment_id};
+ $salesman_id_saved = $form->{salesman_id};
&{"$form->{vc}_details"}();
@@ -1923,6 +1924,8 @@ sub print_form {
IS->invoice_details(\%myconfig, \%$form, $locale);
}
+ $form->get_salesman(\%myconfig, $salesman_id_saved);
+
if ($form->{shipto_id}) {
$form->get_shipto(\%myconfig);
}
diff --git a/doc/dokumentenvorlagen-und-variablen.html b/doc/dokumentenvorlagen-und-variablen.html
index 3e68a63eb..fe7d321cb 100644
--- a/doc/dokumentenvorlagen-und-variablen.html
+++ b/doc/dokumentenvorlagen-und-variablen.html
@@ -55,6 +55,9 @@ td {
Stammdaten von Kunden und Lieferanten
+
+ Informationen über den Bearbeiter
+
Informationen über den Verkäufer
@@ -390,8 +393,8 @@ td {
sondern schlicht Kopien der Lieferdatenvariablen sind
(z.B. shiptocontact
).
-
+
@@ -443,6 +446,59 @@ td {
+
+
+
+
+ Variablenname | Bedeutung |
+
+ salesman_address |
+ Adressfeld |
+
+
+ salesman_businessnumber |
+ Firmennummer |
+
+
+ salesman_company |
+ Firmenname |
+
+
+ salesman_co_ustid |
+ Usatzsteuer-Identifikationsnummer |
+
+
+ salesman_duns |
+ DUNS-Nummer |
+
+
+ salesman_email |
+ Email |
+
+
+ salesman_fax |
+ Fax |
+
+
+ salesman_name |
+ voller Name |
+
+
+ salesman_signature |
+ Signatur |
+
+
+ salesman_taxnumber |
+ Steuernummer |
+
+
+ salesman_tel |
+ Telefonnummer |
+
+
+
+
--
2.20.1