%::myconfig dem Client javascript zur Verfügung stellen.
[kivitendo-erp.git] / templates / print / Standard / sales_order.tex
index 7cc8d82..672b802 100644 (file)
-\documentclass[twoside]{scrartcl}
-\usepackage{eurosym}
-\usepackage{tabularx}
-\usepackage[utf8]{inputenc}
-\begin{document}
-
-\thispagestyle{empty}
-
-\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
-\setlength{\parindent}{0cm}
+% sales_order.tex
+% Auftragsbestätigung Verkauf
+% Überarbeitet von Norbert Simon, n.simon@linet-services.de
+% Version 2.5 vom 15. November 2011
+% Basiert auf der Arbeit von kmk@lilalaser.de / 2007
+% Diese Vorlage steht unter der GPL-Lizenz, Version 3
+% siehe http://www.gnu.de/licenses/gpl-3.0.html
+% ----------
+% config: tag-style=$( )$
+% ----------
 
-\fontfamily{cmss}\fontshape{n}\selectfont
+\documentclass[twoside]{scrartcl}
+\usepackage{fancyhdr}       % Für den Seitenkopf und -Fuß
+\usepackage{ifpdf}          % Erlaubt eine Code-Weiche für PDF, oder DVI Ausgabe
+\usepackage{xifthen}        % Allgemeine Code-Weiche
+\usepackage{graphicx}       % Fuer die Einbindung der Logo-Graphik
+\usepackage{german}         % Deutsche Trenn-Tabelle
+\usepackage[utf8]{inputenc} % Umlaute direkt eingeben
+\usepackage{textcomp}       % Sonderzeichen
+\usepackage{lastpage}       % Fuer die Angabe "Seite 2 von 5"
+\usepackage{filecontents}   % Um von latex aus eine Datei schreiben zu koennen
+\usepackage{etex}           % Damit Marken verwendet werden koennen
+\usepackage{ltxtable}       % Mehrseiten-Tabellen mit variabler Spaltenbreite
+\usepackage{booktabs}      % Striche in Tabellen
+\usepackage{numprint}       % Zahlen formatiert ausgeben
+\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
+\usepackage{microtype,relsize} %Feinpositionierung, Sperren von Text
+\newcommand*{\sperren}[1]{\normalsize\textls*[200]{#1}} %Sperrung Überrschriften
 
-\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
 
-\vspace*{1.5cm}
+% ---------- Report-Variablen zur Verwendung in kivitendobriefkopf.tex ----------
+% ----------  Die eigenen Daten ----------
+\newcommand{\employeename}{$(employee_name)$}
+\newcommand{\employeecompany}{$(employee_company)$}
+\newcommand{\employeeaddress}{$(employee_address)$}
+\newcommand{\employeetel}{$(employee_tel)$}
+\newcommand{\employeefax}{$(employee_fax)$}
+\newcommand{\employeeemail}{$(employee_email)$}
+\newcommand{\employeecoustid}{$(employee_co_ustid)$}
+\newcommand{\employeetaxnumber}{$(employee_taxnumber)$}
+\newcommand{\employeetable}{$(template_meta.tmpfile NOESCAPE)$.table.tex}
 
-\begin{minipage}{8cm}
-  <%name%>
+% ---------- Eigene Bankverbindung falls nicht im Briefkopf gesetzt ----------
+% \newcommand{\companybank}{$(company_bank)$}
+% \newcommand{\companybankcode}{$(company_bank_code)$}
+% \newcommand{\companyaccountnumber}{$(company_account_number)$}
 
-  <%street%>
+% ---------- Adressat ----------
+\newcommand{\name}{$(name)$}
+\newcommand{\departmentone}{$(department_1)$}
+\newcommand{\departmenttwo}{$(department_2)$}
+\newcommand{\cpgreeting}{$(cp_greeting)$}
+\newcommand{\cptitle}{$(cp_title)$}
+\newcommand{\cpgivenname}{$(cp_givenname)$}
+\newcommand{\cpname}{$(cp_name)$}
+\newcommand{\street}{$(street)$}
+\newcommand{\country}{$(country)$}
+\newcommand{\zipcode}{$(zipcode)$}
+\newcommand{\city}{$(city)$}
+\newcommand{\phone}{$(customerphone)$}
+\newcommand{\fax}{$(customerfax)$}
+\newcommand{\lettergreeting}{
+       \ifthenelse{\equal{$(cp_gender)$}{f}}
+        {Sehr geehrte Frau $(cp_name)$,}
+       {\ifthenelse{\equal{$(cp_gender)$}{m}}
+         {Sehr geehrter Herr $(cp_name)$,}
+         {Sehr geehrte Damen und Herren,}
+       }\\[1\baselineskip]
+}
 
-  <%zipcode%> <%city%>
+% ---------- Bestellvariablen ----------
+\newcommand{\quonumber}{$(quonumber)$}
+\newcommand{\ordnumber}{$(ordnumber)$}
+\newcommand{\docnumber}{{\quonumber}}
+\newcommand{\orddate}{$(orddate)$}
+\newcommand{\quodate}{$(quodate)$}
+\newcommand{\kundennummer}{$(customernumber)$}
+\newcommand{\reqdate}{$(reqdate)$}
+\newcommand{\transdate}{$(transdate)$}
 
-  <%country%>
-\end{minipage}
-\hfill
-\begin{minipage}{6cm}
-  \rightline{\LARGE\textbf{\textit{Auftragsbestätigung}}} \vspace*{0.2cm}
-  \rightline{\large\textbf{\textit{Nr. <%ordnumber%>%
-  }}} \vspace*{0.2cm}
+% ---------- Lieferadresse ----------
+\newcommand{\shiptoname}{$(shiptoname)$}
+\newcommand{\shiptocontact}{$(shiptocontact)$}
+\newcommand{\shiptodepartmentone}{$(shiptodepartment_1)$}
+\newcommand{\shiptodepartmenttwo}{$(shiptodepartment_2)$}
+\newcommand{\shiptostreet}{$(shiptostreet)$}
+\newcommand{\shiptocity}{$(shiptocity)$}
+\newcommand{\shiptocountry}{$(shiptocountry)$}
+\newcommand{\shiptophone}{$(shiptophone)$}
+\newcommand{\shiptozipcode}{$(shiptozipcode)$}
+\newcommand{\shiptofax}{$(shiptofax)$}
 
-  Datum:\hfill <%orddate%>
+% ---------- Währungszeichen ----------
+\newcommand{\currency}{\euro}
+\ifthenelse{\equal{$(currency)$}{YEN}}{\let\currency\textyen}{}
+\ifthenelse{\equal{$(currency)$}{GBP}}{\let\currency\pounds}{}
+\ifthenelse{\equal{$(currency)$}{USD}}{\let\currency\$}{}
 
-  Kunden-Nr:\hfill <%customernumber%>
+% ---------- Ende Reportvariablen-Umsetzung ----------
 
-  Telefon:\hfill <%phone%>
+% ---------- Briefkopf dazuladen ----------
+\input{kivitendobriefkopf}
 
-  Telefax:\hfill <%fax%>
+\begin{document}
+% ---------- Schrift Hauptdokuments (Computermodern-sanserif)  ----------
+% \fontfamily{cmss}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
+% ---------- Schrift Helvetica ------------------------
+\fontfamily{phv}\fontsize{10}{12pt plus 0.12pt minus 0.1pt}\selectfont
+% ---------- Firmenlogo nur erste Seite ----------
+\thispagestyle{briefkopf}
 
-  Ansprechpartner:\hfill <%employee%>
+% ---------- Datum und Nummern ----------
+% Position unterhalb des Briefkopfs
+\vspace*{\vlogospacing}
+\renewcommand{\arraystretch}{0.9}
+\begin{minipage}[b]{177mm}
+\sperren{\textbf{Auftragsbestätigung Nr. \ordnumber}}
+\hfill
+       \small
+       \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
+               \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
+               \textbf{Datum} & \orddate \\
+               \textbf{Kunden Nr.} & \kundennummer\\
+               \textbf{Angebot Nr.} & \docnumber\\
+               \textbf{Auftragsbestätigung Nr.} & \ordnumber\\
+               \nonemptyline{\textbf{Vorraussichtl. Lieferdatum} &}{\reqdate}
+               \textbf{Ansprechpartner} & \employeename\\
+               \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
+               \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
+       \end{tabular}\\[10mm plus 20mm minus 10mm]
 \end{minipage}
+\renewcommand{\arraystretch}{1}
+\normalsize
+% ---------- Begrüßung und Bemerkungen ----------
+\vspace{5mm}
+\lettergreeting
+wir bedanken uns für Ihren Auftrag %
+\ifthenelse{\equal{\orddate}{\leer}}{}{vom \orddate{ }}%
+und bestätigen Ihnen diesen wie folgt.\\
+%Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\[1\baselineskip]
+\ifthenelse{\isempty{$(notes)$}}{}{
+      $(notes)$\\[1\baselineskip]
+      }%
+%Mit freundlichen Grüßen\\[1\baselineskip]
+%\employeename\\[1\baselineskip]
+% ---------- Die eigentliche-Tabelle ----------
+% ---------- Tabelle puffern ----------
+\begin{filecontents}{\employeetable}
+% ---------- globale Variable laufsumme deklarieren ----------
+\resetlaufsumme
+% ---------- Spaltendefinition ----------
+%\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{~\currency}}]}}
+\begin{longtable}{@{}rlX@{ }rlrr@{\makebox[\widthof{\textbf{}}]}}
+% ---------- Kopfzeile der Tabelle ----------
+       \textbf{Pos} &
+       \textbf{Art.Nr.} &
+       \textbf{Bezeichnung} &
+       \textbf{Menge} &
+       \textbf{ME} &
+       \textbf{EP/€} &
+       \textbf{GP/€} \\
+       \midrule
+  \endfirsthead
+% ---------- Tabellenkopf nach dem Umbruch ----------
+       \textbf{Pos} &
+       \textbf{Art.Nr.} &
+       \textbf{Bezeichnung} &
+       \textbf{Menge} &
+       \textbf{ME} &
+       \textbf{EP/€} &
+       \textbf{GP/€} \\
+        \midrule
+       & & \multicolumn{4}{r}{} & \MarkUebertrPos\\[1.5em]
+  \endhead
+% ---------- Fuss der Teiltabellen ----------
+        \midrule
+       & & \multicolumn{4}{r}{} & \MarkZwsumPos \\
+  \endfoot
+% ---------- Das Ende der Tabelle ----------
+       \midrule
+%      & & \multicolumn{4}{r}{ Nettobetrag:} & \MarkZwsumPos \\
+  \endlastfoot
+% ---------- Positionen ----------
+  $(foreach number)$
+       $(runningnumber)$ &
+       $(number)$ &
+       $(description)$
+       \ifthenelse{\equal{$(longdescription)$}{}}{}{\newline
+       \renewcommand{\baselinestretch}{1}\footnotesize
+       {\footnotesize $(longdescription)$
+       \renewcommand{\baselinestretch}{1}\normalsize
+       }}
+       \ifthenelse{\equal{$(deliverydate_oe)$}{\leer}}{}{
+               \newline Lieferdatum:~$(deliverydate_oe)$} &
+       $(qty)$ &
+       $(unit)$ &
+       \ifthenelse{\isempty{$(sellprice)$}}{&}{
+               \numprint{$(sellprice)$}
+               \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
+               \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$}
+       }\\ %
+  $(end number)$
 
