new structure for proforma.tex
authorMarei Peischl <marei@peitex.de>
Sun, 12 Jan 2020 21:10:04 +0000 (22:10 +0100)
committerJan Büren <jan@kivitendo.de>
Mon, 3 Feb 2020 11:21:39 +0000 (12:21 +0100)
proforma.tex

index 53a0606..9545f61 100644 (file)
 
 
 \begin{document}
-
-\ourfont
-\begin{minipage}[t]{8cm}
-  \scriptsize
-
-  {\color{gray}\underline{\firma\ $\cdot$ \strasse\ $\cdot$ \ort}}
-  \normalsize
-
-  \vspace*{0.3cm}
-
-  <%name%>
-
-  <%if department_1%><%department_1%><%end if%>
-
-  <%if department_2%><%department_2%><%end if%>
-
-  <%cp_givenname%> <%cp_name%>
-
-  <%street%>
-
-  ~
-
-  <%zipcode%> <%city%>
-
-  <%country%>
-\end{minipage}
-\hfill
-\begin{minipage}[t]{6cm}
-  \hfill{\LARGE\textbf{\proformarechnung}}
-
-  \vspace*{0.2cm}
-
-  \hfill{\large\textbf{\nr ~<%ordnumber%>}}
-
-  \vspace*{0.2cm}
-
-  \datum:\hfill <%orddate%>
-
-  \kundennummer:\hfill <%customernumber%>
-
-  <%if cusordnumber%>\ihreBestellnummer:\hfill <%cusordnumber%><%end if%>
-
-  <%if quonumber%>\angebot~\nr:\hfill <%quonumber%><%end if%>
-
-  \ansprechpartner:\hfill <%employee_name%>
-
-  \textTelefon \hfill <%employee_tel%>
-
-  \textEmail \hfill <%employee_email%>
-\end{minipage}
-
+       
+\setkomavar{title}{
+       \proformarechnung~
+       \nr ~<%ordnumber%>
+}
+\setkomavar*{date}{\datum}
+
+\setkomavar{date}{<%orddate%>}
+\setkomavar{customer}{<%customernumber%>}
+<%if cusordnumber%>
+       \setkomavar*{yourref}{\ihreBestellnummer}
+       \setkomavar{yourref}{<%cusordnumber%>}
+<%end if%>
+<%if quonumber%>\setkomavar{quote}{<%quonumber%>}<%end if%>
+\setkomavar{fromname}{<%employee_name%>}
+\setkomavar{fromphone}{<%employee_tel%>}
+\setkomavar{fromemail}{<%employee_email%>}
+\setkomavar{transaction}{<%transaction_description%>}
+       
 <%if shiptoname%>
-  \vspace{0.8cm}
-  \scriptsize \underline{\abweichendeLieferadresse:}\\
-  \normalsize    <%shiptoname%>
-
-                 <%if shiptocontact%> <%shiptocontact%><%end if%>
-
-                 <%shiptodepartment_1%>
-
-                  <%shiptodepartment_2%>
-
-                  <%shiptostreet%>
-
-                  <%shiptozipcode%> <%shiptocity%>
+\makeatletter
+\begin{lrbox}\shippingAddressBox
+       \parbox{\useplength{toaddrwidth}}{
+               \backaddr@format{\scriptsize\usekomafont{backaddress}%
+                       \strut abweichende Lieferadresse
+               }
+               \par\smallskip
+               \setlength{\parskip}{\z@}
+               \par
+               \normalsize
+               <%shiptoname%>\par
+               <%if shiptocontact%> <%shiptocontact%><%end if%>\par
+               <%shiptodepartment_1%>\par
+               <%shiptodepartment_2%>\par
+               <%shiptostreet%>\par
+               <%shiptozipcode%> <%shiptocity%>
+       }
+\end{lrbox}
+\makeatother
 <%end if%>
-\vspace*{1.5cm}
 
-\hfill
+\begin{letter}{
+               <%name%>\strut\\
+               <%if department_1%><%department_1%>\\<%end if%>
+               <%if department_2%><%department_2%>\\<%end if%>
+               <%cp_givenname%> <%cp_name%>\strut\\
+               <%street%>\strut\\
+               <%zipcode%> <%city%>\strut\\
+               <%country%> \strut
+       }
 
 % Anrede nach Geschlecht unterscheiden
