infobox option
authorMarei Peischl <marei@peitex.de>
Thu, 21 Nov 2019 13:37:56 +0000 (14:37 +0100)
committerJan Büren <jan@kivitendo.de>
Mon, 3 Feb 2020 11:21:38 +0000 (12:21 +0100)
kiviletter.sty

index 6450140..6997095 100644 (file)
@@ -1,6 +1,15 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{kiviletter}[2019/10/10 Letter Layouts for Kivitendo]
 
+\newif\if@kivi@infobox
+\DeclareOption{reffields}{\@kivi@infoboxfalse}
+\DeclareOption{infobox}{\@kivi@infoboxtrue}
+\@kivi@infoboxtrue
+
+
+\ProcessOptions\relax
+
+
 \RequirePackage{expl3}
 \RequirePackage{iftex}
 % Schriftart, Eingabelayout der Tastatur
@@ -89,27 +98,25 @@ contents={\usebox\shippingAddressBox}
 
 \ExplSyntaxOff
 
-
+\if@kivi@infobox
 \setkomavar{location}{
        \begin{flushright}
                \bfseries
                \LARGE
                \usekomavar{title}
-%              \angebot
-%              \par
-%              \medskip
-%              \large\nr ~<%quonumber%>
        \end{flushright}
 
        \medskip
        \begin{tabularx}{\linewidth}{@{}l<{:}>{\raggedright\arraybackslash}X@{}}
-               \datum&\usekomavar{date}\\%%<%transdate%>\\
-               \kundennummer&\usekomavar{customer}\\%<%customernumber%>\\
-               \ansprechpartner&\usekomavar{fromname}\\%<%employee_name%>\\
-               \textTelefon&\usekomavar{fromphone}\\%<%employee_tel%>\\
-               \textEmail&\usekomavar{fromemail}\\%<%employee_email%>
+               \datum&\usekomavar{date}\\
+               \kundennummer&\usekomavar{customer}\\
+               \ansprechpartner&\usekomavar{fromname}\\
+               \ifkomavarempty{fromphone}{\textTelefon&\usekomavar{fromphone}\\}
+               \ifkomavarempty{fromemail}{\textEmail&\usekomavar{fromemail}\\}
        \end{tabularx}
 }
+\removereffields
+\fi
 
 
 \renewcommand*{\raggedsignature}{\raggedright}