Merge remote branch 'origin/master'
[kivitendo-erp.git] / templates / print / Standard / sales_quotation.tex
1 % salex_quotation.tex
2 % Verkauf - Angebot
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{\docnumber}{Angebot Nr. {\quonumber}}
74 \newcommand{\quodate}{$(quodate)$}
75 \newcommand{\kundennummer}{$(customernumber)$}
76 \newcommand{\reqdate}{$(reqdate)$}
77
78 % ---------- Lieferadresse ----------
79 \newcommand{\shiptoname}{$(shiptoname)$}
80 \newcommand{\shiptocontact}{$(shiptocontact)$}
81 \newcommand{\shiptodepartmentone}{$(shiptodepartment_1)$}
82 \newcommand{\shiptodepartmenttwo}{$(shiptodepartment_2)$}
83 \newcommand{\shiptostreet}{$(shiptostreet)$}
84 \newcommand{\shiptocity}{$(shiptocity)$}
85 \newcommand{\shiptocountry}{$(shiptocountry)$}
86 \newcommand{\shiptophone}{$(shiptophone)$}
87 \newcommand{\shiptozipcode}{$(shiptozipcode)$}
88 \newcommand{\shiptofax}{$(shiptofax)$}
89
90 % ---------- Währungszeichen ----------
91 \newcommand{\currency}{$(currency)$}
92 \ifthenelse{\equal{\currency}{EUR}}{\let\currency\euro}{}
93 \ifthenelse{\equal{\currency}{YEN}}{\let\currency\textyen}{}
94 \ifthenelse{\equal{\currency}{GBP}}{\let\currency\pounds}{}
95 \ifthenelse{\equal{\currency}{USD}}{\let\currency\$}{}
96
97 % ---------- Ende Reportvariablen-Umsetzung ----------
98
99 % ---------- Briefkopf dazuladen ----------
100 \input{kivitendobriefkopf}
101
102 \begin{document}
103 % ---------- Schrift Hauptdokuments (Computermodern-sanserif)  ----------
104 % \fontfamily{cmss}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
105 % ---------- Schrift Helvetica ------------------------
106 \fontfamily{phv}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
107 % ---------- Firmenlogo nur erste Seite ----------
108 \thispagestyle{briefkopf}
109
110 % ---------- Datum und Nummern ----------
111 % Position unterhalb des Briefkopfs
112 \vspace*{\vlogospacing}
113 \renewcommand{\arraystretch}{0.9}
114 \begin{minipage}[b]{177mm}
115 \sperren{\textbf{Angebot Nr. \quonumber}}
116 \hfill
117         \small
118         \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
119                 \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
120                 \textbf{Datum} & \quodate \\
121                 \nonemptyline{\textbf{Gültig bis} &}{\reqdate}
122                 \textbf{Kunden Nr.} & \kundennummer\\
123                 \textbf{Angebot Nr.} & \quonumber\\
124                 \textbf{Ansprechpartner} & \employeename\\
125                 \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
126                 \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
127         \end{tabular}\\[10mm plus 20mm minus 10mm]
128 \end{minipage}
129 \renewcommand{\arraystretch}{1}
130 \normalsize
131 % ---------- Begrüßung und Bemerkungen ----------
132 \vspace{5mm}
133 \lettergreeting
134 wir bedanken uns für Ihre Anfrage und bieten Ihnen gemäß unserer Liefer- und Zahlungsbedingungen hiermit freibleibend die nachfolgenden Positionen an.
135 \ifthenelse{\isempty{$(notes)$}}{}{
136       \newline
137       $(notes)$
138       }
139 \vspace{5mm}
140
141 % ---------- Die eigentliche-Tabelle ----------
142 % ---------- Tabelle puffern ----------
143 \begin{filecontents}{\employeetable}
144 % ---------- globale Variable laufsumme deklarieren ----------
145 \resetlaufsumme
146 % ---------- Spaltendefinition ----------
147 %\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
148 \begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
149 % ---------- Kopfzeile der Tabelle ----------
150         \textbf{Pos} &
151         \textbf{Art.Nr.} &
152         \textbf{Bezeichnung} &
153         \textbf{Menge} &
154         \textbf{ME} &
155         \textbf{EP/€} &
156         \textbf{GP/€} \\
157         \midrule
158   \endfirsthead
159 % ---------- Tabellenkopf nach dem Umbruch ----------
160         \textbf{Pos} &
161         \textbf{Art.Nr.} &
162         \textbf{Bezeichnung} &
163         \textbf{Menge} &
164         \textbf{ME} &
165         \textbf{EP/€} &
166         \textbf{GP/€} \\
167         \midrule
168         & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
169   \endhead
170 % ---------- Fuss der Teiltabellen ----------
171         \midrule
172         & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
173   \endfoot
174 % ---------- Das Ende der Tabelle ----------
175         \midrule
176 %       & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
177   \endlastfoot
178 % ---------- Positionen ----------
179   $(foreach number)$
180         $(runningnumber)$ &
181         $(number)$ &
182         $(description)$
183         \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
184         \renewcommand{\baselinestretch}{1}\footnotesize
185         {\footnotesize $(longdescription)$
186         \renewcommand{\baselinestretch}{1}\normalsize
187         }} &
188         $(qty)$ &
189         $(unit)$ &
190         \ifthenelse{\isempty{$(sellprice)$}}{&}{
191                 \numprint{$(sellprice)$}
192                 \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
193                 \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$}  
194         }\\ %
195   $(end number)$
196
197 \end{longtable}
198 % ----------  Ende der Hilfsdatei ----------
199 \end{filecontents}
200 % ---------- Puffertabelle öffnen ----------
201 \LTXtable{\textwidth}{\employeetable}
202 %---------- Bereich für die Summen ----------
203 \parbox{\textwidth}{
204 %---------- Summenbereich nach rechts schieben  ----------
205 \hfill
206 \setlength{\tabcolsep}{0mm}
207 \begin{tabular}{@{}r@{ }r@{ }l}
208 %   \toprule
209    {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
210 % ---------- Alle Steuern ausweisen ----------
211    $(foreach tax)$
212 %       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
213                 {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
214    $(end tax)$
215    \midrule
216    {\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\
217    \bottomrule
218 \end{tabular}
219 }
220 % ---------- Nachbemerkung mit variablem Abstand ----------
221 \vfil
222 $(if reqdate)$
223 \vspace*{0.3em}
224 \textbf{Das Angebot ist gültig bis zum \reqdate.}\\
225 \vfil
226 $(end)$
227 $(if payment_terms)$
228 \textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\
229 \vfil
230 $(end)$
231 % ---------- Transportmittel ----------
232 $(if shipvia)$
233 Lieferung per $(shipvia)$.\\[1em]
234 $(end)$
235 % ---------- Lieferadresse ----------
236 \ifthenelse{%
237          \equal{\shiptoname}{\name} \AND
238          \equal{\shiptodepartmentone}{\leer} \AND
239          \equal{\shiptodepartmenttwo}{\leer} \AND
240          \equal{\shiptostreet}{\street} \AND
241          \equal{\shiptozipcode}{\zipcode} \AND
242          \equal{\shiptocity}{\city}
243  }{}{
244 % ---------- Umbruch dazwischen verhindern ----------
245 \vspace*{0.5em}
246 \parbox{\textwidth}{
247 % ---------- Bereich für Lieferadresse ----------
248 \textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
249                                 \shiptoname \\
250                                 \nonemptyline{}{\shiptodepartmentone}
251                                 \nonemptyline{}{\shiptodepartmenttwo}
252                                 \shiptostreet \\
253                                 \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
254                                 \nonemptyline{Tel: }{\shiptophone}
255                                 \nonemptyline{Fax: }{\shiptofax}
256                         }%ende parbox
257         }% ende parbox
258 }% ende ifthenelse
259 \vspace*{0.5em}
260 \parbox{\textwidth}{
261 Sollten Sie Fragen zu unserem Angebot haben, steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.
262 Wir hoffen, dass unser Angebot Ihre Zustimmung findet und würden uns freuen Ihren Auftrag zu erhalten.\par
263 \vspace{1.5\baselineskip}
264 Mit freundlichen Grüßen\\ \vfil
265 \employeename
266 }% Ende parbox
267 %\vspace{1.5\baselineskip}
268 \vfill
269 \textbf{Wollen Sie direkt bestellen?}\\[1.2em]
270 \small{Machen Sie durch Ihren Stempel und Ihre Unterschrift unser Angebot Nr. \quonumber \ zum Auftrag.}\\[1.2em]
271 \vspace{2.5\baselineskip}\\
272 \rule{20em}{0.1pt}\\
273 \hspace*{5em}Datum, Unterschrift \\
274 \vfill
275 \footnotesize
276 Es gelten unsere Liefer- und Zahlungsbedingungen, die wir Ihnen auf Wunsch gerne zukommen lassen.
277 \end{document}