X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/526ed9a1ddc774381b29e23ef230c686f8fb8b43..53593baa211863fbf66540cf1bcc36c8fb37257f:/templates/print/marei/kiviletter.sty

diff --git a/templates/print/marei/kiviletter.sty b/templates/print/marei/kiviletter.sty
index 8b88595a9..79b33a818 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}
 
@@ -51,6 +51,7 @@
 \RequirePackage{scrletter}
 \LoadLetterOption{DIN}
 
+\newkomavar{taxpoint}
 \newkomavar{transaction}
 \newkomavar[\lieferschein{}~\nr]{delivery}
 \newkomavar[\angebot{}~\nr]{quote}
@@ -305,6 +306,7 @@
   \let\ExtraDescription\__kivi_addExtraDescription:n
   \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
   \seq_map_inline:Nn \l_kivi_PricingTable_seq {
+    \if_mode_horizontal: \par \fi
     \bool_if:NT \g__kivi_Tabular_rowcolor_bool {
       \int_gincr:N \g__kivi_PricingTable_rowcolor_int
       \int_if_odd:nTF {\g__kivi_PricingTable_rowcolor_int}
@@ -598,6 +600,7 @@
       \locationentry{quote}
       \locationentry{orderID}
       \locationentry{projectID}
+      \locationentry{taxpoint}
       \locationentry[\ansprechpartner]{fromname}
       \locationentry{fromphone}
       \locationentry*{fromemail}
@@ -639,18 +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 {default}
-    \edef \currency {\tl_to_str:N \lxcurrency}
+    \tl_if_empty:oTF {#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
 
 
