kivitendo/templates/print/marei/kiviletter.sty @ a7fee7bd
4987cdc7 | Jan Büren | \NeedsTeXFormat{LaTeX2e}
|
||
33c815ee | Jan Büren | \ProvidesPackage{kiviletter}[2020/04/24 Letter Layouts for Kivitendo]
|
||
4987cdc7 | Jan Büren | \newif\if@kivi@infobox
|
||
77d85523 | Marei Peischl | \newif\if@kivi@footer
|
||
4987cdc7 | Jan Büren | \DeclareOption{reffields}{\@kivi@infoboxfalse}
|
||
\DeclareOption{infobox}{\@kivi@infoboxtrue}
|
||||
77d85523 | Marei Peischl | \DeclareOption{nofooter}{\@kivi@footerfalse}
|
||
\DeclareOption{footer}{\@kivi@footertrue}
|
||||
4987cdc7 | Jan Büren | \@kivi@infoboxtrue
|
||
77d85523 | Marei Peischl | \@kivi@footertrue
|
||
4987cdc7 | Jan Büren | |||
cfe3ae43 | Marei Peischl | \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{scrletter}}
|
||
4987cdc7 | Jan Büren | \ProcessOptions\relax
|
||
\RequirePackage{expl3}
|
||||
\RequirePackage{iftex}
|
||||
c1c33278 | Jan Büren | \KOMAoptions{fontsize=12pt}
|
||
4987cdc7 | Jan Büren | % Schriftart, Eingabelayout der Tastatur
|
||
\ifPDFTeX
|
||||
\RequirePackage[utf8]{inputenc}% Nur notwendig, wenn Basis älter als TL2018
|
||||
\RequirePackage[T1]{fontenc}
|
||||
33c815ee | Jan Büren | \RequirePackage{lmodern}
|
||
4987cdc7 | Jan Büren | \else
|
||
\RequirePackage{fontspec}
|
||||
\fi
|
||||
5ffa2173 | Marei Peischl | \RequirePackage{xltabular}
|
||
4987cdc7 | Jan Büren | \RequirePackage{booktabs}
|
||
\RequirePackage{graphicx}
|
||||
\ifPDFTeX
|
||||
\RequirePackage{eurosym}
|
||||
\DeclareUnicodeCharacter{20AC}{\euro}
|
||||
\fi
|
||||
\RequirePackage[fromlogo,fromalign=right,
|
||||
c1c33278 | Jan Büren | firstfoot=false,%Für einheitliche Randeinstellungen
|
||
refline=nodate,
|
||||
4987cdc7 | Jan Büren | ]{scrletter}
|
||
\LoadLetterOption{DIN}
|
||||
\newkomavar{transaction}
|
||||
\newkomavar[\lieferschein{}~\nr]{delivery}
|
||||
\newkomavar[\angebot{}~\nr]{quote}
|
||||
2e0414b5 | Marei Peischl | \newkomavar[\auftragsnummer]{orderID}
|
||
\newkomavar[\projektnummer]{projectID}
|
||||
\setkomavar*{fromphone}{\textTelefon}
|
||||
\setkomavar*{fromemail}{\textEmail}
|
||||
\setkomavar*{fromfax}{\textFax}
|
||||
\setkomavar*{customer}{\kundennummer}
|
||||
4987cdc7 | Jan Büren | |||
\usepackage{geometry}
|
||||
\ExplSyntaxOn
|
||||
\dim_new:N \g_kivi_margin_dim
|
||||
\dim_gset:Nn \g_kivi_margin_dim {\useplength{toaddrhpos}}
|
||||
\geometry{a4paper,margin=\g_kivi_margin_dim,heightrounded}
|
||||
%Scratch variables
|
||||
\int_new:N \l_kivi_tmp_int
|
||||
\bool_new:N \l_kivi_tmp_bool
|
||||
\bool_new:N \g_kivi_TableFoot_bool
|
||||
\dim_new:N \g_kivi_orig@textheight_dim
|
||||
\ExplSyntaxOff
|
||||
\newsavebox{\shippingAddressBox}
|
||||
\DeclareNewLayer[
|
||||
foreground,
|
||||
hoffset=\useplength{toaddrhpos},
|
||||
04ad5930 | Marei Peischl | voffset=\dimexpr\useplength{toaddrvpos}+\useplength{toaddrheight}+4\baselineskip,%sep to shippingaddressbox
|
||
4987cdc7 | Jan Büren | contents={\usebox\shippingAddressBox}
|
||
]{kivitendo.shippingaddress}
|
||||
\newpairofpagestyles{kivitendo.letter}{}
|
||||
7a3c31d4 | Marei Peischl | |||
4987cdc7 | Jan Büren | \renewcommand*{\letterpagestyle}{kivitendo.letter}
|
||
\DeclareNewPageStyleByLayers{kivitendo.letter.first}{
|
||||
kivitendo.shippingaddress,
|
||||
7a3c31d4 | Marei Peischl | plain.kivitendo.letter.head.odd,plain.kivitendo.letter.head.even,plain.kivitendo.letter.head.oneside,%
|
||
plain.kivitendo.letter.foot.odd,plain.kivitendo.letter.foot.even,plain.kivitendo.letter.foot.oneside,%
|
||||
4987cdc7 | Jan Büren | }
|
||
\setkomavar{backaddress}{\firma\ $\cdot$ \strasse\ $\cdot$ \ort}
|
||||
\setkomavar{firsthead}{
|
||||
\if@logo
|
||||
\rlap{\usekomavar{fromlogo}}%
|
||||
\fi
|
||||
}
|
||||
\@setplength{locwidth}{6cm}
|
||||
\ExplSyntaxOn
|
||||
2a3b6b54 | Marei Peischl | \dim_new:N \l_kivi_tab_desc_leftskip_dim
|
||
9bbfe2cb | Marei Peischl | |||
\cs_new:Nn \__kivi_set_colwidth:nn {
|
||||
\dim_set:cn {l_kivi_tab_#1_dim} {#2}
|
||||
}
|
||||
\cs_new:Nn \__kivi_initialize_columns: {
|
||||
\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
|
||||
\bool_if_exist:cF {l_kivi_col_##1_bool}
|
||||
{
|
||||
\bool_new:c {l_kivi_col_##1_bool}
|
||||
\dim_new:c {l_kivi_tab_##1_dim}
|
||||
\keys_define:nn {kivi/PricingTable} {
|
||||
##1 .choice:,
|
||||
##1 / true .code:n = \bool_set_true:c {l_kivi_col_##1_bool},
|
||||
##1 / false .code:n = \bool_set_false:c {l_kivi_col_##1_bool},
|
||||
##1 / unknown .code:n = {
|
||||
\bool_set_true:c {l_kivi_col_##1_bool}
|
||||
\dim_set:cn {l_kivi_tab_##1_dim} {####1}
|
||||
},
|
||||
##1 .default:n = true,
|
||||
##1 .initial:n = true,
|
||||
##1 / header .prop_put:c = {l_kivi_col_##1_prop},
|
||||
##1 / colspec .prop_put:c = {l_kivi_col_##1_prop},
|
||||
}
|
||||
}
|
||||
c05124af | Marei Peischl | }
|
||
}
|
||||
9bbfe2cb | Marei Peischl | \clist_new:N \g_kivi_pricingtable_col_clist
|
||
\keys_define:nn {kivi/PricingTable} {
|
||||
columns .code:n =
|
||||
\clist_gset:Nn \g_kivi_pricingtable_col_clist {#1}
|
||||
\__kivi_initialize_columns:,
|
||||
columns .initial:n = {pos, id, desc, amount, price, pricetotal},
|
||||
}
|
||||
c05124af | Marei Peischl | % set default values for colwidth
|
||
9bbfe2cb | Marei Peischl | \keys_set:nn {kivi/PricingTable} {
|
||
pos=5ex,
|
||||
id=4em,
|
||||
amount=5em,
|
||||
price=7em,
|
||||
pricetotal=7em,
|
||||
% desc=auto,
|
||||
pos/header=\position,
|
||||
id/header=\artikelnummer,
|
||||
desc/header=\bezeichnung,
|
||||
amount/header=\menge,
|
||||
price/header=\einzelpreis,
|
||||
pricetotal/header=\gesamtpreis,
|
||||
price / colspec = Price,
|
||||
pricetotal / colspec = Price ,
|
||||
}
|
||||
4987cdc7 | Jan Büren | |||
\dim_new:N \g_kivi_tabcolsep_dim
|
||||
\dim_gset:Nn \g_kivi_tabcolsep_dim {.5\tabcolsep}
|
||||
c05124af | Marei Peischl | |||
c659bf51 | Marei Peischl | \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:}
|
||||
}
|
||||
c05124af | Marei Peischl | \cs_new:Nn \__kivi_calc_desc_column: {
|
||
9bbfe2cb | Marei Peischl | \dim_zero:N \l_kivi_tab_desc_leftskip_dim
|
||
\dim_zero:N \l_kivi_tab_desc_dim
|
||||
\bool_set_false:N \l_tmpa_bool
|
||||
c659bf51 | Marei Peischl | \tl_gclear:N \g_kivi_Pricing_colspec_tl
|
||
9bbfe2cb | Marei Peischl | \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
|
||||
c659bf51 | Marei Peischl | \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {p{\l_kivi_tab_desc_dim}}
|
||
9bbfe2cb | Marei Peischl | }{
|
||
c659bf51 | Marei Peischl | \bool_if:cT {l_kivi_col_##1_bool} {
|
||
\bool_if:NTF \l_tmpa_bool {
|
||||
9bbfe2cb | Marei Peischl | \dim_sub:Nn \l_kivi_tab_desc_dim {
|
||
\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
|
||||
}
|
||||
c659bf51 | Marei Peischl | }{
|
||
9bbfe2cb | Marei Peischl | \dim_add:Nn \l_kivi_tab_desc_leftskip_dim {
|
||
\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
|
||||
}
|
||||
}
|
||||
c659bf51 | Marei Peischl | \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:}}}
|
||||
9bbfe2cb | Marei Peischl | }
|
||
}
|
||||
c05124af | Marei Peischl | }
|
||
c659bf51 | Marei Peischl | \tl_gput_left:Nn \g_kivi_Pricing_colspec_tl {@{}}
|
||
\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {@{}}
|
||||
4987cdc7 | Jan Büren | }
|
||
9bbfe2cb | Marei Peischl | \newcolumntype{P}[1]{>{\raggedleft\arraybackslash}p{#1}<{\__kivi_tab_column_currency:}}
|
||
4987cdc7 | Jan Büren | |||
\RequirePackage{tcolorbox}
|
||||
\tcbuselibrary{breakable, skins}
|
||||
01b1d8ff | Marei Peischl | |||
\tcb@new@skin{kivi@LT}{base@unbroken,%
|
||||
frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
|
||||
skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
|
||||
underlay~first~and~middle={
|
||||
\node[anchor=north] at (interior.north) {\csname box_use:c\endcsname {g_kivi_LT@head_box}};
|
||||
\node[anchor=south] at (interior.south) {\csname box_use:c\endcsname {g_kivi_LT@foot_box}};
|
||||
},
|
||||
underlay~unbroken~and~last={
|
||||
\node[anchor=north] at (interior.north) {\csname box_use:c\endcsname {g_kivi_LT@head_box}};
|
||||
9bbe784a | Marei Peischl | \node[anchor=south] at (interior.south) {\csname box_use:c\endcsname {g_kivi_LT@lastfoot_box}};
|
||
01b1d8ff | Marei Peischl | },
|
||
boxsep=0pt,
|
||||
boxrule=0pt,
|
||||
left=0pt,
|
||||
right=0pt,
|
||||
0f97d98c | Marei Peischl | bottom=\box_ht:N \g_kivi_LT@foot_box+\box_dp:N \g_kivi_LT@foot_box + \aboverulesep,
|
||
top=\box_ht:N \g_kivi_LT@head_box+\box_dp:N \g_kivi_LT@head_box +\belowrulesep,
|
||||
01b1d8ff | Marei Peischl | parbox=false,
|
||
}
|
||||
\tcb@new@skin{kivi@LT@first}{base@first,%
|
||||
frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
|
||||
skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
|
||||
}
|
||||
\tcb@new@skin{kivi@LT@middle}{base@middle,%
|
||||
frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
|
||||
skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
|
||||
}
|
||||
\tcb@new@skin{kivi@LT@last}{base@last,%
|
||||
frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
|
||||
skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
|
||||
}
|
||||
\tcbset{kivi@LT/.style={skin=kivi@LT}}%
|
||||
4987cdc7 | Jan Büren | \seq_new:N \l_kivi_PricingTable_seq
|
||
c05124af | Marei Peischl | \seq_new:N \l_kivi_columns_seq
|
||
4987cdc7 | Jan Büren | \seq_new:N \g_kivi_extraDescription_seq
|
||
\newcommand{\FakeTable}[1]{
|
||||
\par
|
||||
\seq_set_split:Nnn \l_kivi_PricingTable_seq {\tabularnewline} {#1}
|
||||
9bbfe2cb | Marei Peischl | \seq_remove_all:Nn \l_kivi_PricingTable_seq {}
|
||
4987cdc7 | Jan Büren | \begingroup
|
||
7a3c31d4 | Marei Peischl | \setlength{\parskip}{\c_zero_dim}
|
||
bd3479e4 | Marei Peischl | \let\ExtraDescription\__kivi_addExtraDescription:n
|
||
4987cdc7 | Jan Büren | \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
|
||
\seq_map_inline:Nn \l_kivi_PricingTable_seq {
|
||||
c05124af | Marei Peischl | \seq_set_split:Nnn \l_kivi_columns_seq {&} {##1}
|
||
4987cdc7 | Jan Büren | \seq_gclear:N \g_kivi_extraDescription_seq
|
||
c05124af | Marei Peischl | \exp_args:Nnx \use:n {\tabular[t]}\g_kivi_Pricing_colspec_tl
|
||
\seq_pop_left:NN \__l_FakeTable_columns_seq \l_tmpa_tl
|
||||
\seq_item:Nn \l_kivi_columns_seq {\l_tmpa_tl}
|
||||
\seq_map_inline:Nn \__l_FakeTable_columns_seq {
|
||||
&\seq_item:Nn \l_kivi_columns_seq {####1}
|
||||
}
|
||||
4987cdc7 | Jan Büren | \endtabular
|
||
\seq_if_empty:NTF \g_kivi_extraDescription_seq
|
||||
2a3b6b54 | Marei Peischl | {\par}
|
||
0b2c2949 | Marei Peischl | {\par\nopagebreak
|
||
c5d1ec18 | Marei Peischl | \begingroup
|
||
2a3b6b54 | Marei Peischl | \setlength{\hsize}{\dimexpr\l_kivi_tab_desc_dim+\l_kivi_tab_desc_leftskip_dim}
|
||
\setlength{\leftskip}{\l_kivi_tab_desc_leftskip_dim}
|
||||
b06bdb41 | Marei Peischl | \usekomafont{extraDescription}
|
||
c5d1ec18 | Marei Peischl | \seq_use:Nn \g_kivi_extraDescription_seq {\\}
|
||
0ea3d7bd | Marei Peischl | \par
|
||
9bbfe2cb | Marei Peischl | \endgroup
|
||
4987cdc7 | Jan Büren | }
|
||
}
|
||||
\endgroup
|
||||
}
|
||||
c05124af | Marei Peischl | \seq_new:N \__l_FakeTable_columns_seq
|
||
\cs_new:Nn \__kivi_setup_FakeTable: {
|
||||
\seq_clear:N \__l_FakeTable_columns_seq
|
||||
9bbfe2cb | Marei Peischl | \int_zero:N \l_tmpa_int
|
||
\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
|
||||
\int_incr:N \l_tmpa_int
|
||||
\bool_if:cT {l_kivi_col_##1_bool} {\seq_put_right:Nx \__l_FakeTable_columns_seq {\int_use:N \l_tmpa_int}}
|
||||
}
|
||||
c05124af | Marei Peischl | }
|
||
4987cdc7 | Jan Büren | \tl_new:N \g_kivi_Pricing_colspec_tl
|
||
c05124af | Marei Peischl | \tl_gset:Nn \g_kivi_Pricing_colspec_tl {
|
||
@{}
|
||||
\bool_if:NT \l_kivi_col_pos_bool {p{\l_kivi_tab_pos_dim}}
|
||||
\bool_if:NT \l_kivi_col_id_bool {p{\l_kivi_tab_id_dim}}
|
||||
p{\l_kivi_tab_desc_dim}
|
||||
\bool_if:NT \l_kivi_col_amount_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_amount_dim}}}
|
||||
9bbfe2cb | Marei Peischl | \bool_if:NT \l_kivi_col_price_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_price_dim}<{\__kivi_tab_column_currency:}}}
|
||
\bool_if:NT \l_kivi_col_pricetotal_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_pricetotal_dim}<{\__kivi_tab_column_currency:}}}
|
||||
c05124af | Marei Peischl | @{}
|
||
}
|
||||
4987cdc7 | Jan Büren | |||
9bbfe2cb | Marei Peischl | \cs_new:Nn \__kivi_tab_column_currency: {\,\currency}
|
||
736bde4c | Marei Peischl | \def\tabcurrency{\__kivi_tab_column_currency:}
|
||
9bbfe2cb | Marei Peischl | \cs_set:Nn \__kivi_tab_column_header_currency: {}
|
||
\cs_set_eq:NN \__kivi_tab_column_body_currency: \__kivi_tab_column_currency:
|
||||
4987cdc7 | Jan Büren | |||
\clist_map_inline:nn {head, foot, firsthead, lastfoot} {%TODO reduce
|
||||
\box_new:c {g_kivi_LT@#1_box}
|
||||
}
|
||||
9bbfe2cb | Marei Peischl | \newkomafont{PricingTableHeader}{\bfseries}
|
||
c05124af | Marei Peischl | \cs_new:Nn \__kivi_setup_LT_boxes: {
|
||
\__kivi_calc_desc_column:
|
||||
4987cdc7 | Jan Büren | \hbox_gset:Nn \g_kivi_LT@head_box {
|
||
c05124af | Marei Peischl | \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
|
||
\exp_args:Nnx \use:n {\tabular[b]}\g_kivi_Pricing_colspec_tl
|
||||
a89ea81f | Marei Peischl | \__kivi_PricingTabular_header:
|
||
c05124af | Marei Peischl | \endtabular
|
||
4987cdc7 | Jan Büren | }
|
||
\hbox_gset:Nn \g_kivi_LT@foot_box {
|
||||
c05124af | Marei Peischl | \raisebox{\depth}{
|
||
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}r@{}}
|
||||
\midrule
|
||||
\strut\weiteraufnaechsterseite
|
||||
\end{tabular*}
|
||||
}
|
||||
4987cdc7 | Jan Büren | }
|
||
9bbe784a | Marei Peischl | \hbox_gset:Nn \g_kivi_LT@lastfoot_box {
|
||
\raisebox{\dimexpr\depth+\baselineskip}[0pt][0pt]{
|
||||
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}r@{}}
|
||||
\bottomrule
|
||||
\end{tabular*}
|
||||
}
|
||||
}
|
||||
4987cdc7 | Jan Büren | }
|
||
%Macht es sinn hier eine Variante zu machen, in der alle Spalten Belegbar sind?
|
||||
\newenvironment{PricingTotal}{
|
||||
736bde4c | Marei Peischl | \par\nointerlineskip
|
||
e12489db | Marei Peischl | \unskip
|
||
\tabular[t]{@{}p{\dim_eval:n {\linewidth-\l_kivi_tab_pricetotal_dim-2\tabcolsep}}P{\l_kivi_tab_pricetotal_dim}@{}}
|
||||
4987cdc7 | Jan Büren | \midrule
|
||
}{
|
||||
9bbe784a | Marei Peischl | \endtabular
|
||
4987cdc7 | Jan Büren | }
|
||
bd3479e4 | Marei Peischl | |||
\newcommand*\ExtraDescription{
|
||||
\PackageError{kiviletter}{The~command~\string\ExtraDescription\space~may~be~only~used~inside~the~\string\FakeTable\space~environment.}{See~documentation~for~details}
|
||||
}
|
||||
\cs_new:Nn \__kivi_addExtraDescription:n {\seq_gput_right:Nn \g_kivi_extraDescription_seq {#1}}
|
||||
c05124af | Marei Peischl | |||
4987cdc7 | Jan Büren | \newenvironment{PricingTabular}[1][]{
|
||
\begingroup
|
||||
736bde4c | Marei Peischl | \dim_set:Nn \parskip {\c_zero_dim}
|
||
9bbe784a | Marei Peischl | \tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
|
||
4987cdc7 | Jan Büren | \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
|
||
c05124af | Marei Peischl | \__kivi_calc_desc_column:
|
||
\exp_args:Nx \longtable \g_kivi_Pricing_colspec_tl
|
||||
4987cdc7 | Jan Büren | % Tabellenkopf
|
||
a89ea81f | Marei Peischl | \__kivi_PricingTabular_header:
|
||
4987cdc7 | Jan Büren | \endhead
|
||
\midrule
|
||||
4ae9f9c0 | Marei Peischl | \rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
|
||
4987cdc7 | Jan Büren | \endfoot
|
||
9bbe784a | Marei Peischl | \bottomrule
|
||
\endlastfoot
|
||||
4987cdc7 | Jan Büren | }{
|
||
\endlongtable
|
||||
\endgroup
|
||||
}
|
||||
a89ea81f | Marei Peischl | \cs_set:Nn \__kivi_PricingTabular_header: {
|
||
\toprule
|
||||
\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
|
||||
\bool_set_false:N \l_tmpa_bool
|
||||
\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
|
||||
\bool_if:cT {l_kivi_col_##1_bool} {
|
||||
\bool_if:NT \l_tmpa_bool {&}
|
||||
\bool_set_true:N \l_tmpa_bool
|
||||
\usekomafont{PricingTableHeader}
|
||||
\prop_item:cn {l_kivi_col_##1_prop} {header}
|
||||
}
|
||||
}
|
||||
\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:
|
||||
\\
|
||||
\midrule
|
||||
}
|
||||
4987cdc7 | Jan Büren | |||
374086f0 | Marei Peischl | \keys_define:nn {kivi/SimpleTabular} {
|
||
colspec .tl_set:N =\l_kivi_SimpleTabular_colspec_tl,
|
||||
colspec .initial:n = {rrX},
|
||||
headline .tl_set:N = \l_kivi_SimpleTabular_headline_tl,
|
||||
headline .initial:n = {\bfseries\position & \bfseries\menge & \bfseries\bezeichnung},
|
||||
}
|
||||
4987cdc7 | Jan Büren | |||
0ea3d7bd | Marei Peischl | \newcommand*{\SetupSimpleTabular}[1]{\keys_set:nn {kivi/SimpleTabular} {#1}}
|
||
\newcommand*{\SetupPricingTabular}[1]{\keys_set:nn {kivi/PricingTable} {#1}}
|
||||
374086f0 | Marei Peischl | \newenvironment{SimpleTabular}[1][]
|
||
4987cdc7 | Jan Büren | {
|
||
374086f0 | Marei Peischl | \tl_if_in:nnTF {#1} {=} {\keys_set:nn {kivi/SimpleTabular} {#1}} {\tl_if_empty:nF {#1} {\tl_set:Nn \l_kivi_SimpleTabular_headline_tl {#1}}}
|
||
4987cdc7 | Jan Büren | \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
|
||
0ea3d7bd | Marei Peischl | \dim_set:Nn \parskip {\c_zero_dim}
|
||
374086f0 | Marei Peischl | \tl_put_right:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
|
||
\tl_put_left:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
|
||||
\exp_args:NnV \xltabular{\linewidth}\l_kivi_SimpleTabular_colspec_tl
|
||||
0ea3d7bd | Marei Peischl | \toprule
|
||
\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
|
||||
\l_kivi_SimpleTabular_headline_tl
|
||||
\\
|
||||
\noalign{\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:}
|
||||
\midrule
|
||||
374086f0 | Marei Peischl | \endhead
|
||
0ea3d7bd | Marei Peischl | \midrule
|
||
\rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
|
||||
4987cdc7 | Jan Büren | \endfoot
|
||
0ea3d7bd | Marei Peischl | \bottomrule
|
||
4987cdc7 | Jan Büren | \endlastfoot
|
||
\ignorespaces
|
||||
}{
|
||||
\def\@currenvir{tabularx}
|
||||
\endxltabular
|
||||
}
|
||||
662d2792 | Marei Peischl | %PricingTabular* kann automatisch spalten ignorieren
|
||
% \begin{PricingTabular*}[id=false]
|
||||
% deaktiviert damit die Spalte der Produktnummer
|
||||
% analog ist dies für pos, amount, price, pricetotal möglich.
|
||||
% Die Spalte der Bezeichnung ist nicht deaktivierbar
|
||||
01b1d8ff | Marei Peischl | \newenvironment{PricingTabular*}[1][]{
|
||
\tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
|
||||
\__kivi_setup_LT_boxes:
|
||||
\__kivi_setup_FakeTable:
|
||||
736bde4c | Marei Peischl | \dim_set:Nn \parskip {\c_zero_dim}
|
||
01b1d8ff | Marei Peischl | \PricingTabularBox\ignorespaces
|
||
}{\endPricingTabularBox}
|
||||
4987cdc7 | Jan Büren | |||
01b1d8ff | Marei Peischl | \newtcolorbox{PricingTabularBox}{breakable,skin=kivi@LT}
|
||
4987cdc7 | Jan Büren | |||
2e0414b5 | Marei Peischl | \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
|
||||
}
|
||||
4987cdc7 | Jan Büren | |||
\setkomavar{location}{
|
||||
71650e02 | Marei Peischl | \Ifkomavarempty{transaction}{}{
|
||
4987cdc7 | Jan Büren | \bfseries
|
||
\usekomavar{transaction}
|
||||
}
|
||||
\par
|
||||
\medskip
|
||||
2e0414b5 | Marei Peischl | \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}
|
||||
}
|
||||
4987cdc7 | Jan Büren | }
|
||
\removereffields
|
||||
\AtBeginLetter{
|
||||
\ifdim\ht\shippingAddressBox>\z@
|
||||
18e3b943 | Marei Peischl | \@addtoplength{refvpos}{\dimexpr\ht\shippingAddressBox+\dp\shippingAddressBox}
|
||
\@addtoplength{refvpos}{4\baselineskip}%sep between address boxes
|
||||
4987cdc7 | Jan Büren | \fi
|
||
}
|
||||
736bde4c | Marei Peischl | |||
4987cdc7 | Jan Büren | \fi
|
||
71650e02 | Marei Peischl | %Fallback for older KOMA-Script-Versions
|
||
\cs_if_exist:NF \Ifstr {\let\Ifstr\ifstr}
|
||||
\cs_if_exist:NF \Ifkomavarempty {\let\Ifkomavarempty\ifkomavarempty}
|
||||
%Definitionen für die insettings.tex
|
||||
736bde4c | Marei Peischl | \newcommand*{\setupIdentpath}[1]{
|
||
\int_set:Nn \l_kivi_tmp_int {1}
|
||||
\bool_set_true:N \l_kivi_tmp_bool
|
||||
\bool_while_do:Nn \l_kivi_tmp_bool {
|
||||
\file_if_exist:nTF {firma\int_use:N \l_kivi_tmp_int/ident.tex}
|
||||
{
|
||||
\exp_args:Nf \str_if_in:nnTF {#1} {Firma\int_use:N \l_kivi_tmp_int}
|
||||
{
|
||||
\newcommand*{\identpath}{firma\int_use:N \l_kivi_tmpa_int}
|
||||
\bool_set_false:N \l_kivi_tmp_bool
|
||||
}
|
||||
{\int_incr:N \l_kivi_tmp_int}
|
||||
}
|
||||
{
|
||||
\bool_set_false:N \l_kivi_tmp_bool
|
||||
\newcommand*{\identpath}{firma}
|
||||
}
|
||||
}
|
||||
}
|
||||
\newcommand*{\setupCurrencyConfig}[2]{
|
||||
\tl_new:N \g_kivi_currency_tl
|
||||
\exp_args:Nf \str_if_in:nnT {#2} {USD} {\tl_gset:Nn \g_kivi_currency_tl {usd}}
|
||||
\exp_args:Nf \str_if_in:nnT {#2} {CHF} {\tl_gset:Nn \g_kivi_currency_tl {chf}}
|
||||
\exp_args:Nf \str_if_in:nnT {#2} {EUR} {\tl_gset:Nn \g_kivi_currency_tl {euro}}
|
||||
\tl_if_empty:NT \g_kivi_currency_tl {
|
||||
\tl_gset:Nn \g_kivi_currency_tl {default}
|
||||
\edef \currency {\tl_to_str:N \lxcurrency}
|
||||
}
|
||||
\input{#1/\g_kivi_currency_tl _account.tex}
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
4987cdc7 | Jan Büren | |||
\renewcommand*{\raggedsignature}{\raggedright}
|
||||
b06bdb41 | Marei Peischl | \newkomafont{extraDescription}{}
|
||
4987cdc7 | Jan Büren | \endinput
|