From: Marei (peiTeX) Date: Sun, 27 Sep 2020 20:55:27 +0000 (+0200) Subject: marei: simplify insettings.tex file structure X-Git-Tag: kivitendo-mebil_0.1-0~9^2~699 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=736bde4c21009220f011b5aec59f5d7620c6d5fc;p=kivitendo-erp.git marei: simplify insettings.tex file structure --- diff --git a/templates/print/marei/insettings.tex b/templates/print/marei/insettings.tex index 76dc1d9b0..6d49f05dd 100644 --- a/templates/print/marei/insettings.tex +++ b/templates/print/marei/insettings.tex @@ -18,61 +18,28 @@ % Mandanten-/Firmenabhängigkeiten -% Pfad zu firmenspez. Angaben -% Hat man mehrere Mandanten muß man statt "Firma1" den Datenbanknamen seines -% Mandanten eingeben. - -\ExplSyntaxOn -\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} - { - \str_if_in:NnTF \kivicompany {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} - } -} - -\ExplSyntaxOff - +% Pfad zu firmenspez. Angaben, sofern kein Unterordner mit dem Datenbanknamen des Mandanten in der Vorlage existiert, wird der Unterordner „firma“ verwendet. Der Datenbankname ist ab hier im Makro \identpath gespeichert +\setupIdentpath{\kivicompany} -% Identität +% Lade die Konfiguration aus dem entsprechenden Unterordner \input{\identpath/ident.tex} -\ExplSyntaxOn %Setze Briefkopf-logo falls vorhanden \setkomavar{fromlogo}{\includegraphics[width=.25\linewidth]{\identpath/briefkopf}} % Währungen/Konten -\tl_new:N \g_kivi_currency_tl -\str_if_in:NnT \lxcurrency {USD} {\tl_gset:Nn \g_kivi_currency_tl {usd}} -\str_if_in:NnT \lxcurrency {CHF} {\tl_gset:Nn \g_kivi_currency_tl {chf}} -\str_if_in:NnT \lxcurrency {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{\identpath/\g_kivi_currency_tl _account.tex} - -\ExplSyntaxOff - - -% keine Absätze nach rechts einrücken -\setlength\parindent{0pt} - +% Die Konfiguration bedindet sich in der Datei +% \identpath/_account.tex +\setupCurrencyConfig{\identpath}{\lxcurrency} % Befehl f. normale Schriftart und -größe + +\KOMAoptions{ + fontsize=10pt, + parskip=half-,% Absatzkennzeichnung durch Abstand statt Einzug +} \renewcommand*{\familydefault}{\sfdefault} \KOMAoptions{fontsize=10pt} diff --git a/templates/print/marei/kiviletter.sty b/templates/print/marei/kiviletter.sty index 829b83ae8..cce6ebec6 100644 --- a/templates/print/marei/kiviletter.sty +++ b/templates/print/marei/kiviletter.sty @@ -283,6 +283,7 @@ contents={\usebox\shippingAddressBox} } \cs_new: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: @@ -320,8 +321,7 @@ contents={\usebox\shippingAddressBox} %Macht es sinn hier eine Variante zu machen, in der alle Spalten Belegbar sind? \newenvironment{PricingTotal}{ - \par - \vspace{-\ht\strutbox} + \par\nointerlineskip \unskip \tabular[t]{@{}p{\dim_eval:n {\linewidth-\l_kivi_tab_pricetotal_dim-2\tabcolsep}}P{\l_kivi_tab_pricetotal_dim}@{}} \midrule @@ -339,6 +339,7 @@ contents={\usebox\shippingAddressBox} \newenvironment{PricingTabular}[1][]{ \begingroup + \dim_set:Nn \parskip {\c_zero_dim} \tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}} \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim} \__kivi_calc_desc_column: @@ -413,6 +414,7 @@ contents={\usebox\shippingAddressBox} \tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}} \__kivi_setup_LT_boxes: \__kivi_setup_FakeTable: + \dim_set:Nn \parskip {\c_zero_dim} \PricingTabularBox\ignorespaces }{\endPricingTabularBox} @@ -457,9 +459,42 @@ contents={\usebox\shippingAddressBox} \@addtoplength{refvpos}{4\baselineskip}%sep between address boxes \fi } -\ExplSyntaxOff + \fi +\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 \renewcommand*{\raggedsignature}{\raggedright}