Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3d229eb9

Von Marei Peischl vor mehr als 3 Jahren hinzugefügt

  • ID 3d229eb932520febe9d8147cf3413c7b13a23b4b
  • Vorgänger 4ec81d44
  • Nachfolger 424ee46d

marei: adjust indentation using latexindent according to kivitendo regulations 2 spaces instead of 1 tab

Unterschiede anzeigen:

templates/print/marei/kiviletter.sty
21 21
\KOMAoptions{fontsize=12pt}
22 22
% Schriftart, Eingabelayout der Tastatur
23 23
\ifPDFTeX
24
	\RequirePackage[utf8]{inputenc}% Nur notwendig, wenn Basis älter als TL2018
25
	\RequirePackage[T1]{fontenc}
26
	\RequirePackage{lmodern}
24
  \RequirePackage[utf8]{inputenc}% Nur notwendig, wenn Basis älter als TL2018
25
  \RequirePackage[T1]{fontenc}
26
  \RequirePackage{lmodern}
27 27

  
28
	\RequirePackage{eurosym}
29
	\DeclareUnicodeCharacter{20AC}{\euro}
28
  \RequirePackage{eurosym}
29
  \DeclareUnicodeCharacter{20AC}{\euro}
30 30
\else
31
	\RequirePackage{fontspec}
31
  \RequirePackage{fontspec}
32 32
\fi
33 33

  
34 34
\RequirePackage{xltabular}
......
40 40
\RequirePackage[fromlogo,fromalign=right,
41 41
  firstfoot=false,%Für einheitliche Randeinstellungen
42 42
  refline=nodate,
43
	]{scrletter}