-\vspace*{0.5cm}
-
+\end{longtable}
+% ----------  Ende der Hilfsdatei ----------
+\end{filecontents}
+% ---------- Puffertabelle öffnen ----------
+\LTXtable{\textwidth}{\employeetable}
+\parbox{\textwidth}{
+%---------- Summenbereich nach recht schieben  ----------
 \hfill
+\setlength{\tabcolsep}{0mm}
+\begin{tabular}{@{}r@{ }r@{ }l}
+%   \toprule
+   {Nettobetrag:}& \numprint{$(subtotal)$}& \currency\\
+% ---------- Alle Steuern ausweisen ----------
+   $(foreach tax)$
+%       {$(taxdescription)$ auf }\numprint{$(taxbase)$}~\currency: & \numprint{$(tax)$}& \\
+               {$(taxdescription)$}:  & \numprint{$(tax)$}& \currency\\
+   $(end tax)$
+   \midrule
+   {\textbf{Gesamtbetrag:}} & \bfseries\numprint{$(ordtotal)$} & \textbf{\currency}\\
+   \bottomrule
+\end{tabular}
+}
+% ---------- Transportmittel ----------
+$(if shipvia)$
+Lieferung per $(shipvia)$.\\[1em]
+$(end)$
+% ---------- Lieferadresse ----------
+\ifthenelse{%
+     \equal{\shiptoname}{\name} \AND
+     \equal{\shiptodepartmentone}{\leer} \AND
+     \equal{\shiptodepartmenttwo}{\leer} \AND
+     \equal{\shiptostreet}{\street} \AND
+     \equal{\shiptozipcode}{\zipcode} \AND
+     \equal{\shiptocity}{\city}
+     }{}{
+% ---------- Umbruch dazwischen verhindern ----------
+\vspace*{0.5em}
+\parbox{\textwidth}{
+% ---------- Bereich für Lieferadresse ----------
+\textbf{Lieferanschrift:}\hfill\parbox[t]{0.7\textwidth}{
+                \shiptoname \\
+                \nonemptyline{}{\shiptodepartmentone}
+                \nonemptyline{}{\shiptodepartmenttwo}
+                \shiptostreet \\
+                \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
+                \nonemptyline{Tel: }{\shiptophone}
+                \nonemptyline{Fax: }{\shiptofax}
+        }%ende parbox
+}% ende parbox
+}% ende ifthenelse
+$(if payment_terms)$
+\vspace*{0.5em}
+\textbf{Zahlungsbedingungen:}\hfill\parbox[t]{0.7\textwidth}{$(payment_terms)$}\\[1em]
+$(end)$
+\vspace*{0.5em}
+%Nutzen Sie bitte für Fragen oder Änderungswünsche die oben angegebenen Kontaktmöglichkeiten.\\ \vfil
+\parbox{\textwidth}{
+Für Nachfragen steht Ihnen \employeename \ per Telefon (\employeetel) oder per E-Mail (\employeeemail) gerne zur Verfügung.\\
 
-\vspace{0.5cm}
-
-\begin{tabularx}{\textwidth}{lrXrr}
-  \hline
-  \textbf{Pos} & \textbf{Menge} & \textbf{Bezeichnung} &
-  \textbf{E-Preis/\euro} & \textbf{G-Preis/\euro} \\
-  \hline
-  <%foreach number%>
-    <%runningnumber%> & <%qty%> <%unit%> & \raggedright <%description%> &
-    <%sellprice%> \euro  & <%linetotal%> \euro \\
-  <%end number%> \hline
-  \multicolumn{4}{l}{Nettobetrag} & <%subtotal%> \euro\\
-  <%foreach tax%>
-    \multicolumn{4}{l}{<%taxdescription%>} & <%tax%>\euro \\
-  <%end tax%>
-  \multicolumn{4}{l}{\textbf{Endbetrag}} & \textbf{<%ordtotal%> \euro} \\
-\end{tabularx}
-\hrule
-
-\vspace{1cm}
-Vereinbarter Liefertermin: <%reqdate%> \\ \\
-\textit{Bitte kontrollieren Sie alle Positionen auf Übereinstimmung
-  mit Ihrer Bestellung! Abweichungen teilen Sie innerhalb von 3 Tagen
-  mit!} \\ \\
+Wir sichern Ihnen eine termin- und fachgerechte Ausführung zu.\\
 
+\vspace{1.5\baselineskip}
+Mit freundlichen Grüßen\\ \vfil
+\employeename
+}% Ende Parbox
+\vfill
+\footnotesize
+Es gelten unsere Liefer- und Zahlungsbedingungen, die wir Ihnen auf Wunsch gerne zukommen lassen.
 \end{document}
-