Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / templates / print / Standard / sales_order.tex
1 % sales_order.tex
2 % Auftragsbestätigung Verkauf
3 % Überarbeitet von Norbert Simon, n.simon@linet-services.de
4 % Version 2.5 vom 15. November 2011
5 % Basiert auf der Arbeit von kmk@lilalaser.de / 2007
6 % Diese Vorlage steht unter der GPL-Lizenz, Version 3
7 % siehe http://www.gnu.de/licenses/gpl-3.0.html
8 % ----------
9 % config: tag-style=$( )$
10 % ----------
11
12 \documentclass[twoside]{scrartcl}
13 \usepackage{fancyhdr}       % Für den Seitenkopf und -Fuß
14 \usepackage{ifpdf}          % Erlaubt eine Code-Weiche für PDF, oder DVI Ausgabe
15 \usepackage{xifthen}        % Allgemeine Code-Weiche
16 \usepackage{graphicx}       % Fuer die Einbindung der Logo-Graphik
17 \usepackage{german}         % Deutsche Trenn-Tabelle
18 \usepackage[utf8]{inputenc} % Umlaute direkt eingeben
19 \usepackage{textcomp}       % Sonderzeichen
20 \usepackage{lastpage}       % Fuer die Angabe "Seite 2 von 5"
21 \usepackage{filecontents}   % Um von latex aus eine Datei schreiben zu koennen
22 \usepackage{etex}           % Damit Marken verwendet werden koennen
23 \usepackage{ltxtable}       % Mehrseiten-Tabellen mit variabler Spaltenbreite
24 \usepackage{booktabs}       % Striche in Tabellen
25 \usepackage{numprint}       % Zahlen formatiert ausgeben
26 \usepackage[$(if myconfig_output_numberformat =~ "1.000,00")$german$(else)$$(if myconfig_output_numberformat =~ "1000,00")$germannosep$(else)$$(if myconfig_output_numberformat =~ "1,000.00")$english$(else)$englishnosep$(end)$$(end)$$(end)$]{zwischensumme}  % Lokales Makro zur Berechnung der Zwischensummen
27 \usepackage{microtype,relsize} %Feinpositionierung, Sperren von Text
28 \newcommand*{\sperren}[1]{\normalsize\textls*[200]{#1}} %Sperrung Überrschriften
29
30
31 % ---------- Report-Variablen zur Verwendung in kivitendobriefkopf.tex ----------
32 % ----------  Die eigenen Daten ----------
33 \newcommand{\employeename}{$(employee_name)$}
34 \newcommand{\employeecompany}{$(employee_company)$}
35 \newcommand{\employeeaddress}{$(employee_address)$}
36 \newcommand{\employeetel}{$(employee_tel)$}
37 \newcommand{\employeefax}{$(employee_fax)$}
38 \newcommand{\employeeemail}{$(employee_email)$}
39 \newcommand{\employeecoustid}{$(employee_co_ustid)$}
40 \newcommand{\employeetaxnumber}{$(employee_taxnumber)$}
41 \newcommand{\employeetable}{tabelle$(employee_login)$.tex}
42
43 % ---------- Eigene Bankverbindung falls nicht im Briefkopf gesetzt ----------
44 % \newcommand{\companybank}{$(company_bank)$}
45 % \newcommand{\companybankcode}{$(company_bank_code)$}
46 % \newcommand{\companyaccountnumber}{$(company_account_number)$}
47
48 % ---------- Adressat ----------
49 \newcommand{\name}{$(name)$}
50 \newcommand{\departmentone}{$(department_1)$}
51 \newcommand{\departmenttwo}{$(department_2)$}
52 \newcommand{\cpgreeting}{$(cp_greeting)$}
53 \newcommand{\cptitle}{$(cp_title)$}
54 \newcommand{\cpgivenname}{$(cp_givenname)$}
55 \newcommand{\cpname}{$(cp_name)$}
56 \newcommand{\street}{$(street)$}
57 \newcommand{\country}{$(country)$}
58 \newcommand{\zipcode}{$(zipcode)$}
59 \newcommand{\city}{$(city)$}
60 \newcommand{\phone}{$(customerphone)$}
61 \newcommand{\fax}{$(customerfax)$}
62 \newcommand{\lettergreeting}{
63         \ifthenelse{\equal{$(cp_gender)$}{f}}
64          {Sehr geehrte Frau $(cp_name)$,}
65         {\ifthenelse{\equal{$(cp_gender)$}{m}}
66           {Sehr geehrter Herr $(cp_name)$,}
67           {Sehr geehrte Damen und Herren,}
68         }\\[1\baselineskip]
69 }
70
71 % ---------- Bestellvariablen ----------
72 \newcommand{\quonumber}{$(quonumber)$}
73 \newcommand{\ordnumber}{$(ordnumber)$}
74 \newcommand{\docnumber}{{\quonumber}}
75 \newcommand{\orddate}{$(orddate)$}
76 \newcommand{\quodate}{$(quodate)$}
77 \newcommand{\kundennummer}{$(customernumber)$}
78 \newcommand{\reqdate}{$(reqdate)$}
79 \newcommand{\transdate}{$(transdate)$}
80
81 % ---------- Lieferadresse ----------
82 \newcommand{\shiptoname}{$(shiptoname)$}
83 \newcommand{\shiptocontact}{$(shiptocontact)$}
84 \newcommand{\shiptodepartmentone}{$(shiptodepartment_1)$}
85 \newcommand{\shiptodepartmenttwo}{$(shiptodepartment_2)$}
86 \newcommand{\shiptostreet}{$(shiptostreet)$}
87 \newcommand{\shiptocity}{$(shiptocity)$}
88 \newcommand{\shiptocountry}{$(shiptocountry)$}
89 \newcommand{\shiptophone}{$(shiptophone)$}
90 \newcommand{\shiptozipcode}{$(shiptozipcode)$}
91 \newcommand{\shiptofax}{$(shiptofax)$}
92
93 % ---------- Währungszeichen ----------
94 \newcommand{\currency}{$(currency)$}
95 \ifthenelse{\equal{\currency}{EUR}}{\let\currency\euro}{}
96 \ifthenelse{\equal{\currency}{YEN}}{\let\currency\textyen}{}
97 \ifthenelse{\equal{\currency}{GBP}}{\let\currency\pounds}{}
98 \ifthenelse{\equal{\currency}{USD}}{\let\currency\$}{}
99
100 % ---------- Ende Reportvariablen-Umsetzung ----------
101
102 % ---------- Briefkopf dazuladen ----------
103 \input{kivitendobriefkopf}
104
105 \begin{document}
106 % ---------- Schrift Hauptdokuments (Computermodern-sanserif)  ----------
107 % \fontfamily{cmss}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
108 % ---------- Schrift Helvetica ------------------------
109 \fontfamily{phv}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
110 % ---------- Firmenlogo nur erste Seite ----------
111 \thispagestyle{briefkopf}
112
113 % ---------- Datum und Nummern ----------
114 % Position unterhalb des Briefkopfs
115 \vspace*{\vlogospacing}
116 \renewcommand{\arraystretch}{0.9}
117 \begin{minipage}[b]{177mm}
118 \sperren{\textbf{Auftragsbestätigung Nr. \ordnumber}}
119 \hfill
120         \small
121         \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
122                 \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
123                 \textbf{Datum} & \orddate \\
124                 \textbf{Kunden Nr.} & \kundennummer\\
125                 \textbf{Angebot Nr.} & \docnumber\\
126                 \textbf{Auftragsbestätigung Nr.} & \ordnumber\\
127                 \nonemptyline{\textbf{Vorraussichtl. Lieferdatum} &}{\reqdate}
128                 \textbf{Ansprechpartner} & \employeename\\
129                 \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
130                 \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
131         \end{tabular}\\[10mm plus 20mm minus 10mm]
132 \end{minipage}
133 \renewcommand{\arraystretch}{1}
134 \normalsize
135 % ---------- Begrüßung und Bemerkungen ----------
136 \vspace{5mm}
137 \lettergreeting
138 wir bedanken uns für Ihren Auftrag %
139 \ifthenelse{\equal{\orddate}{\leer}}{}{vom \orddate{ }}%
140 und bestätigen Ihnen diesen wie folgt.\\
141 %Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\[1\baselineskip]
142 \ifthenelse{\isempty{$(notes)$}}{}{
143       $(notes)$\\[1\baselineskip]
144       }%
145 %Mit freundlichen Grüßen\\[1\baselineskip]
146 %\employeename\\[1\baselineskip]
147 % ---------- Die eigentliche-Tabelle ----------
148 % ---------- Tabelle puffern ----------
149 \begin{filecontents}{\employeetable}
150 % ---------- globale Variable laufsumme deklarieren ----------
151 \resetlaufsumme
152 % ---------- Spaltendefinition ----------
153 %\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
154 \begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
155 % ---------- Kopfzeile der Tabelle ----------
156         \textbf{Pos} &
157         \textbf{Art.Nr.} &
158         \textbf{Bezeichnung} &
159         \textbf{Menge} &
160         \textbf{ME} &
161         \textbf{EP/€} &
162         \textbf{GP/€} \\
163         \midrule
164   \endfirsthead
165 % ---------- Tabellenkopf nach dem Umbruch ----------
166         \textbf{Pos} &
167         \textbf{Art.Nr.} &
168         \textbf{Bezeichnung} &
169         \textbf{Menge} &
170         \textbf{ME} &
171         \textbf{EP/€} &
172         \textbf{GP/€} \\
173         \midrule
174         & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
175   \endhead
176 % ---------- Fuss der Teiltabellen ----------
177         \midrule
178         & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
179   \endfoot
180 % ---------- Das Ende der Tabelle ----------
181         \midrule
182 %       & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
183   \endlastfoot
184 % ---------- Positionen ----------
185   $(foreach number)$
186         $(runningnumber)$ &
187         $(number)$ &
188         $(description)$
189         \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
190         \renewcommand{\baselinestretch}{1}\footnotesize
191         {\footnotesize $(longdescription)$
192         \renewcommand{\baselinestretch}{1}\normalsize
193         }}
194         \ifthenelse{\equal{$(deliverydate_oe)$}{\leer}}{}{
195                 \newline Lieferdatum:~$(deliverydate_oe)$} &
196         $(qty)$ &
197         $(unit)$ &
198         \ifthenelse{\isempty{$(sellprice)$}}{&}{
199                 \numprint{$(sellprice)$}
200                 \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
201                 \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$}  
202         }\\ %
203   $(end number)$
204
205 \end{longtable}
206 % ----------  Ende der Hilfsdatei ----------
207 \end{filecontents}
208 % ---------- Puffertabelle öffnen ----------
209 \LTXtable{\textwidth}{\employeetable}
210 \parbox{\textwidth}{
211 %---------- Summenbereich nach recht schieben  ----------
212 \hfill
213 \setlength{\tabcolsep}{0mm}
214 \begin{tabular}{@{}r@{ }r@{ }l}
215 %   \toprule
216    {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
217 % ---------- Alle Steuern ausweisen ----------
218    $(foreach tax)$
219 %       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
220                 {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
221    $(end tax)$
222    \midrule
223    {\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\
224    \bottomrule
225 \end{tabular}
226 }
227 % ---------- Transportmittel ----------
228 $(if shipvia)$
229 Lieferung per $(shipvia)$.\\[1em]
230 $(end)$
231 % ---------- Lieferadresse ----------
232 \ifthenelse{%
233      \equal{\shiptoname}{\name} \AND
234      \equal{\shiptodepartmentone}{\leer} \AND
235      \equal{\shiptodepartmenttwo}{\leer} \AND
236      \equal{\shiptostreet}{\street} \AND
237      \equal{\shiptozipcode}{\zipcode} \AND
238      \equal{\shiptocity}{\city}
239      }{}{
240 % ---------- Umbruch dazwischen verhindern ----------
241 \vspace*{0.5em}
242 \parbox{\textwidth}{
243 % ---------- Bereich für Lieferadresse ----------
244 \textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
245                 \shiptoname \\
246                 \nonemptyline{}{\shiptodepartmentone}
247                 \nonemptyline{}{\shiptodepartmenttwo}
248                 \shiptostreet \\
249                 \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
250                 \nonemptyline{Tel: }{\shiptophone}
251                 \nonemptyline{Fax: }{\shiptofax}
252         }%ende parbox
253 }% ende parbox
254 }% ende ifthenelse
255 $(if payment_terms)$
256 \vspace*{0.5em}
257 \textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\[1em]
258 $(end)$
259 \vspace*{0.5em}
260 %Nutzen Sie bitte für Fragen oder Änderungswünsche die oben angegebenen Kontaktmöglichkeiten.\\ \vfil
261 \parbox{\textwidth}{
262 Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\
263
264 Wir sichern Ihnen eine termin- und fachgerechte Ausführung zu.\\
265
266 \vspace{1.5\baselineskip}
267 Mit freundlichen Grüßen\\ \vfil
268 \employeename
269 }% Ende Parbox
270 \vfill
271 \footnotesize
272 Es gelten unsere Liefer- und Zahlungsbedingungen, die wir Ihnen auf Wunsch gerne zukommen lassen.
273 \end{document}