From 9d8ef3373c880687b67bc1054d72841f4324c4f7 Mon Sep 17 00:00:00 2001 From: "Marei (peiTeX)" Date: Wed, 23 Feb 2022 11:01:40 +0100 Subject: [PATCH] =?utf8?q?marei:=20W=C3=A4hrungsvoreinstellung=20Euro=20?= =?utf8?q?=20+=20option=20zur=20Anpassung=20in=20insettings?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- templates/print/marei/insettings.tex | 11 +++++------ templates/print/marei/kiviletter.sty | 27 ++++++++++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) 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 -- 2.20.1