tcolorbox breakable
authorMarei Peischl <marei@peitex.de>
Thu, 21 Nov 2019 15:28:41 +0000 (16:28 +0100)
committerJan Büren <jan@kivitendo.de>
Mon, 3 Feb 2020 11:21:38 +0000 (12:21 +0100)
kiviletter.sty
sales_quotation.tex

index 0912e1b..4b02af5 100644 (file)
@@ -81,8 +81,10 @@ contents={\usebox\shippingAddressBox}
 \newcolumntype{P}{>{\raggedleft\arraybackslash}p{\g_kivi_tab_price_dim}}
 
 %\if@kivi@faketable
-\RequirePackage{environ}
+\RequirePackage{tcolorbox}
+\tcbuselibrary{breakable, skins}
 \seq_new:N \l_kivi_PricingTable_seq
+\seq_new:N \g_kivi_extraDescription_seq
 \newcommand{\FakeTable}[1]{
 %      \tl_set:No \l_tmpa_tl {\BODY}
        \endPricingTabular
@@ -90,15 +92,25 @@ contents={\usebox\shippingAddressBox}
        \begingroup
        \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
        \seq_map_inline:Nn \l_kivi_PricingTable_seq {
+       \seq_gclear:N \g_kivi_extraDescription_seq
        \tabular{@{}p{\g_kivi_tab_pos_dim}p{\g_kivi_tab_id_dim}p{\g_kivi_tab_desc_dim}>{\raggedleft\arraybackslash}p{\g_kivi_tab_num_dim}*2{P<{\,\currency}}@{}}
        ##1
-       \endtabular\par\nointerlineskip
+       \endtabular
+       \seq_if_empty:NTF \g_kivi_extraDescription_seq
+       {\par\nointerlineskip}
+       {\par\nointerlineskip
+               \begin{tcolorbox}[left skip=\dim_eval:n {\g_kivi_tab_pos_dim+ \g_kivi_tab_id_dim +4\tabcolsep},right skip=\dim_eval:n {\g_kivi_tab_num_dim+ 2\g_kivi_tab_price_dim +6\tabcolsep}, breakable, blank]
+               \seq_use:N \g_kivi_extraDescription_seq {\newline}
+               \end{tcolorbox}
+       }
        }
        \endgroup
        \PricingTabular
 }
+
+\newcommand*{\ExtraDescription}[1]{\seq_gput_right:Nn \g_kivi_extraDescription_seq {#1}}
 %\else
-\newenvironment{PricingTabular}{
+\newenvironment{PricingTabular}[1][]{
        \begingroup
        \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
        \CalcTabCols
index 070ccef..da097c4 100644 (file)
 <%runningnumber%> &%
 <%number%> &%
 \textbf{<%description%>}%
-       <%if longdescription%> \newline\scriptsize <%longdescription%><%end longdescription%>%
-       <%if serialnumber%> \newline\scriptsize \seriennummer: <%serialnumber%><%end serialnumber%>%
-       <%if ean%> \newline\scriptsize \ean: <%ean%><%end ean%>%
-       <%if projectnumber%>\newline\scriptsize \projektnummer: <%projectnumber%><%end projectnumber%>%
+       <%if longdescription%>\ExtraDescription{<%longdescription%>}<%end longdescription%>%
+       <%if serialnumber%>\ExtraDescription{\seriennummer: <%serialnumber%>}<%end serialnumber%>%
+       <%if ean%>\ExtraDescription{\ean: <%ean%>}<%end ean%>%
+       <%if projectnumber%>\ExtraDescription{\projektnummer: <%projectnumber%>}<%end projectnumber%>%
        &%
        <%qty%> <%unit%> &%
        <%sellprice%>&%