Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[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}{$(template_meta.tmpfile NOESCAPE)$.table.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}{\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 auf Seite 1 ----------
110         \thispagestyle{briefkopf}
111
112 % ---------- Datum und Nummern unterhalb des Briefkopfs ----------
113 % Position unterhalb des Briefkopfs
114 \vspace*{\vlogospacing}
115 \renewcommand{\arraystretch}{0.9}
116 \begin{minipage}[b]{177mm}
117 \ifthenelse{\isempty{\invnumber}}
118 {\sperren{\textbf{Proforma-Rechnung Nr. \quonumber}}}
119 {\sperren{\textbf{Proforma-Rechnung Nr. \invnumber}}}
120 {\tiny Bitte stets angeben}
121 \hfill
122         \small
123         \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
124                 \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
125                 \textbf{Datum} & \transdate \\
126                 \textbf{Kunden Nr.} & \kundennummer\\
127                 \ifthenelse{\isempty{\invnumber}}
128                 {\textbf{Proforma-Rechnung Nr.} & \quonumber\\}
129                 {\textbf{Proforma-Rechnung Nr.} & \invnumber\\}
130                 \nonemptyline{\textbf{Vorraussichliches Lieferdatum:} &}{\reqdate}
131                 \textbf{Ansprechpartner} & \employeename\\
132                 \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
133                 \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
134         \end{tabular}\\[10mm plus 20mm minus 10mm]
135 \end{minipage}
136 \renewcommand{\arraystretch}{1}
137 \normalsize
138 % ---------- Begrüßung und Bemerkungen ----------
139 \vspace{ 5mm}
140 \lettergreeting
141 bitte überweisen Sie den ausgewiesenen Rechnungsbetrag für Ihre
142 nachfolgend aufgeführte Bestellung auf das unten angegebene Konto.
143 \ifthenelse{\isempty{$(notes)$}}{}{
144       \newline
145       $(notes)$
146       }
147 \vspace{5mm}
148
149 % ---------- Die eigentliche-Tabelle ----------
150 % ---------- Tabelle puffern ----------
151 \begin{filecontents}{\employeetable}
152 % ---------- globale Variable laufsumme deklarieren ----------
153 \resetlaufsumme
154 % ---------- Spaltendefinition ----------
155 %\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
156 \begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
157 % ---------- Kopfzeile der Tabelle ----------
158         \textbf{Pos} &
159         \textbf{Art.Nr.} &
160         \textbf{Bezeichnung} &
161         \textbf{Menge} &
162         \textbf{ME} &
163         \textbf{EP/€} &
164         \textbf{GP/€} \\
165         \midrule
166   \endfirsthead
167 % ---------- Tabellenkopf nach dem Umbruch ----------
168         \textbf{Pos} &
169         \textbf{Art.Nr.} &
170         \textbf{Bezeichnung} &
171         \textbf{Menge} &
172         \textbf{ME} &
173         \textbf{EP/€} &
174         \textbf{GP/€} \\
175         \midrule
176         & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
177   \endhead
178 % ---------- Fuss der Teiltabellen ----------
179         \midrule
180         & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
181   \endfoot
182 % ---------- Das Ende der Tabelle ----------
183         \midrule
184 %       & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
185   \endlastfoot
186 % ---------- Positionen ----------
187   $(foreach number)$
188         $(runningnumber)$ &
189         $(number)$ &
190         $(description)$
191         \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
192         \renewcommand{\baselinestretch}{1}\footnotesize
193         {\footnotesize $(longdescription)$
194         \renewcommand{\baselinestretch}{1}\normalsize
195         }} &
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 %---------- Bereich für die Summen ----------
211 \parbox{\textwidth}{
212 %---------- Summenbereich nach recht schieben  ----------
213 \hfill
214 \setlength{\tabcolsep}{0mm}
215 \begin{tabular}{@{}r@{ }r@{ }l}
216 %   \toprule
217    {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
218 % ---------- Alle Steuern ausweisen ----------
219    $(foreach tax)$
220 %       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
221                 {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
222    $(end tax)$
223    \midrule
224         \ifthenelse{\isempty{$(ordtotal)$}}
225         {{\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(invtotal)$} & \textbf{\currency}\\}
226         {{\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\}
227    \bottomrule
228 \end{tabular}
229 }
230 % ---------- Transportmittel ----------
231 $(if shipvia)$
232 Lieferung per $(shipvia)$.\\[1em]
233 $(end)$
234 % ---------- Lieferadresse ----------
235 \ifthenelse{%
236      \equal{\shiptoname}{\name} \AND
237      \equal{\shiptodepartmentone}{\leer} \AND
238      \equal{\shiptodepartmenttwo}{\leer} \AND
239      \equal{\shiptostreet}{\street} \AND
240      \equal{\shiptozipcode}{\zipcode} \AND
241      \equal{\shiptocity}{\city}
242      }{}{
243 % ---------- Umbruch dazwischen verhindern ----------
244 \parbox{\textwidth}{
245 % ---------- Bereich für Lieferadresse ----------
246 \textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
247                 \shiptoname \\
248                 \nonemptyline{}{\shiptodepartmentone}
249                 \nonemptyline{}{\shiptodepartmenttwo}
250                 \shiptostreet \\
251                 \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
252                 \nonemptyline{Tel: }{\shiptophone}
253                 \nonemptyline{Fax: }{\shiptofax}
254         }%ende parbox
255 }% ende parbox
256 }% ende ifthenelse
257 % ---------- Nachbemerkung mit variablem Abstand ----------
258 $(if reqdate)$
259 \vspace*{0.5em}
260 \textbf{Das Angebot ist gültig bis zum \reqdate.}\\
261 $(end)$
262 $(if payment_terms)$
263 \vspace*{0.5em}
264 \textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\
265 $(end)$
266 \vspace*{0.5em}
267 Die Ware bleibt bis zur vollständigen Bezahlung unser Eigentum.
268 $(if reqdate)$
269 \vspace*{0.5em}
270 Sollte bis zum \reqdate{ }kein Zahlungseingang erfolgen, ist der Vertrag hinfällig.
271 $(end)$
272 \vspace*{0.5em}
273 Nutzen Sie bitte für Fragen oder Änderungswünsche die oben angegebenen Kontaktmöglichkeiten.\\ \vfil
274 \parbox{\textwidth}{
275 \vspace*{1em}
276 Mit freundlichen Grüßen\\ \vfil
277 \employeename
278 } % parbox
279 \vfill
280 \footnotesize
281 Es gelten unsere AGB, die wir Ihnen -- falls nicht zur Hand oder unbekannt -- gern zusenden.
282
283 \end{document}