43
]{scrletter}
44 44
\LoadLetterOption{DIN}
45 45

  
46 46
\newkomavar{transaction}
......
71 71

  
72 72

  
73 73
\DeclareNewLayer[
74
foreground,
75
hoffset=\useplength{toaddrhpos},
76
voffset=\dimexpr\useplength{toaddrvpos}+\useplength{toaddrheight}+4\baselineskip,%sep to shippingaddressbox
77
contents={\usebox\shippingAddressBox}
74
  foreground,
75
  hoffset=\useplength{toaddrhpos},
76
  voffset=\dimexpr\useplength{toaddrvpos}+\useplength{toaddrheight}+4\baselineskip,%sep to shippingaddressbox
77
  contents={\usebox\shippingAddressBox}
78 78
]{kivitendo.shippingaddress}
79 79

  
80 80
\newpairofpagestyles{kivitendo.letter}{}
......
82 82
\renewcommand*{\letterpagestyle}{kivitendo.letter}
83 83

  
84 84
\DeclareNewPageStyleByLayers{kivitendo.letter.first}{
85
	kivitendo.shippingaddress,
86
	plain.kivitendo.letter.head.odd,plain.kivitendo.letter.head.even,plain.kivitendo.letter.head.oneside,%
87
	plain.kivitendo.letter.foot.odd,plain.kivitendo.letter.foot.even,plain.kivitendo.letter.foot.oneside,%
85
  kivitendo.shippingaddress,
86
  plain.kivitendo.letter.head.odd,plain.kivitendo.letter.head.even,plain.kivitendo.letter.head.oneside,%
87
  plain.kivitendo.letter.foot.odd,plain.kivitendo.letter.foot.even,plain.kivitendo.letter.foot.oneside,%
88 88
}
89 89

  
90 90
\setkomavar{backaddress}{\firma\ $\cdot$ \strasse\ $\cdot$ \ort}
91 91

  
92 92
\setkomavar{firsthead}{
93
	\if@logo
94
	\rlap{\usekomavar{fromlogo}}%
95
	\fi
93
  \if@logo
94
    \rlap{\usekomavar{fromlogo}}%
95
  \fi
96 96
}
97 97

  
98 98
\@setplength{locwidth}{6cm}
......
103 103

  
104 104

  
105 105
\cs_new:Nn \__kivi_set_colwidth:nn  {
106
	\dim_set:cn {l_kivi_tab_#1_dim} {#2}
106
  \dim_set:cn {l_kivi_tab_#1_dim} {#2}
107 107
}
108 108

  
109 109

  
110 110
\cs_new:Nn \__kivi_initialize_columns: {
111
	\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
112
		\bool_if_exist:cF {l_kivi_col_##1_bool} 
113
		{
114
			\bool_new:c {l_kivi_col_##1_bool}
115
			\dim_new:c {l_kivi_tab_##1_dim}
116
			\keys_define:nn {kivi/PricingTable} {
117
				##1 .choice:,
118
				##1 / true .code:n = \bool_set_true:c {l_kivi_col_##1_bool},
119
				##1 / false .code:n = \bool_set_false:c {l_kivi_col_##1_bool},
120
				##1 / unknown .code:n = {
121
					\bool_set_true:c {l_kivi_col_##1_bool}
122
					\dim_set:cn {l_kivi_tab_##1_dim} {####1}
123
				},
124
				##1 .default:n = true,
125
				##1 .initial:n = true,
126
				##1 / header .prop_put:c = {l_kivi_col_##1_prop},
127
				##1 / colspec .prop_put:c = {l_kivi_col_##1_prop},
128
			}
129
		}
130
	}
111
  \clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
112
    \bool_if_exist:cF {l_kivi_col_##1_bool}
113
    {
114
      \bool_new:c {l_kivi_col_##1_bool}
115
      \dim_new:c {l_kivi_tab_##1_dim}
116
      \keys_define:nn {kivi/PricingTable} {
117
        ##1 .choice:,
118
        ##1 / true .code:n = \bool_set_true:c {l_kivi_col_##1_bool},
119
        ##1 / false .code:n = \bool_set_false:c {l_kivi_col_##1_bool},
120
        ##1 / unknown .code:n = {
121
            \bool_set_true:c {l_kivi_col_##1_bool}
122
            \dim_set:cn {l_kivi_tab_##1_dim} {####1}
123
          },
124
        ##1 .default:n = true,
125
        ##1 .initial:n = true,
126
        ##1 / header .prop_put:c = {l_kivi_col_##1_prop},
127
        ##1 / colspec .prop_put:c = {l_kivi_col_##1_prop},
128
      }
129
    }
130
  }
131 131
}
132 132

  
133 133
\clist_new:N \g_kivi_pricingtable_col_clist
134 134

  
135 135
\keys_define:nn {kivi/PricingTable} {
136
	columns .code:n = 
137
	\clist_gset:Nn \g_kivi_pricingtable_col_clist {#1}
138
	\__kivi_initialize_columns:,
139
	columns .initial:n = {pos, id, desc, amount, price, pricetotal},
140
	unknown .code:n = \keys_set:no {kivi/Tabular} {\l_keys_key_str=#1}
136
  columns .code:n =
137
  \clist_gset:Nn \g_kivi_pricingtable_col_clist {#1}
138
  \__kivi_initialize_columns:,
139
  columns .initial:n = {pos, id, desc, amount, price, pricetotal},
140
  unknown .code:n = \keys_set:no {kivi/Tabular} {\l_keys_key_str=#1}
141 141
}
142 142

  
143 143
% set default values for colwidth
144 144
\keys_set:nn {kivi/PricingTable} {
145
	pos=5ex,
146
	id=4em,
147
	amount=5em,
148
	price=7em,
149
	pricetotal=7em,
150
%	desc=auto,
151
	pos/header=\position,
152
	id/header=\artikelnummer,
153
	desc/header=\bezeichnung,
154
	amount/header=\menge,
155
	price/header=\einzelpreis,
156
	pricetotal/header=\gesamtpreis,
157
	price / colspec = Price,
158
	pricetotal / colspec = Price ,
145
  pos=5ex,
146
  id=4em,
147
  amount=5em,
148
  price=7em,
149
  pricetotal=7em,
150
  %	desc=auto,
151
  pos/header=\position,
152
  id/header=\artikelnummer,
153
  desc/header=\bezeichnung,
154
  amount/header=\menge,
155
  price/header=\einzelpreis,
156
  pricetotal/header=\gesamtpreis,
157
  price / colspec = Price,
158
  pricetotal / colspec = Price ,
159 159
}
160 160

  
161 161
\dim_new:N \g_kivi_tabcolsep_dim
......
163 163
\setlength\tabcolsep{.5\tabcolsep}
164 164

  
165 165
\prg_new_conditional:Nnn \kivi_if_Price_col:n {T} {
166
	\prop_get:cnN {l_kivi_col_#1_prop} {colspec} \l_tmpa_tl
167
	\exp_args:NV \tl_if_eq:nnTF \l_tmpa_tl {Price}
168
		{\prg_return_true:}
169
		{\prg_return_false:}
166
  \prop_get:cnN {l_kivi_col_#1_prop} {colspec} \l_tmpa_tl
167
  \exp_args:NV \tl_if_eq:nnTF \l_tmpa_tl {Price}
168
  {\prg_return_true:}
169
  {\prg_return_false:}
170 170
}
171 171

  
172 172

  
173 173
\cs_new:Nn \__kivi_calc_desc_column: {
174
	\bool_if:NTF \g__kivi_Tabular_rowcolor_bool
175
		{\dim_set:Nn \l_kivi_tab_desc_leftskip_dim {2\g_kivi_tabcolsep_dim}}
176
		{\dim_zero:N \l_kivi_tab_desc_leftskip_dim}
177
	\dim_zero:N \l_kivi_tab_desc_dim
178
	\bool_set_false:N \l_tmpa_bool
179
	\tl_gclear:N \g_kivi_Pricing_colspec_tl
180
	\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
181
		\tl_if_eq:nnTF {##1} {desc}  {
182
			\dim_set:Nn \l_kivi_tab_desc_dim {
183
				\textwidth-\l_kivi_tab_desc_leftskip_dim
184
			}
185
			\bool_set_true:N \l_tmpa_bool
186
			\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {p{\l_kivi_tab_desc_dim}}
187
		}{
188
			\bool_if:cT {l_kivi_col_##1_bool} {
189
				\bool_if:NTF \l_tmpa_bool {
190
					\dim_sub:Nn \l_kivi_tab_desc_dim {
191
						\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
192
					}
193
				}{
194
					\dim_add:Nn \l_kivi_tab_desc_leftskip_dim {
195
						\dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
196
					}
197
				}
198
				\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {K{\dim_use:c {l_kivi_tab_##1_dim}}}
199
				\kivi_if_Price_col:nT {##1} {\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {<{\__kivi_tab_column_currency:}}}
200
			}
201
		}
202
	}
203
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool {
204
		\tl_gput_left:Nn \g_kivi_Pricing_colspec_tl {@{}}
205
		\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {@{}}
206
	}
174
  \bool_if:NTF \g__kivi_Tabular_rowcolor_bool
175
  {\dim_set:Nn \l_kivi_tab_desc_leftskip_dim {2\g_kivi_tabcolsep_dim}}
176
  {\dim_zero:N \l_kivi_tab_desc_leftskip_dim}
177
  \dim_zero:N \l_kivi_tab_desc_dim
178
  \bool_set_false:N \l_tmpa_bool
179
  \tl_gclear:N \g_kivi_Pricing_colspec_tl
180
  \clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
181
    \tl_if_eq:nnTF {##1} {desc}  {
182
      \dim_set:Nn \l_kivi_tab_desc_dim {
183
        \textwidth-\l_kivi_tab_desc_leftskip_dim
184
      }
185
      \bool_set_true:N \l_tmpa_bool
186
      \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {p{\l_kivi_tab_desc_dim}}
187
    }{
188
      \bool_if:cT {l_kivi_col_##1_bool} {
189
        \bool_if:NTF \l_tmpa_bool {
190
          \dim_sub:Nn \l_kivi_tab_desc_dim {
191
            \dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
192
          }
193
        }{
194
          \dim_add:Nn \l_kivi_tab_desc_leftskip_dim {
195
            \dim_use:c {l_kivi_tab_##1_dim}+2\g_kivi_tabcolsep_dim
196
          }
197
        }
198
        \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {K{\dim_use:c {l_kivi_tab_##1_dim}}}
199
        \kivi_if_Price_col:nT {##1} {\tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {<{\__kivi_tab_column_currency:}}}
200
      }
201
    }
202
  }
203
  \bool_if:NF \g__kivi_Tabular_rowcolor_bool {
204
    \tl_gput_left:Nn \g_kivi_Pricing_colspec_tl {@{}}
205
    \tl_gput_right:Nn \g_kivi_Pricing_colspec_tl {@{}}
206
  }
207 207
}
208 208

  
209 209
\newcolumntype{K}[1]{>{\raggedleft\arraybackslash}p{#1}}
......
213 213
\tcbuselibrary{breakable, skins}
214 214

  
215 215
\tcb@new@skin{kivi@LT}{base@unbroken,%
216
	frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
217
	skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
218
	underlay~first~and~middle={
219
		\node[anchor=north]  at (interior.north)  {\csname box_use:c\endcsname  {g_kivi_LT@head_box}};
220
		\node[anchor=south]  at (interior.south)  {\csname box_use:c\endcsname  {g_kivi_LT@foot_box}};
221
	},
222
	underlay~unbroken~and~last={
223
	\node[anchor=north]  at (interior.north)  {\csname box_use:c\endcsname  {g_kivi_LT@head_box}};
224
	\node[anchor=south]  at (interior.south)  {\csname box_use:c\endcsname  {g_kivi_LT@lastfoot_box}};
225
	},
226
	boxsep=0pt,
227
	boxrule=0pt,
228
	left=0pt,
229
	right=0pt,
230
	bottom=\box_ht:N  \g_kivi_LT@foot_box+\box_dp:N  \g_kivi_LT@foot_box + \aboverulesep,
231
	top=\box_ht:N  \g_kivi_LT@head_box+\box_dp:N  \g_kivi_LT@head_box +\belowrulesep,
232
	parbox=false,
216
frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
217
skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
218
underlay~first~and~middle={
219
\node[anchor=north]  at (interior.north)  {\csname box_use:c\endcsname  {g_kivi_LT@head_box}};
220
\node[anchor=south]  at (interior.south)  {\csname box_use:c\endcsname  {g_kivi_LT@foot_box}};
221
},
222
underlay~unbroken~and~last={
223
\node[anchor=north]  at (interior.north)  {\csname box_use:c\endcsname  {g_kivi_LT@head_box}};
224
\node[anchor=south]  at (interior.south)  {\csname box_use:c\endcsname  {g_kivi_LT@lastfoot_box}};
225
},
226
boxsep=0pt,
227
boxrule=0pt,
228
left=0pt,
229
right=0pt,
230
bottom=\box_ht:N  \g_kivi_LT@foot_box+\box_dp:N  \g_kivi_LT@foot_box + \aboverulesep,
231
top=\box_ht:N  \g_kivi_LT@head_box+\box_dp:N  \g_kivi_LT@head_box +\belowrulesep,
232
parbox=false,
233 233
}
234 234

  
235 235
\tcb@new@skin{kivi@LT@first}{base@first,%
236
	frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
237
	skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
236
  frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
237
  skin~first=kivi@LT@first,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
238 238
}
239 239

  
240 240
\tcb@new@skin{kivi@LT@middle}{base@middle,%
241
	frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
242
	skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
241
  frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
242
  skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@middle,
243 243
}
244 244

  
245 245
\tcb@new@skin{kivi@LT@last}{base@last,%
246
	frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
247
	skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
246
  frame~engine=empty,interior~titled~engine=empty,interior~engine=empty,segmentation~engine=empty,title~engine=empty,%
247
  skin~first=kivi@LT@middle,skin~middle=kivi@LT@middle,skin~last=kivi@LT@last,
248 248
}
249 249

  
250 250
\tcbset{kivi@LT/.style={skin=kivi@LT}}%
......
256 256
\seq_new:N \g_kivi_extraDescription_seq
257 257

  
258 258
\int_new:N \l__kivi_PricingTable_rowcolor_int
259
\dim_new:N \l__kivi_fboxsep_dim 
259
\dim_new:N \l__kivi_fboxsep_dim
260 260
\dim_set:Nn \l__kivi_fboxsep_dim {\g_kivi_tabcolsep_dim}
261 261

  
262 262
%colorbox variant to only add vertical spacing
......
268 268
\def\kivi@tabcolorbox#1#{\protect\kivi@tabcolor@box{#1}}
269 269

  
270 270
\def\kivi@tabcolor@box#1#2{
271
	\tl_if_empty:oTF {#2} 
272
		\kivi@nocolor@b@x
273
		\kivi@color@b@x
274
	\relax{\color#1{#2}}
271
  \tl_if_empty:oTF {#2}
272
  \kivi@nocolor@b@x
273
  \kivi@color@b@x
274
  \relax{\color#1{#2}}
275 275
}
276 276
\long\def\kivi@color@b@x#1#2#3%
277 277
{\leavevmode
278
	\setbox\z@\hbox{{\set@color#3}}%
279
	\dimen@\ht\z@\advance\dimen@\l__kivi_fboxsep_dim\ht\z@\dimen@
280
	\dimen@\dp\z@\advance\dimen@\l__kivi_fboxsep_dim\dp\z@\dimen@
281
	{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}}
278
  \setbox\z@\hbox{{\set@color#3}}%
279
  \dimen@\ht\z@\advance\dimen@\l__kivi_fboxsep_dim\ht\z@\dimen@
280
  \dimen@\dp\z@\advance\dimen@\l__kivi_fboxsep_dim\dp\z@\dimen@
281
  {#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}}
282 282

  
283 283
\long\def\kivi@nocolor@b@x#1#2#3%
284 284
{\leavevmode
285
	\setbox\z@\hbox{#3}%
286
	\dimen@\ht\z@\advance\dimen@\l__kivi_fboxsep_dim\ht\z@\dimen@
287
	\dimen@\dp\z@\advance\dimen@\l__kivi_fboxsep_dim\dp\z@\dimen@
288
	{\box\z@}}
285
  \setbox\z@\hbox{#3}%
286
  \dimen@\ht\z@\advance\dimen@\l__kivi_fboxsep_dim\ht\z@\dimen@
287
  \dimen@\dp\z@\advance\dimen@\l__kivi_fboxsep_dim\dp\z@\dimen@
288
  {\box\z@}}
289 289

  
290 290
%%%
291 291

  
292 292

  
293 293
\newcommand{\FakeTable}[1]{
294
	\par
295
	\seq_set_split:Nnn \l_kivi_PricingTable_seq {\tabularnewline} {#1}
296
	\seq_remove_all:Nn \l_kivi_PricingTable_seq {}
297
	\begingroup
298
	\setlength{\parskip}{\c_zero_dim}
299
	\let\ExtraDescription\__kivi_addExtraDescription:n
300
	\setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
301
	\seq_map_inline:Nn \l_kivi_PricingTable_seq {
302
		\bool_if:NT \g__kivi_Tabular_rowcolor_bool {
303
			\int_gincr:N \g__kivi_PricingTable_rowcolor_int 
304
			\int_if_odd:nTF {\g__kivi_PricingTable_rowcolor_int}
305
			{\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_odd_tl}}
306
			{\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_even_tl}}
307
		}
308
		{\parbox{\linewidth}{
309
		\seq_set_split:Nnn  \l_kivi_columns_seq {&} {##1}
310
	\seq_gclear:N \g_kivi_extraDescription_seq
311
	\exp_args:Nnx \use:n {\tabular[t]}\g_kivi_Pricing_colspec_tl
312
		\seq_pop_left:NN \__l_FakeTable_columns_seq \l_tmpa_tl
313
		\seq_item:Nn \l_kivi_columns_seq {\l_tmpa_tl}
314
		\seq_map_inline:Nn \__l_FakeTable_columns_seq {
315
			&\seq_item:Nn \l_kivi_columns_seq {####1}
316
		}
317
	\endtabular
318
	\seq_if_empty:NTF \g_kivi_extraDescription_seq
319
	{\par}
320
	{\par\nopagebreak
321
	\begingroup
322
	\setlength{\leftskip}{\dim_eval:n {\bool_if:NT \g__kivi_Tabular_rowcolor_bool {-\tabcolsep} +\l_kivi_tab_desc_leftskip_dim}}
323
	\setlength{\hsize}{\dim_eval:n {\l_kivi_tab_desc_dim+\leftskip}}
324
	\usekomafont{extraDescription}
325
	\seq_use:Nn \g_kivi_extraDescription_seq {\\}
326
	\par
327
	\endgroup
328
	}
329
	}}
330
	}
331
	\endgroup\par
294
  \par
295
  \seq_set_split:Nnn \l_kivi_PricingTable_seq {\tabularnewline} {#1}
296
  \seq_remove_all:Nn \l_kivi_PricingTable_seq {}
297
  \begingroup
298
  \setlength{\parskip}{\c_zero_dim}
299
  \let\ExtraDescription\__kivi_addExtraDescription:n
300
  \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
301
  \seq_map_inline:Nn \l_kivi_PricingTable_seq {
302
    \bool_if:NT \g__kivi_Tabular_rowcolor_bool {
303
      \int_gincr:N \g__kivi_PricingTable_rowcolor_int
304
      \int_if_odd:nTF {\g__kivi_PricingTable_rowcolor_int}
305
      {\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_odd_tl}}
306
      {\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_even_tl}}
307
    }
308
    {\parbox{\linewidth}{
309
        \seq_set_split:Nnn  \l_kivi_columns_seq {&} {##1}
310
        \seq_gclear:N \g_kivi_extraDescription_seq
311
        \exp_args:Nnx \use:n {\tabular[t]}\g_kivi_Pricing_colspec_tl
312
        \seq_pop_left:NN \__l_FakeTable_columns_seq \l_tmpa_tl
313
        \seq_item:Nn \l_kivi_columns_seq {\l_tmpa_tl}
314
        \seq_map_inline:Nn \__l_FakeTable_columns_seq {
315
          &\seq_item:Nn \l_kivi_columns_seq {####1}
316
        }
317
        \endtabular
318
        \seq_if_empty:NTF \g_kivi_extraDescription_seq
319
        {\par}
320
        {\par\nopagebreak
321
          \begingroup
322
          \setlength{\leftskip}{\dim_eval:n {\bool_if:NT \g__kivi_Tabular_rowcolor_bool {-\tabcolsep} +\l_kivi_tab_desc_leftskip_dim}}
323
          \setlength{\hsize}{\dim_eval:n {\l_kivi_tab_desc_dim+\leftskip}}
324
          \usekomafont{extraDescription}
325
          \seq_use:Nn \g_kivi_extraDescription_seq {\\}
326
          \par
327
          \endgroup
328
        }
329
      }}
330
  }
331
  \endgroup\par
332 332
}
333 333

  
334 334

  
335 335
\seq_new:N  \__l_FakeTable_columns_seq
336 336
\cs_new:Nn \__kivi_setup_FakeTable: {
337
	\seq_clear:N \__l_FakeTable_columns_seq
338
	\int_zero:N \l_tmpa_int
339
	\clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
340
		\int_incr:N \l_tmpa_int
341
		\bool_if:cT {l_kivi_col_##1_bool} {\seq_put_right:Nx \__l_FakeTable_columns_seq {\int_use:N \l_tmpa_int}}
342
	}
337
  \seq_clear:N \__l_FakeTable_columns_seq
338
  \int_zero:N \l_tmpa_int
339
  \clist_map_inline:Nn \g_kivi_pricingtable_col_clist {
340
    \int_incr:N \l_tmpa_int
341
    \bool_if:cT {l_kivi_col_##1_bool} {\seq_put_right:Nx \__l_FakeTable_columns_seq {\int_use:N \l_tmpa_int}}
342
  }
343 343
}
344 344

  
345 345
\tl_new:N \g_kivi_Pricing_colspec_tl
346 346
\tl_gset:Nn \g_kivi_Pricing_colspec_tl {
347
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool {@{}}
348
	\bool_if:NT \l_kivi_col_pos_bool {p{\l_kivi_tab_pos_dim}}
349
	\bool_if:NT \l_kivi_col_id_bool {p{\l_kivi_tab_id_dim}}
350
	p{\l_kivi_tab_desc_dim}
351
	\bool_if:NT \l_kivi_col_amount_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_amount_dim}}}
352
	\bool_if:NT \l_kivi_col_price_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_price_dim}<{\__kivi_tab_column_currency:}}}
353
	\bool_if:NT \l_kivi_col_pricetotal_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_pricetotal_dim}<{\__kivi_tab_column_currency:}}}
354
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool {@{}}
347
\bool_if:NF \g__kivi_Tabular_rowcolor_bool {@{}}
348
\bool_if:NT \l_kivi_col_pos_bool {p{\l_kivi_tab_pos_dim}}
349
\bool_if:NT \l_kivi_col_id_bool {p{\l_kivi_tab_id_dim}}
350
p{\l_kivi_tab_desc_dim}
351
\bool_if:NT \l_kivi_col_amount_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_amount_dim}}}
352
\bool_if:NT \l_kivi_col_price_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_price_dim}<{\__kivi_tab_column_currency:}}}
353
\bool_if:NT \l_kivi_col_pricetotal_bool {\exp_not:n {>{\raggedleft\arraybackslash}p{\l_kivi_tab_pricetotal_dim}<{\__kivi_tab_column_currency:}}}
354
\bool_if:NF \g__kivi_Tabular_rowcolor_bool {@{}}
355 355
}
356 356

  
357 357
\cs_new_protected:Nn \__kivi_tab_column_currency: {\,\currency}
......
360 360
\cs_set_eq:NN \__kivi_tab_column_body_currency:  \__kivi_tab_column_currency:
361 361

  
362 362
\clist_map_inline:nn {head, foot, firsthead, lastfoot} {%TODO reduce
363
	\box_new:c {g_kivi_LT@#1_box}
363
  \box_new:c {g_kivi_LT@#1_box}
364 364
}
365 365

  
366 366
\newkomafont{PricingTableHeader}{\bfseries}
367 367

  
368 368
\cs_new:Nn \__kivi_setup_LT_boxes: {
369
%	\bool_show:N  \g__kivi_Tabular_rowcolor_bool
370
	\__kivi_calc_desc_column:
371
	\hbox_gset:Nn \g_kivi_LT@head_box {
372
		\setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
373
		\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_header_tl}}%
374
		{
375
		\exp_args:Nnx \use:n {\tabular[b]}\g_kivi_Pricing_colspec_tl
376
		\__kivi_PricingTabular_header:
377
		\endtabular
378
		}
379
	}
380
	\hbox_gset:Nn \g_kivi_LT@foot_box {
381
%		\parbox{\linewidth}{
382
%		\leavevmode\color{red}\rule{\linewidth}{1pt}\par\nointerlineskip
383
%		\leavevmode\color{blue}\rule{\linewidth}{1cm}
384
%		}
385
%		\raisebox{\depth}{
386
			\begin{tabular*}{\textwidth}[t]{@{\extracolsep{\fill}}r@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
387
				\bool_if:NTF \g__kivi_Tabular_rowcolor_bool
388
				{\hline\noalign{\vskip1pt}}%\noalign{\nointerlineskip\vskip\z@}\noalign{\nointerlineskip\rule{\linewidth}{\arrayrulewidth}}}%\leavevmode\rule{\linewidth}{\arrayrulewidth}}} 
389
				\midrule
390
				\strut\weiteraufnaechsterseite
391
			\end{tabular*}
392
%		}
393
	}
394
	\hbox_gset:Nn \g_kivi_LT@lastfoot_box {
395
		\raisebox{\dimexpr\depth+\baselineskip}[0pt][0pt]{
396
			\begin{tabular*}{\textwidth}{@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}\extracolsep{\fill}}r@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
397
			\bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
398
			\end{tabular*}
399
		}
400
	}
369
  %	\bool_show:N  \g__kivi_Tabular_rowcolor_bool
370
  \__kivi_calc_desc_column:
371
  \hbox_gset:Nn \g_kivi_LT@head_box {
372
    \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
373
    \bool_if:NT \g__kivi_Tabular_rowcolor_bool {\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_header_tl}}%
374
    {
375
      \exp_args:Nnx \use:n {\tabular[b]}\g_kivi_Pricing_colspec_tl
376
      \__kivi_PricingTabular_header:
377
      \endtabular
378
    }
379
  }
380
  \hbox_gset:Nn \g_kivi_LT@foot_box {
381
    %		\parbox{\linewidth}{
382
    %		\leavevmode\color{red}\rule{\linewidth}{1pt}\par\nointerlineskip
383
    %		\leavevmode\color{blue}\rule{\linewidth}{1cm}
384
    %		}
385
    %		\raisebox{\depth}{
386
    \begin{tabular*}{\textwidth}[t]{@{\extracolsep{\fill}}r@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
387
      \bool_if:NTF \g__kivi_Tabular_rowcolor_bool
388
      {\hline\noalign{\vskip1pt}}%\noalign{\nointerlineskip\vskip\z@}\noalign{\nointerlineskip\rule{\linewidth}{\arrayrulewidth}}}%\leavevmode\rule{\linewidth}{\arrayrulewidth}}} 
389
      \midrule
390
      \strut\weiteraufnaechsterseite
391
    \end{tabular*}
392
    %		}
393
  }
394
  \hbox_gset:Nn \g_kivi_LT@lastfoot_box {
395
    \raisebox{\dimexpr\depth+\baselineskip}[0pt][0pt]{
396
      \begin{tabular*}{\textwidth}{@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}\extracolsep{\fill}}r@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
397
        \bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
398
      \end{tabular*}
399
    }
400
  }
401 401
}
402 402

  
403 403

  
404 404
%Macht es sinn hier eine Variante zu machen, in der alle Spalten Belegbar sind?
405 405
\NewDocumentEnvironment{PricingTotal}{+b}{
406
	\par\nointerlineskip
406
\par\nointerlineskip
407 407
%	\unskip
408 408
}{
409
	\bool_if:NT \g__kivi_Tabular_rowcolor_bool 	{\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_PricingTotal_tl}}
410
	{	
411
	\tabular[t]{@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}
412
	p{\dim_eval:n {\linewidth-\l_kivi_tab_pricetotal_dim-\bool_if:NTF \g__kivi_Tabular_rowcolor_bool {4}{2}\tabcolsep}}P{\l_kivi_tab_pricetotal_dim}@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
413
	\l__kivi_Tabular_PricingTotal_topsep_tl
414
	#1
415
	\endtabular
416
	}
409
\bool_if:NT \g__kivi_Tabular_rowcolor_bool 	{\nointerlineskip\kivi@tabcolorbox{\g__kivi_Tabular_rowcolor_PricingTotal_tl}}
410
{
411
\tabular[t]{@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}
412
p{\dim_eval:n {\linewidth-\l_kivi_tab_pricetotal_dim-\bool_if:NTF \g__kivi_Tabular_rowcolor_bool {4}{2}\tabcolsep}}P{\l_kivi_tab_pricetotal_dim}@{\bool_if:NT \g__kivi_Tabular_rowcolor_bool {\hskip\tabcolsep}}}
413
\l__kivi_Tabular_PricingTotal_topsep_tl
414
#1
415
\endtabular
416
}
417 417
}
418 418

  
419 419
\tl_new:N \l__kivi_Tabular_PricingTotal_topsep_tl
......
421 421
\tl_set:Nn \l__kivi_Tabular_PricingTotal_topsep_tl {\bool_if:NF \g__kivi_Tabular_rowcolor_bool \midrule}
422 422

  
423 423
\newcommand*\ExtraDescription{
424
	\PackageError{kiviletter}{The~command~\string\ExtraDescription\space~may~be~only~used~inside~the~\string\FakeTable\space~environment.}{See~documentation~for~details}
424
  \PackageError{kiviletter}{The~command~\string\ExtraDescription\space~may~be~only~used~inside~the~\string\FakeTable\space~environment.}{See~documentation~for~details}
425 425
}
426 426

  
427 427

  
428 428
\cs_new:Nn \__kivi_addExtraDescription:n {\seq_gput_right:Nn \g_kivi_extraDescription_seq {#1}}
429 429

  
430 430
\newenvironment{PricingTabular}[1][]{
431
	\begingroup
432
	\dim_set:Nn \parskip {\c_zero_dim}
433
	\tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
434
	\setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
435
	\__kivi_calc_desc_column:
436
	\exp_args:Nx \longtable \g_kivi_Pricing_colspec_tl
437
	% Tabellenkopf
438
	\__kivi_PricingTabular_header:
439
	\endhead
440
	\midrule
441
	\rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
442
	\endfoot
443
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
444
	\endlastfoot
431
  \begingroup
432
  \dim_set:Nn \parskip {\c_zero_dim}
433
  \tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
434
  \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
435
  \__kivi_calc_desc_column:
436
  \exp_args:Nx \longtable \g_kivi_Pricing_colspec_tl
437
  % Tabellenkopf
438
  \__kivi_PricingTabular_header:
439
  \endhead
440
  \midrule
441
  \rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
442
  \endfoot
443
  \bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
444
  \endlastfoot
445 445
}{
446
	\endlongtable
447
	\endgroup
446
  \endlongtable
447
  \endgroup
448 448
}
449 449

  
450 450
\cs_set:Nn \__kivi_PricingTabular_header: {
451
	\bool_if:NTF \g__kivi_Tabular_rowcolor_bool {\noalign{\skip_vertical:n {\dp\strutbox}}}\toprule
452
	\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
453
	\bool_set_false:N \l_tmpa_bool
454
	\clist_map_inline:Nn \g_kivi_pricingtable_col_clist	{
455
		\bool_if:cT {l_kivi_col_##1_bool} {
456
			\bool_if:NT \l_tmpa_bool {&}
457
			\bool_set_true:N \l_tmpa_bool
458
			\usekomafont{PricingTableHeader}
459
			\prop_item:cn {l_kivi_col_##1_prop} {header}
460
		}
461
	}
462
	\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:
463
	\\
464
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool \midrule
451
  \bool_if:NTF \g__kivi_Tabular_rowcolor_bool {\noalign{\skip_vertical:n {\dp\strutbox}}}\toprule
452
  \cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
453
  \bool_set_false:N \l_tmpa_bool
454
  \clist_map_inline:Nn \g_kivi_pricingtable_col_clist	{
455
    \bool_if:cT {l_kivi_col_##1_bool} {
456
      \bool_if:NT \l_tmpa_bool {&}
457
      \bool_set_true:N \l_tmpa_bool
458
      \usekomafont{PricingTableHeader}
459
      \prop_item:cn {l_kivi_col_##1_prop} {header}
460
    }
461
  }
462
  \cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:
463
  \\
464
  \bool_if:NF \g__kivi_Tabular_rowcolor_bool \midrule
465 465
}
466 466

  
467 467
\newkomafont{tablehead}{\bfseries}
468 468

  
469 469
\keys_define:nn {kivi/SimpleTabular} {
470
	colspec .tl_set:N =\l_kivi_SimpleTabular_colspec_tl,
471
	colspec .initial:n = {rrX},
472
	headline .tl_set:N = \l_kivi_SimpleTabular_headline_tl,
473
	headline .initial:n = {\usekomafont{tablehead}\position & \usekomafont{tablehead}\menge & \usekomafont{tablehead}\bezeichnung},
470
  colspec .tl_set:N =\l_kivi_SimpleTabular_colspec_tl,
471
  colspec .initial:n = {rrX},
472
  headline .tl_set:N = \l_kivi_SimpleTabular_headline_tl,
473
  headline .initial:n = {\usekomafont{tablehead}\position & \usekomafont{tablehead}\menge & \usekomafont{tablehead}\bezeichnung},
474 474
}
475 475

  
476 476
\keys_define:nn {kivi/Tabular} {
477
	color-rows .bool_gset:N =  \g__kivi_Tabular_rowcolor_bool ,
478
	color-rows .initial:n = false,
479
	color-rows .default:n = true,
480
	rowcolor-odd .tl_gset:N = \g__kivi_Tabular_rowcolor_odd_tl,
481
	rowcolor-odd .initial:n = black!10,
482
	rowcolor-even .tl_gset:N = \g__kivi_Tabular_rowcolor_even_tl,
483
	rowcolor-even .initial:n =,
484
	rowcolor-header .tl_gset:N = \g__kivi_Tabular_rowcolor_header_tl,
485
	rowcolor-header .initial:n = black!35,
486
	rowcolor-total .tl_gset:N = \g__kivi_Tabular_rowcolor_PricingTotal_tl,
487
	rowcolor-total .initial:n = black!35,
488
	rowsep .tl_set:N =\g__kivi_Tabular_rowsep_tl,
489
	hrule .meta:n = {rowsep=\midrule}
477
  color-rows .bool_gset:N =  \g__kivi_Tabular_rowcolor_bool ,
478
  color-rows .initial:n = false,
479
  color-rows .default:n = true,
480
  rowcolor-odd .tl_gset:N = \g__kivi_Tabular_rowcolor_odd_tl,
481
  rowcolor-odd .initial:n = black!10,
482
  rowcolor-even .tl_gset:N = \g__kivi_Tabular_rowcolor_even_tl,
483
  rowcolor-even .initial:n =,
484
  rowcolor-header .tl_gset:N = \g__kivi_Tabular_rowcolor_header_tl,
485
  rowcolor-header .initial:n = black!35,
486
  rowcolor-total .tl_gset:N = \g__kivi_Tabular_rowcolor_PricingTotal_tl,
487
  rowcolor-total .initial:n = black!35,
488
  rowsep .tl_set:N =\g__kivi_Tabular_rowsep_tl,
489
  hrule .meta:n = {rowsep=\midrule}
490 490
}
491 491

  
492 492
\newcommand*{\SetupSimpleTabular}[1]{\keys_set:nn {kivi/SimpleTabular} {#1}}
......
494 494

  
495 495
\newenvironment{SimpleTabular}[1][]
496 496
{
497
	\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}}}
498
	\setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
499
	\dim_set:Nn \parskip {\c_zero_dim}
500
	\bool_if:NF	\g__kivi_Tabular_rowcolor_bool {
501
		\tl_put_right:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
502
		\tl_put_left:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
503
	}
504
	\exp_args:NnV \xltabular{\linewidth}\l_kivi_SimpleTabular_colspec_tl
505
		\toprule
506
		\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
507
		\l_kivi_SimpleTabular_headline_tl
508
		\\
509
		\noalign{\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:}
510
		\midrule
511
	\endhead
512
		\midrule
513
		\rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
514
	\endfoot
515
	\bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
516
	\endlastfoot
517
	\ignorespaces
497
  \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}}}
498
  \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
499
  \dim_set:Nn \parskip {\c_zero_dim}
500
  \bool_if:NF	\g__kivi_Tabular_rowcolor_bool {
501
    \tl_put_right:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
502
    \tl_put_left:Nn \l_kivi_SimpleTabular_colspec_tl {@{}}
503
  }
504
  \exp_args:NnV \xltabular{\linewidth}\l_kivi_SimpleTabular_colspec_tl
505
  \toprule
506
  \cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_header_currency:
507
  \l_kivi_SimpleTabular_headline_tl
508
  \\
509
  \noalign{\cs_gset_eq:NN \__kivi_tab_column_currency: \__kivi_tab_column_body_currency:}
510
  \midrule
511
  \endhead
512
  \midrule
513
  \rlap{\makebox[\textwidth][r]{\weiteraufnaechsterseite}}\\
514
  \endfoot
515
  \bool_if:NF \g__kivi_Tabular_rowcolor_bool \bottomrule
516
  \endlastfoot
517
  \ignorespaces
518 518
}{
519
	\def\@currenvir{tabularx}
520
	\endxltabular
519
  \def\@currenvir{tabularx}
520
  \endxltabular
521 521
}
522 522

  
523 523
%PricingTabular* kann automatisch spalten ignorieren
......
526 526
% analog ist dies für pos, amount, price, pricetotal möglich.
527 527
% Die Spalte der Bezeichnung ist nicht deaktivierbar
528 528
\newenvironment{PricingTabular*}[1][]{
529
	\int_gzero:N \g__kivi_PricingTable_rowcolor_int
530
	\tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
531
	\__kivi_setup_LT_boxes:
532
	\__kivi_setup_FakeTable:
533
	\dim_set:Nn \parskip {\c_zero_dim}
534
	\PricingTabularBox\ignorespaces
529
  \int_gzero:N \g__kivi_PricingTable_rowcolor_int
530
  \tl_if_empty:nF {#1} {\keys_set:nn {kivi/PricingTable} {#1}}
531
  \__kivi_setup_LT_boxes:
532
  \__kivi_setup_FakeTable:
533
  \dim_set:Nn \parskip {\c_zero_dim}
534
  \PricingTabularBox\ignorespaces
535 535
}{\endPricingTabularBox
536
	%compensate footer spacing
537
	\skip_vertical:n {-\box_ht:N  \g_kivi_LT@foot_box-\box_dp:N  \g_kivi_LT@foot_box}
536
  %compensate footer spacing
537
  \skip_vertical:n {-\box_ht:N  \g_kivi_LT@foot_box-\box_dp:N  \g_kivi_LT@foot_box}
538 538
}
539 539

  
540 540
\newtcolorbox{PricingTabularBox}{breakable,skin=kivi@LT}
541 541

  
542 542
\if@kivi@infobox
543 543

  
544
	\def\locationsep{:}
545

  
546
	\NewDocumentCommand{\locationentry}{som}{
547
		\Ifkomavarempty{#3}{}{
548
		\IfBooleanTF {#1} {
549
			\strut
550
			\IfNoValueTF {#2}
551
				{\usekomavar*{#3}}
552
				{#2}
553
			\locationsep
554
			\hfill\strut\space
555
			\hbox_set:Nn \l_tmpa_box {\usekomavar{#3}}
556
			\dim_compare:nTF {\box_wd:N \l_tmpa_box>\linewidth}
557
				{\newline\hspace*{\fill}\llap}
558
				{\hspace*{\fill}}
559
				{\box_use:N \l_tmpa_box\strut}
560
		}{
561
			\@hangfrom{\strut
562
				\IfNoValueTF {#2}
563
					{\usekomavar*{#3}}
564
					{#2}\locationsep~
565
			}{
566
				\parbox[t]{\dimexpr\linewidth-\hangindent}{
567
					\raggedleft
568
					\usekomavar{#3}\strut
569
				}
570
			}
571
		}
572
		}
573
		\par
574
	}
575

  
576
\newkomafont{transaction}{\bfseries}
577

  
578
\setkomavar{location}{
579
	\Ifkomavarempty{transaction}{}{{
580
	\usekomafont{transaction}
581
	\usekomavar{transaction}
582
	}
583
	}
584
	\par
585
	\medskip
586
	\parbox{\useplength{locwidth}}{
587
		\locationentry{date}
588
		\locationentry{myref}
589
		\locationentry{customer}
590
		\locationentry{yourref}
591
		\locationentry{delivery}
592
		\locationentry{quote}
593
		\locationentry{orderID}
594
		\locationentry{projectID}
595
		\locationentry[\ansprechpartner]{fromname}
596
		\locationentry{fromphone}
597
		\locationentry*{fromemail}
598
	}
599
}
600
\removereffields
601
\AtBeginLetter{
602
	\ifdim\ht\shippingAddressBox>\z@
603
	\@addtoplength{refvpos}{\dimexpr\ht\shippingAddressBox+\dp\shippingAddressBox}
604
	\@addtoplength{refvpos}{4\baselineskip}%sep between address boxes
605
	\fi
606
}
544
  \def\locationsep{:}
545

  
546
  \NewDocumentCommand{\locationentry}{som}{
547
    \Ifkomavarempty{#3}{}{
548
      \IfBooleanTF {#1} {
549
        \strut
550
        \IfNoValueTF {#2}
551
        {\usekomavar*{#3}}
552
        {#2}
553
        \locationsep
554
        \hfill\strut\space
555
        \hbox_set:Nn \l_tmpa_box {\usekomavar{#3}}
556
        \dim_compare:nTF {\box_wd:N \l_tmpa_box>\linewidth}
557
        {\newline\hspace*{\fill}\llap}
558
        {\hspace*{\fill}}
559
        {\box_use:N \l_tmpa_box\strut}
560
      }{
561
        \@hangfrom{\strut
562
          \IfNoValueTF {#2}
563
          {\usekomavar*{#3}}
564
          {#2}\locationsep~
565
        }{
566
          \parbox[t]{\dimexpr\linewidth-\hangindent}{
567
            \raggedleft
568
            \usekomavar{#3}\strut
569
          }
570
        }
571
      }
572
    }
573
    \par
574
  }
575

  
576
  \newkomafont{transaction}{\bfseries}
577

  
578
  \setkomavar{location}{
579
    \Ifkomavarempty{transaction}{}{{
580
          \usekomafont{transaction}
581
          \usekomavar{transaction}
582
        }
583
    }
584
    \par
585
    \medskip
586
    \parbox{\useplength{locwidth}}{
587
      \locationentry{date}
588
      \locationentry{myref}
589
      \locationentry{customer}
590
      \locationentry{yourref}
591
      \locationentry{delivery}
592
      \locationentry{quote}
593
      \locationentry{orderID}
594
      \locationentry{projectID}
595
      \locationentry[\ansprechpartner]{fromname}
596
      \locationentry{fromphone}
597
      \locationentry*{fromemail}
598
    }
599
  }
600
  \removereffields
601
  \AtBeginLetter{
602
    \ifdim\ht\shippingAddressBox>\z@
603
      \@addtoplength{refvpos}{\dimexpr\ht\shippingAddressBox+\dp\shippingAddressBox}
604
      \@addtoplength{refvpos}{4\baselineskip}%sep between address boxes
605
    \fi
606
  }
607 607

  
608 608
\fi
609 609

  
......
614 614
%Definitionen für die insettings.tex
615 615

  
616 616
\newcommand*{\setupIdentpath}[1]{
617
	\int_set:Nn \l_kivi_tmp_int {1}
618
	\bool_set_true:N \l_kivi_tmp_bool
619
	\bool_while_do:Nn \l_kivi_tmp_bool {
620
		\file_if_exist:nTF {firma\int_use:N \l_kivi_tmp_int/ident.tex}
621
		{
622
			\exp_args:Nf \str_if_in:nnTF {#1} {Firma\int_use:N \l_kivi_tmp_int}
623
			{
624
				\newcommand*{\identpath}{firma\int_use:N \l_kivi_tmpa_int}
625
				\bool_set_false:N \l_kivi_tmp_bool
626
			}
627
			{\int_incr:N \l_kivi_tmp_int}
628
		}
629
		{
630
			\bool_set_false:N \l_kivi_tmp_bool
631
			\newcommand*{\identpath}{firma}
632
		}
633
	}
617
  \int_set:Nn \l_kivi_tmp_int {1}
618
  \bool_set_true:N \l_kivi_tmp_bool
619
  \bool_while_do:Nn \l_kivi_tmp_bool {
620
    \file_if_exist:nTF {firma\int_use:N \l_kivi_tmp_int/ident.tex}
621
    {
622
      \exp_args:Nf \str_if_in:nnTF {#1} {Firma\int_use:N \l_kivi_tmp_int}
623
      {
624
        \newcommand*{\identpath}{firma\int_use:N \l_kivi_tmpa_int}
625
        \bool_set_false:N \l_kivi_tmp_bool
626
      }
627
      {\int_incr:N \l_kivi_tmp_int}
628
    }
629
    {
630
      \bool_set_false:N \l_kivi_tmp_bool
631
      \newcommand*{\identpath}{firma}
632
    }
633
  }
634 634
}
635 635

  
636 636
\newcommand*{\setupCurrencyConfig}[2]{
637
	\tl_new:N \g_kivi_currency_tl
638
	\exp_args:Nf \str_if_in:nnT {#2} {USD} {\tl_gset:Nn \g_kivi_currency_tl {usd}}
639
	\exp_args:Nf \str_if_in:nnT {#2} {CHF} {\tl_gset:Nn \g_kivi_currency_tl {chf}}
640
	\exp_args:Nf \str_if_in:nnT {#2} {EUR} {\tl_gset:Nn \g_kivi_currency_tl {euro}}
641
	\tl_if_empty:NT  \g_kivi_currency_tl {
642
		\tl_gset:Nn \g_kivi_currency_tl {default}
643
		\edef \currency {\tl_to_str:N \lxcurrency}
644
	}
645
	\input{#1/\g_kivi_currency_tl _account.tex}
637
  \tl_new:N \g_kivi_currency_tl
638
  \exp_args:Nf \str_if_in:nnT {#2} {USD} {\tl_gset:Nn \g_kivi_currency_tl {usd}}
639
  \exp_args:Nf \str_if_in:nnT {#2} {CHF} {\tl_gset:Nn \g_kivi_currency_tl {chf}}
640
  \exp_args:Nf \str_if_in:nnT {#2} {EUR} {\tl_gset:Nn \g_kivi_currency_tl {euro}}
641
  \tl_if_empty:NT  \g_kivi_currency_tl {
642
    \tl_gset:Nn \g_kivi_currency_tl {default}
643
    \edef \currency {\tl_to_str:N \lxcurrency}
644
  }
645
  \input{#1/\g_kivi_currency_tl _account.tex}
646 646
}
647 647

  
648 648
\ExplSyntaxOff

Auch abrufbar als: Unified diff