-\ifthenelse{\equal{<%cp_name%>}{}}{\anrede}{
-  \ifthenelse{\equal{<%cp_gender%>}{f}}
-    {\anredefrau}{\anredeherr} <%cp_title%> <%cp_name%>,}\\
-
-\auftragsformel\\
-
-\vspace{0.5cm}
-
-
-%
-% - longtable kann innerhalb der Tabelle umbrechen
-% - da der Umbruch nicht von Lx-Office kontrolliert wird, kann man keinen
-%   Übertrag machen
-% - Innerhalb des Langtextes <%longdescription%> wird nicht umgebrochen.
-%   Falls das gewünscht ist, \\ mit \renewcommand umschreiben (siehe dazu:
-%   http://www.lx-office.org/uploads/media/Lx-Office_Anwendertreffen_LaTeX-Druckvorlagen-31.01.2011_01.pdf)
-%
-\setlength\LTleft\parindent     % Tabelle beginnt am linken Textrand
-\setlength\LTright{0pt}         % Tabelle endet am rechten Textrand
-\begin{longtable}{@{}rrp{7cm}@{\extracolsep{\fill}}rrr@{}}
-% Tabellenkopf
-\hline
-\textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} & \textbf{\einzelpreis} & \textbf{\gesamtpreis} \\
-\hline\\
-\endhead
-
-% Tabellenkopf erste Seite
-\hline
-\textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} & \textbf{\einzelpreis} & \textbf{\gesamtpreis} \\
-\hline\\[-0.5em]
-\endfirsthead
-
-% Tabellenende
-\\
-\multicolumn{6}{@{}r@{}}{\weiteraufnaechsterseite}
-\endfoot
-
+\opening{
+       \ifstr{<%cp_name%>}{}
+               {\anrede}
+               {
+                       \ifstr{<%cp_gender%>}{f}
+                               {\anredefrau}
+                               {\anredeherr}
+                               <%cp_title%> <%cp_name%>,
+                       }
+               }
+               \thispagestyle{kivitendo.letter.first}
+
+\auftragsformel
+\begin{PricingTabular*}
+\FakeTable{
+       <%foreach number%>%
+       <%runningnumber%> &%
+       <%number%> &%
+       \textbf{<%description%>}%
+       <%if longdescription%>\ExtraDescription{<%longdescription%>}<%end longdescription%>%
+    <%if reqdate%>\ExtraDescription{\lieferdatum: <%reqdate%>}<%end reqdate%>
+       <%if serialnumber%>\ExtraDescription{\seriennummer: <%serialnumber%>}<%end serialnumber%>%
+       <%if ean%>\ExtraDescription{\ean: <%ean%>}<%end ean%>%
+       <%if projectnumber%>\ExtraDescription{\projektnummer: <%projectnumber%>}<%end projectnumber%>%
+       &%
+       <%qty%> <%unit%> &%
+       <%sellprice%>&%
+       \ifstr{<%p_discount%>}{0}{}{\sffamily\scriptsize{(-<%p_discount%>\,\%)}}%
+       <%linetotal%>\tabularnewline
+       <%end number%>
+}
 % Tabellenende letzte Seite
-\hline\\
-\multicolumn{5}{@{}l}{\nettobetrag} & <%subtotal%> \currency\\
-<%foreach tax%>
-\multicolumn{5}{@{}l}{<%taxdescription%>} & <%tax%> \currency\\
-<%end tax%>
-\multicolumn{5}{@{}l}{\textbf{\schlussbetrag}} &  \textbf{<%ordtotal%>} \currency\\
-\hline\hline\\
-\endlastfoot
-
-% eigentliche Tabelle
-<%foreach number%>
-          <%runningnumber%> &
-          <%number%> &
-          \textbf{<%description%>} &
-          \raggedleft <%qty%> <%unit%> &
-          <%sellprice%> \currency &
-          \ifthenelse{\equal{<%p_discount%>}{0}}{}{\sffamily\scriptsize{(-<%p_discount%> \%)}}
-          \ourfont{<%linetotal%> \currency} \\*  % kein Umbruch nach der ersten Zeile, damit Beschreibung und Langtext nicht getrennt werden
-
-          <%if longdescription%> && \scriptsize <%longdescription%>\\<%end longdescription%>
-          <%if reqdate%> && \scriptsize \lieferdatum: <%reqdate%>\\<%end reqdate%>
-          <%if serialnumber%> && \scriptsize \seriennummer: <%serialnumber%>\\<%end serialnumber%>
-          <%if ean%> && \scriptsize \ean: <%ean%>\\<%end ean%>
-          <%if projectnumber%> && \scriptsize \projektnummer: <%projectnumber%>\\<%end projectnumber%>
-          \\[-0.8em]
-<%end number%>
-
-\end{longtable}
-
-
-\vspace{0.2cm}
+       \begin{PricingTotal}
+       % Tabellenende letzte Seite
+       \nettobetrag & <%subtotal%>\\
+       <%foreach tax%>
+       <%taxdescription%> & <%tax%>\\
+       <%end tax%>
+       \bfseries\schlussbetrag &  \bfseries <%ordtotal%>\\
+\end{PricingTotal}
+\end{PricingTabular*}
 
 <%if notes%>
-        \vspace{5mm}
-        <%notes%>
-        \vspace{5mm}
+<%notes%>
+\medskip
 <%end if%>
 
 <%if reqdate%>
 \lieferungErfolgtAm ~<%reqdate%>. \\
 <%end if%>
 
-\textit{\auftragpruefen} \\ \\
+\textit{\auftragpruefen}
+
+\closing{\gruesse}
 
-\gruesse \\ \\ \\
-  <%employee_name%>
+\end{letter}
 
 \end{document}