672b80226296b16db266963a480a804225a2fa87
[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}{$(template_meta.tmpfile NOESCAPE)$.table.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}{\euro}
95 \ifthenelse{\equal{$(currency)$}{YEN}}{\let\currency\textyen}{}
96 \ifthenelse{\equal{$(currency)$}{GBP}}{\let\currency\pounds}{}
97 \ifthenelse{\equal{$(currency)$}{USD}}{\let\currency\$}{}
98
99 % ---------- Ende Reportvariablen-Umsetzung ----------
100
101 % ---------- Briefkopf dazuladen ----------
102 \input{kivitendobriefkopf}
103
104 \begin{document}
105 % ---------- Schrift Hauptdokuments (Computermodern-sanserif)  ----------
106 % \fontfamily{cmss}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
107 % ---------- Schrift Helvetica ------------------------
108 \fontfamily{phv}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
109 % ---------- Firmenlogo nur erste Seite ----------
110 \thispagestyle{briefkopf}
111
112 % ---------- Datum und Nummern ----------
113 % Position unterhalb des Briefkopfs
114 \vspace*{\vlogospacing}
115 \renewcommand{\arraystretch}{0.9}
116 \begin{minipage}[b]{177mm}
117 \sperren{\textbf{Auftragsbestätigung Nr. \ordnumber}}
118 \hfill
119         \small
120         \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
121                 \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
122                 \textbf{Datum} & \orddate \\
123                 \textbf{Kunden Nr.} & \kundennummer\\
124                 \textbf{Angebot Nr.} & \docnumber\\
125                 \textbf{Auftragsbestätigung Nr.} & \ordnumber\\
126                 \nonemptyline{\textbf{Vorraussichtl. Lieferdatum} &}{\reqdate}
127                 \textbf{Ansprechpartner} & \employeename\\
128                 \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
129                 \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
130         \end{tabular}\\[10mm plus 20mm minus 10mm]
131 \end{minipage}
132 \renewcommand{\arraystretch}{1}
133 \normalsize
134 % ---------- Begrüßung und Bemerkungen ----------
135 \vspace{5mm}
136 \lettergreeting
137 wir bedanken uns für Ihren Auftrag %
138 \ifthenelse{\equal{\orddate}{\leer}}{}{vom \orddate{ }}%
139 und bestätigen Ihnen diesen wie folgt.\\
140 %Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\[1\baselineskip]
141 \ifthenelse{\isempty{$(notes)$}}{}{
142       $(notes)$\\[1\baselineskip]
143       }%
144 %Mit freundlichen Grüßen\\[1\baselineskip]
145 %\employeename\\[1\baselineskip]
146 % ---------- Die eigentliche-Tabelle ----------
147 % ---------- Tabelle puffern ----------
148 \begin{filecontents}{\employeetable}
149 % ---------- globale Variable laufsumme deklarieren ----------
150 \resetlaufsumme
151 % ---------- Spaltendefinition ----------
152 %\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
153 \begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
154 % ---------- Kopfzeile der Tabelle ----------
155         \textbf{Pos} &
156         \textbf{Art.Nr.} &
157         \textbf{Bezeichnung} &
158         \textbf{Menge} &
159         \textbf{ME} &
160         \textbf{EP/€} &
161         \textbf{GP/€} \\
162         \midrule
163   \endfirsthead
164 % ---------- Tabellenkopf nach dem Umbruch ----------
165         \textbf{Pos} &
166         \textbf{Art.Nr.} &
167         \textbf{Bezeichnung} &
168         \textbf{Menge} &
169         \textbf{ME} &
170         \textbf{EP/€} &
171         \textbf{GP/€} \\
172         \midrule
173         & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
174   \endhead
175 % ---------- Fuss der Teiltabellen ----------
176         \midrule
177         & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
178   \endfoot
179 % ---------- Das Ende der Tabelle ----------
180         \midrule
181 %       & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
182   \endlastfoot
183 % ---------- Positionen ----------
184   $(foreach number)$
185         $(runningnumber)$ &
186         $(number)$ &
187         $(description)$
188         \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
189         \renewcommand{\baselinestretch}{1}\footnotesize
190         {\footnotesize $(longdescription)$
191         \renewcommand{\baselinestretch}{1}\normalsize
192         }}
193         \ifthenelse{\equal{$(deliverydate_oe)$}{\leer}}{}{
194                 \newline Lieferdatum:~$(deliverydate_oe)$} &
195         $(qty)$ &
196         $(unit)$ &
197         \ifthenelse{\isempty{$(sellprice)$}}{&}{
198                 \numprint{$(sellprice)$}
199                 \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
200                 \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$}
201         }\\ %
202   $(end number)$
203
204 \end{longtable}
205 % ----------  Ende der Hilfsdatei ----------
206 \end{filecontents}
207 % ---------- Puffertabelle öffnen ----------
208 \LTXtable{\textwidth}{\employeetable}
209 \parbox{\textwidth}{
210 %---------- Summenbereich nach recht schieben  ----------
211 \hfill
212 \setlength{\tabcolsep}{0mm}
213 \begin{tabular}{@{}r@{ }r@{ }l}
214 %   \toprule
215    {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
216 % ---------- Alle Steuern ausweisen ----------
217    $(foreach tax)$
218 %       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
219                 {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
220    $(end tax)$
221    \midrule
222    {\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\
223    \bottomrule
224 \end{tabular}
225 }
226 % ---------- Transportmittel ----------
227 $(if shipvia)$
228 Lieferung per $(shipvia)$.\\[1em]
229 $(end)$
230 % ---------- Lieferadresse ----------
231 \ifthenelse{%
232      \equal{\shiptoname}{\name} \AND
233      \equal{\shiptodepartmentone}{\leer} \AND
234      \equal{\shiptodepartmenttwo}{\leer} \AND
235      \equal{\shiptostreet}{\street} \AND
236      \equal{\shiptozipcode}{\zipcode} \AND
237      \equal{\shiptocity}{\city}
238      }{}{
239 % ---------- Umbruch dazwischen verhindern ----------
240 \vspace*{0.5em}
241 \parbox{\textwidth}{
242 % ---------- Bereich für Lieferadresse ----------
243 \textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
244                 \shiptoname \\
245                 \nonemptyline{}{\shiptodepartmentone}
246                 \nonemptyline{}{\shiptodepartmenttwo}
247                 \shiptostreet \\
248                 \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
249                 \nonemptyline{Tel: }{\shiptophone}
250                 \nonemptyline{Fax: }{\shiptofax}
251         }%ende parbox
252 }% ende parbox
253 }% ende ifthenelse
254 $(if payment_terms)$
255 \vspace*{0.5em}
256 \textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\[1em]
257 $(end)$
258 \vspace*{0.5em}
259 %Nutzen Sie bitte für Fragen oder Änderungswünsche die oben angegebenen Kontaktmöglichkeiten.\\ \vfil
260 \parbox{\textwidth}{
261 Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\
262
263 Wir sichern Ihnen eine termin- und fachgerechte Ausführung zu.\\
264
265 \vspace{1.5\baselineskip}
266 Mit freundlichen Grüßen\\ \vfil
267 \employeename
268 }% Ende Parbox
269 \vfill
270 \footnotesize
271 Es gelten unsere Liefer- und Zahlungsbedingungen, die wir Ihnen auf Wunsch gerne zukommen lassen.
272 \end{document}