\RequirePackage{expl3}
+\RequirePackage{xparse}
\RequirePackage{iftex}
\KOMAoptions{fontsize=12pt}
% Schriftart, Eingabelayout der Tastatur
\ifPDFTeX
-\RequirePackage[utf8]{inputenc}% Nur notwendig, wenn Basis älter als TL2018
-\RequirePackage[T1]{fontenc}
-\RequirePackage{lmodern}
+ \RequirePackage[utf8]{inputenc}% Nur notwendig, wenn Basis älter als TL2018
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{lmodern}
+
+ \RequirePackage{eurosym}
+ \DeclareUnicodeCharacter{20AC}{\euro}
\else
-\RequirePackage{fontspec}
+ \RequirePackage{fontspec}
\fi
-%\RequirePackage{xltabular}
-\RequirePackage{tabularx}
-\RequirePackage{longtable}
+\RequirePackage{xltabular}
\RequirePackage{booktabs}
\RequirePackage{graphicx}
-\ifPDFTeX
-\RequirePackage{eurosym}
-\DeclareUnicodeCharacter{20AC}{\euro}
-\fi
+
\RequirePackage[fromlogo,fromalign=right,
firstfoot=false,%Für einheitliche Randeinstellungen
\newkomavar{transaction}
\newkomavar[\lieferschein{}~\nr]{delivery}
\newkomavar[\angebot{}~\nr]{quote}
-\newkomavar{orderID}
-\newkomavar{projectID}
+\newkomavar[\auftragsnummer]{orderID}
+\newkomavar[\projektnummer]{projectID}
+\setkomavar*{fromphone}{\textTelefon}
+\setkomavar*{fromemail}{\textEmail}
+\setkomavar*{fromfax}{\textFax}
+\setkomavar*{customer}{\kundennummer}
+
\usepackage{geometry}
\dim_new:N \g_kivi_tabcolsep_dim
\dim_gset:Nn \g_kivi_tabcolsep_dim {.5\tabcolsep}
+\prg_new_conditional:Nnn \kivi_if_Price_col:n {T} {
+ \prop_get:cnN {l_kivi_col_#1_prop} {colspec} \l_tmpa_tl
+ \tl_if_eq:NnTF \l_tmpa_tl {Price}
+ {\prg_return_true:}
+ {\prg_return_false:}
+}
+
+
\cs_new:Nn \__kivi_calc_desc_column: {
\dim_zero:N \l_kivi_tab_desc_leftskip_dim
\dim_zero:N \l_kivi_tab_desc_dim
\bool_set_false:N \l_tmpa_bool
+ \tl_gclear:N \g_kivi_Pricing_colspec_tl
\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
\tl_if_eq:nnTF {##1} {desc} {
\dim_set:Nn \l_kivi_tab_desc_dim {
\textwidth-\l_kivi_tab_desc_leftskip_dim
}
\bool_set_true:N \l_tmpa_bool
-
+ \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {p{\l_kivi_tab_desc_dim}}
}{
- \bool_if:NTF \l_tmpa_bool {
- \bool_if:cT {l_kivi_col_##1_bool} {
+ \bool_if:cT {l_kivi_col_##1_bool} {
+ \bool_if:NTF \l_tmpa_bool {
\dim_sub:Nn \l_kivi_tab_desc_dim {
\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
}
- }
- }{
- \bool_if:cT {l_kivi_col_##1_bool} {
+ }{
\dim_add:Nn \l_kivi_tab_desc_leftskip_dim {
\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
}
}
+ \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {>{\raggedleft\arraybackslash}p{\dim_use:c {l_kivi_tab_##1_dim}}}
+ \kivi_if_Price_col:nT {##1} {\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {<{\__kivi_tab_column_currency:}}}
}
}
}
+ \tl_gput_left:Nn \g_kivi_Pricing_colspec_tl {@{}}
+ \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {@{}}
}
\newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}<{\__kivi_tab_column_currency:}}
@{}
}
-\cs_new:Nn \__kivi_tab_column_currency: {\,\currency}
+\cs_new_protected:Nn \__kivi_tab_column_currency: {\,\currency}
\def\tabcurrency{\__kivi_tab_column_currency:}
\cs_set:Nn \__kivi_tab_column_header_currency: {}
\cs_set_eq:NN \__kivi_tab_column_body_currency: \__kivi_tab_column_currency:
\midrule
}
-\RequirePackage{xltabular}
\keys_define:nn {kivi/SimpleTabular} {
colspec .tl_set:N =\l_kivi_SimpleTabular_colspec_tl,
\newtcolorbox{PricingTabularBox}{breakable,skin=kivi@LT}
+\if@kivi@infobox
+
+ \def\locationsep{:}
+
+ \NewDocumentCommand{\locationentry}{som}{
+ \Ifkomavarempty{#3}{}{
+ \IfBooleanTF {#1} {
+ \strut
+ \IfNoValueTF {#2}
+ {\usekomavar*{#3}}
+ {#2}
+ \locationsep
+ \hfill\strut\space
+ \hbox_set:Nn \l_tmpa_box {\usekomavar{#3}}
+ \dim_compare:nTF {\box_wd:N \l_tmpa_box>\linewidth}
+ {\newline\hspace*{\fill}\llap}
+ {\hspace*{\fill}}
+ {\box_use:N \l_tmpa_box\strut}
+ }{
+ \@hangfrom{\strut
+ \IfNoValueTF {#2}
+ {\usekomavar*{#3}}
+ {#2}\locationsep~
+ }{
+ \parbox[t]{\dimexpr\linewidth-\hangindent}{
+ \raggedleft
+ \usekomavar{#3}\strut
+ }
+ }
+ }
+ }
+ \par
+ }
-\if@kivi@infobox
\setkomavar{location}{
\Ifkomavarempty{transaction}{}{
\bfseries
}
\par
\medskip
- \begin{tabularx}{\useplength{locwidth}}{@{}l<{:}>{\raggedleft\arraybackslash}X@{}}
- \usekomavar*{date}&\usekomavar{date}\\
- \Ifkomavarempty{myref}{}{
- \usekomavar*{myref}&\usekomavar{myref}\\
- }
- \kundennummer&\usekomavar{customer}\\
- \Ifkomavarempty{yourref}{}{
- \usekomavar*{yourref}&\usekomavar{yourref}\\
- }
- \Ifkomavarempty{delivery}{}{
- \usekomavar*{delivery}&\usekomavar{delivery}\\
- }
- \Ifkomavarempty{quote}{}{
- \usekomavar*{quote}&\usekomavar{quote}\\
- }
- \Ifkomavarempty{orderID}{}{\auftragsnummer&\usekomavar{orderID}\\}
- \Ifkomavarempty{projectID}{}{\projektnummer&\usekomavar{projectID}\\}
- \ansprechpartner&\usekomavar{fromname}
- \Ifkomavarempty{fromphone}{}{\\\textTelefon&\usekomavar{fromphone}}
- \Ifkomavarempty{fromemail}{}{\\\textEmail&\usekomavar{fromemail}}
- \end{tabularx}
+ \parbox{\useplength{locwidth}}{
+ \locationentry{date}
+ \locationentry{myref}
+ \locationentry{customer}
+ \locationentry{yourref}
+ \locationentry{delivery}
+ \locationentry{quote}
+ \locationentry{orderID}
+ \locationentry{projectID}
+ \locationentry[\ansprechpartner]{fromname}
+ \locationentry{fromphone}
+ \locationentry*{fromemail}
+ }
}
\removereffields
\AtBeginLetter{