Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[kivitendo-erp.git] / templates / print / Standard / request_quotation.tex
index d3ba6f5..d70cd11 100644 (file)
+% request_quotation.tex für LX-Office ab V2.6.3
+% Anfrage - Einkauf
+% ----------
+% Ü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=$( )$
+% ----------
 \documentclass[twoside]{scrartcl}
-\usepackage[frame]{xy}
-\usepackage{tabularx}
-\usepackage{graphicx}
-\usepackage{german}
-\usepackage[utf8]{inputenc}
-\setlength{\voffset}{0.5cm}
-\setlength{\hoffset}{-2.0cm}
-\setlength{\topmargin}{0cm}
-\setlength{\headheight}{0.5cm}
-\setlength{\headsep}{1cm}
-\setlength{\topskip}{0pt}
-\setlength{\oddsidemargin}{1.0cm}
-\setlength{\evensidemargin}{1.0cm}
-\setlength{\textwidth}{17cm}
-\setlength{\textheight}{24.7cm}
-\setlength{\footskip}{1cm}
-\setlength{\parindent}{0pt}
-\renewcommand{\baselinestretch}{1}
-\begin{document}
-
-\newlength{\descrwidth}\setlength{\descrwidth}{12cm}
-\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
-
-\pagestyle{myheadings}
-\thispagestyle{empty}
-
-\vspace*{-1.3cm}
-
-\parbox{\textwidth}{
-  \parbox[b]{.42\textwidth}{
-    <%company%>
-
-    <%address%>
-  }\hfill
-  \begin{tabular}[b]{rr@{}}
-  Tel & <%tel%>\\
-  Fax & <%fax%>
-  \end{tabular}
-
-  \rule[1.5ex]{\textwidth}{0.5pt}
-}
-
-
-\vspace*{0.5cm}
-
-\parbox[t]{1cm}{\hfill}
-\parbox[t]{.45\textwidth}{
-\textbf{To}
-\vspace{0.7cm}
-
-<%name%>
-
-<%street%>
-
-<%zipcode%>
-
-<%city%>
-
-<%country%>
-
-\vspace{0.3cm}
-
-<%if contact%>
-<%contact%>
-<%end contact%>
-
-\vspace{0.2cm}
-
-<%if vendorphone%>
-Tel: <%vendorphone%>
-<%end vendorphone%>
-
-<%if vendorfax%>
-Fax: <%vendorfax%>
-<%end vendorfax%>
-
-<%email%>
-}
-\parbox[t]{.45\textwidth}{
-\textbf{Lieferanschrift}
-\vspace{0.7cm}
-
-<%shiptoname%>
-
-<%shiptostreet%>
-
-<%shiptozipcode%>
-
-<%shiptocity%>
-
-<%shiptocountry%>
-
-\vspace{0.3cm}
-
-<%if shiptocontact%>
-<%shiptocontact%>
-<%end shiptocontact%>
-
-<%if shiptophone%>
-Tel: <%shiptophone%>
-<%end shiptophone%>
-
-<%if shiptofax%>
-Fax: <%shiptofax%>
-<%end shiptofax%>
-
-<%shiptoemail%>
+\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{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
+
+% ---------- 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}
+
+% ---------- 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]
 }
-\hfill
 
-\vspace{1cm}
+% ---------- Bestellvariablen ----------
+\newcommand{\quonumber}{$(quonumber)$}
+\newcommand{\docnumber}{Anfrage Nr. {\quonumber}}
+\newcommand{\vendornumber}{$(vendornumber)$}
+\newcommand{\reqdate}{$(reqdate)$}
+\newcommand{\orddate}{$(orddate)$}
+\newcommand{\ordnumber}{$(ordnumber)$}
+\newcommand{\transdate}{$(transdate)$}
+
+% ---------- 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)$}
+
+% ---------- 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\$}{}
+
+% ---------- Ende Reportvariablen-Umsetzung ----------
+
+% ---------- Briefkopf dazuladen ----------
+\input{kivitendobriefkopf}
 
-\textbf{A N F R A G E}
+\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}
+
+% ---------- Datum und Nummern ----------
+% Position unterhalb des Briefkopfs
+\vspace*{\vlogospacing}
+\renewcommand{\arraystretch}{0.9}
+\begin{minipage}[b]{177mm}
+\sperren{\textbf{Anfrage Nr. \quonumber}}
 \hfill
