Merge remote branch 'origin/master'
[kivitendo-erp.git] / templates / print / Standard / proforma.tex
1 % proforma.tex  für LX-Office ab V2.6.3
2 % Proforma Rechnung 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 % ---------- Report-Variablen für kivitendobriefkopf.tex ----------
31 % ---------- Die eigenen Daten ----------
32 \newcommand{\employeename}{$(employee_name)$}
33 \newcommand{\employeecompany}{$(employee_company)$}
34 \newcommand{\employeeaddress}{$(employee_address)$}
35 \newcommand{\employeetel}{$(employee_tel)$}
36 \newcommand{\employeefax}{$(employee_fax)$}
37 \newcommand{\employeeemail}{$(employee_email)$}
38 \newcommand{\employeecoustid}{$(employee_co_ustid)$}
39 \newcommand{\employeetaxnumber}{$(employee_taxnumber)$}
40 \newcommand{\employeetable}{tabelle$(employee_login)$.tex}
41
42 % ---------- eigene Bankverbindung falls nicht im Briefkopf ----------
43 % \newcommand{\companybank}{$(company_bank)$}
44 % \newcommand{\companybankcode}{$(company_bank_code)$}
45 % \newcommand{\companyaccountnumber}{$(company_account_number)$}
46
47 % ---------- Adressat ----------
48 \newcommand{\name}{$(name)$}
49 \newcommand{\departmentone}{$(department_1)$}
50 \newcommand{\departmenttwo}{$(department_2)$}
51 \newcommand{\cpgreeting}{$(cp_greeting)$}
52 \newcommand{\cptitle}{$(cp_title)$}
53 \newcommand{\cpgivenname}{$(cp_givenname)$}
54 \newcommand{\cpname}{$(cp_name)$}
55 \newcommand{\street}{$(street)$}
56 \newcommand{\country}{$(country)$}
57 \newcommand{\zipcode}{$(zipcode)$}
58 \newcommand{\city}{$(city)$}
59 \newcommand{\phone}{$(customerphone)$}
60 \newcommand{\fax}{$(customerfax)$}
61 \newcommand{\lettergreeting}{
62         \ifthenelse{\equal{$(cp_gender)$}{f}}
63          {Sehr geehrte Frau $(cp_name)$,}
64         {\ifthenelse{\equal{$(cp_gender)$}{m}}
65           {Sehr geehrter Herr $(cp_name)$,}
66           {Sehr geehrte Damen und Herren,}
67         }\\[1\baselineskip]
68 }
69
70 % ---------- Bestellvariablen ----------
71 \newcommand{\quonumber}{$(quonumber)$}          % Angebotsnummer
72 \newcommand{\ordnumber}{$(ordnumber)$}          % Auftragsnummer bei uns
73 \newcommand{\cusordnumber}{$(cusordnumber)$}    % Auftragsnummer beim Kunden
74 \newcommand{\invnumber}{$(invnumber)$}          % Rechnungsnummer
75 \newcommand{\docnumber}{Proforma ReNr. {\ordnumber}} % \quonumber
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ährung setzen  ----------
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 auf Seite 1 ----------
111         \thispagestyle{briefkopf}
112
113 % ---------- Datum und Nummern unterhalb des Briefkopfs ----------
114 % Position unterhalb des Briefkopfs
115 \vspace*{\vlogospacing}
116 \renewcommand{\arraystretch}{0.9}
117 \begin{minipage}[b]{177mm}
118 \ifthenelse{\isempty{\invnumber}}
119 {\sperren{\textbf{Proforma-Rechnung Nr. \quonumber}}}
120 {\sperren{\textbf{Proforma-Rechnung Nr. \invnumber}}}
121 {\tiny Bitte stets angeben}
122 \hfill
123         \small
124         \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
125                 \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
126                 \textbf{Datum} & \transdate \\
127                 \textbf{Kunden Nr.} & \kundennummer\\
128                 \ifthenelse{\isempty{\invnumber}}
129                 {\textbf{Proforma-Rechnung Nr.} & \quonumber\\}
130                 {\textbf{Proforma-Rechnung Nr.} & \invnumber\\}
131                 \nonemptyline{\textbf{Vorraussichliches Lieferdatum:} &}{\reqdate}
132                 \textbf{Ansprechpartner} & \employeename\\
133                 \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
134                 \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
135         \end{tabular}\\[10mm plus 20mm minus 10mm]
136 \end{minipage}
137 \renewcommand{\arraystretch}{1}
138 \normalsize
139 % ---------- Begrüßung und Bemerkungen ----------
140 \vspace{ 5mm}
141 \lettergreeting
142 bitte überweisen Sie den ausgewiesenen Rechnungsbetrag für Ihre
143 nachfolgend aufgeführte Bestellung auf das unten angegebene Konto.
144 \ifthenelse{\isempty{$(notes)$}}{}{
145       \newline
146       $(notes)$
147       }
148 \vspace{5mm}
149
150 % ---------- Die eigentliche-Tabelle ----------
151 % ---------- Tabelle puffern ----------
152 \begin{filecontents}{\employeetable}
153 % ---------- globale Variable laufsumme deklarieren ----------
154 \resetlaufsumme
155 % ---------- Spaltendefinition ----------
156 %\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
157 \begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
158 % ---------- Kopfzeile der Tabelle ----------
159         \textbf{Pos} &
160         \textbf{Art.Nr.} &
161         \textbf{Bezeichnung} &
162         \textbf{Menge} &
163         \textbf{ME} &
164         \textbf{EP/€} &
165         \textbf{GP/€} \\
166         \midrule
167   \endfirsthead
168 % ---------- Tabellenkopf nach dem Umbruch ----------
169         \textbf{Pos} &
170         \textbf{Art.Nr.} &
171         \textbf{Bezeichnung} &
172         \textbf{Menge} &
173         \textbf{ME} &
174         \textbf{EP/€} &
175         \textbf{GP/€} \\
176         \midrule
177         & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
178   \endhead
179 % ---------- Fuss der Teiltabellen ----------
180         \midrule
181         & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
182   \endfoot
183 % ---------- Das Ende der Tabelle ----------
184         \midrule
185 %       & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
186   \endlastfoot
187 % ---------- Positionen ----------
188   $(foreach number)$
189         $(runningnumber)$ &
190         $(number)$ &
191         $(description)$
192         \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
193         \renewcommand{\baselinestretch}{1}\footnotesize
194         {\footnotesize $(longdescription)$
195         \renewcommand{\baselinestretch}{1}\normalsize
196         }} &
197         $(qty)$ &
198         $(unit)$ &
199         \ifthenelse{\isempty{$(sellprice)$}}{&}{
200                 \numprint{$(sellprice)$}
201                 \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
202                 \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$}  
203         }\\ %
204   $(end number)$
205
206 \end{longtable}
207 % ----------  Ende der Hilfsdatei ----------
208 \end{filecontents}
209 % ---------- Puffertabelle öffnen ----------
210 \LTXtable{\textwidth}{\employeetable}
211 %---------- Bereich für die Summen ----------
212 \parbox{\textwidth}{
213 %---------- Summenbereich nach recht schieben  ----------
214 \hfill
215 \setlength{\tabcolsep}{0mm}
216 \begin{tabular}{@{}r@{ }r@{ }l}
217 %   \toprule
218    {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
219 % ---------- Alle Steuern ausweisen ----------
220    $(foreach tax)$
221 %       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
222                 {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
223    $(end tax)$
224    \midrule
225         \ifthenelse{\isempty{$(ordtotal)$}}
226         {{\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(invtotal)$} & \textbf{\currency}\\}
227         {{\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\}
228    \bottomrule
229 \end{tabular}
230 }
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 \parbox{\textwidth}{
246 % ---------- Bereich für Lieferadresse ----------
247 \textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
248                 \shiptoname \\
249                 \nonemptyline{}{\shiptodepartmentone}
250                 \nonemptyline{}{\shiptodepartmenttwo}
251                 \shiptostreet \\
252                 \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
253                 \nonemptyline{Tel: }{\shiptophone}
254                 \nonemptyline{Fax: }{\shiptofax}
255         }%ende parbox
256 }% ende parbox
257 }% ende ifthenelse
258 % ---------- Nachbemerkung mit variablem Abstand ----------
259 $(if reqdate)$
260 \vspace*{0.5em}
261 \textbf{Das Angebot ist gültig bis zum \reqdate.}\\
262 $(end)$
263 $(if payment_terms)$
264 \vspace*{0.5em}
265 \textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\
266 $(end)$
267 \vspace*{0.5em}
268 Die Ware bleibt bis zur vollständigen Bezahlung unser Eigentum.
269 $(if reqdate)$
270 \vspace*{0.5em}
271 Sollte bis zum \reqdate{ }kein Zahlungseingang erfolgen, ist der Vertrag hinfällig.
272 $(end)$
273 \vspace*{0.5em}
274 Nutzen Sie bitte für Fragen oder Änderungswünsche die oben angegebenen Kontaktmöglichkeiten.\\ \vfil
275 \parbox{\textwidth}{
276 \vspace*{1em}
277 Mit freundlichen Grüßen\\ \vfil
278 \employeename
279 } % parbox
280 \vfill
281 \footnotesize
282 Es gelten unsere AGB, die wir Ihnen -- falls nicht zur Hand oder unbekannt -- gern zusenden.
283
284 \end{document}