From: Marei (peiTeX) Date: Wed, 23 Feb 2022 10:01:40 +0000 (+0100) Subject: marei: Währungsvoreinstellung Euro + option zur Anpassung in insettings X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~174^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9d8ef3373c880687b67bc1054d72841f4324c4f7;p=kivitendo-erp.git marei: Währungsvoreinstellung Euro + option zur Anpassung in insettings --- diff --git a/templates/print/marei/insettings.tex b/templates/print/marei/insettings.tex index d617bb0d4..4174909c4 100644 --- a/templates/print/marei/insettings.tex +++ b/templates/print/marei/insettings.tex @@ -1,6 +1,6 @@ %% insettings.tex -%% Copyright 2019 Marei Peischl -\ProvidesFile{insettings.tex}[2019/12/22 Konfigurationsdatei kivitendo ERP] +%% Copyright 2019–2022 Marei Peischl +\ProvidesFile{insettings.tex}[2022/02/23 Konfigurationsdatei kivitendo ERP] % Sprachüberprüfung \RequirePackage[english, ngerman]{babel} @@ -34,11 +34,10 @@ % Währungen/Konten % Die Konfiguration bedindet sich in der Datei -% \identpath/_account.tex +% \identpath/_account.tex +% das optionale Argument ist als euro vorbelegt und gibt die Einstellung an, falls \lxcurrency nicht von kivitendo übergeben wird. -\@ifundefined{lxcurrency}{}{ - \setupCurrencyConfig{\identpath}{\lxcurrency} -} +\setupCurrencyConfig[euro]{\identpath}{\lxcurrency} % Befehl f. normale Schriftart und -größe diff --git a/templates/print/marei/kiviletter.sty b/templates/print/marei/kiviletter.sty index 8b671301b..983ffa2cb 100644 --- a/templates/print/marei/kiviletter.sty +++ b/templates/print/marei/kiviletter.sty @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{kiviletter}[2020/04/24 Letter Layouts for Kivitendo] +\ProvidesPackage{kiviletter}[2022/04/23 Letter Layouts for Kivitendo] \RequirePackage{l3keys2e} @@ -642,17 +642,30 @@ } } -\newcommand*{\setupCurrencyConfig}[2]{ +\newcommand*{\setupCurrencyConfig}[3][euro]{ \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}} + \exp_args:Nf \str_if_in:nnT {#3} {USD} {\tl_gset:Nn \g_kivi_currency_tl {usd}} + \exp_args:Nf \str_if_in:nnT {#3} {CHF} {\tl_gset:Nn \g_kivi_currency_tl {chf}} + \exp_args:Nf \str_if_in:nnT {#3} {EUR} {\tl_gset:Nn \g_kivi_currency_tl {euro}} \tl_if_empty:NT \g_kivi_currency_tl { - \tl_gset:Nn \g_kivi_currency_tl {euro} % euro ist standard, chf oder usd alternativ + \tl_if_empty:nTF {#3} { + \tl_gset:Nn \g_kivi_currency_tl {#1} + } { + \tl_gset:Nn \g_kivi_currency_tl {#3} + } } - \input{#1/\g_kivi_currency_tl _account.tex} + \input{#2/\g_kivi_currency_tl _account.tex} + \let\setupCurrencyConfig\_kivi_currency_already_configured:w +} + +\newcommand*{\_kivi_currency_already_configured:w}[3][euro]{ + \msg_error:nnx {kiviletter} {currency-already-configured} {\g_kivi_currency_tl} } +\msg_new:nnn {kiviletter} {currency-already-configured} { + The~currency~configuration~is~a~global~setting~for~each~document.\\ + It's~already~set~to~#1,~please~remove~the~second~call~of~\string\setupCurrencyConfig. +} \ExplSyntaxOff