-
-\vspace{1cm}
-
-\begin{tabularx}{\textwidth}{*{6}{|X}|} \hline
-  \textbf{AnfrageNr. \#} & \textbf{Datum} & \textbf{Benötigt am} & \textbf{Kontakt} & \textbf{Lagerplatz} & \textbf{Lieferung mit} \\ [0.5ex]
-  \hline
-  <%quonumber%> & <%quodate%> & <%reqdate%> & <%employee%> & <%shippingpoint%> & <%shipvia%> \\
-  \hline
-\end{tabularx}
-
-\vspace{1cm}
-
-Bitte nennen Sie uns für folgende Artikel Preis und Liefertermin:
-
-\vspace{1cm}
-
-\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rl}
-  \textbf{Nummer} & \textbf{Beschreibung} & \textbf{Menge} & \\
-<%foreach number%>
-  <%number%> & <%description%> & <%qty%> & <%unit%> \\
-<%end number%>
-\end{tabular*}
-
-
+       \small
+       \begin{tabular}[b]{r@{\hspace{2mm}}p{\hlogospacing}}
+               \textbf{Seite} & {\thepage} von \pageref{LastPage}\\
+               \textbf{Datum} & \transdate \\
+               \nonemptyline{\textbf{Unsere Kunden Nr.} &}{\vendornumber}
+               \textbf{Anfrage Nr.} & \quonumber\\
+               \nonemptyline{\textbf{Terminwunsch} &}{\reqdate}
+               \textbf{Ansprechpartner} & \employeename\\
+               \nonemptyline{\textbf{Durchwahl} &}{\employeetel}
+               \nonemptyline{\textbf{E-Mail} &}{\employeeemail}
+       \end{tabular}\\[10mm plus 20mm minus 10mm]
+\end{minipage}
+\normalsize
+\renewcommand{\arraystretch}{1}
+
+% ---------- Begrüßung und Bemerkungen ----------
+\vspace*{5mm}
+\lettergreeting
+hiermit bitten wir um ein für uns freibleibendes und kostenloses Angebot für die nachfolgenden Positionen.
+Eventuell preisgünstigere Alternativen bitten wir gesondert anzubieten.
+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{}}]}}
+% ---------- 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
+       }} &
+       $(qty)$ &
+       $(unit)$ &
+       \numprint{$(sellprice)$}
+       \ifthenelse{\equal{$(p_discount)$}{0}}{}{ -$(p_discount)$\%} &
+       \numprint{$(linetotal)$}\Wert{$(linetotal NOFORMAT)$} \\ %
+  $(end number)$
+\end{longtable}
+% ----------  Ende der Hilfsdatei ----------
+\end{filecontents}
+% ---------- Puffertabelle öffnen ----------
+\LTXtable{\textwidth}{\employeetable}
+ %---------- Bereich für die Summen ----------
 \parbox{\textwidth}{
-\rule{\textwidth}{2pt}
-
+ %---------- Summenbereich nach recht schieben  ----------
 \hfill
-
-<%if notes%>
-  <%notes%>
-<%end if%>
-
+\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}
 }
+% ---------- 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 ----------
+\parbox{\textwidth}{
+\ifthenelse{\equal{$(shipvia)$}{\leer}}{}{Lieferung vorzugsweise mit $(shipvia)$.\\[1em]}
+
+\textbf{Lieferanschrift:} \hspace{2mm}
+%    \rule{10em}{0mm}
+% ---------- Bereich für Lieferadresse ----------
+       \parbox[t]{7cm}{
+               \shiptoname \\
+               \nonemptyline{}{\shiptodepartmentone}
+               \nonemptyline{}{\shiptodepartmenttwo}
+               \shiptostreet \\
+               \shiptocountry{ }\shiptozipcode{ }\shiptocity\\[1mm]
+               \nonemptyline{Tel: }{\shiptophone}
+               \nonemptyline{Fax: }{\shiptofax}
+       }%ende parbox
+}% ende parbox
+}% ende ifthenelse
+
+%Mit freundlichen Grüßen\\[1\baselineskip]
+%\employeename\\[1\baselineskip]
 
 \end{document}