X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ce8e7e2c2ab6864d1d011d70a6d8f993b7881f45..b3afb08d1af1eee3fa141658b4948e47b3c905fe:/kiviletter.sty

diff --git a/kiviletter.sty b/kiviletter.sty
index bb2ab5646..5adf773ec 100644
--- a/kiviletter.sty
+++ b/kiviletter.sty
@@ -224,6 +224,43 @@ align=tl,
 	\endgroup
 }
 
+\usepackage{afterpage}
+
+\cs_new:cpn {PricingTabular*}{
+	\bool_gset_true:N \g_kivi_inTable_bool
+	\endgroup
+	\@nameuse{Gm@restore@@kivi.letter@table}%
+	\Gm@changelayout
+	\begingroup
+	\def \@currenvir {PricingTabular*}\edef \@currenvline {\on@line }
+	\addtolength{\vsize}{-\box_ht:N \g_kivi_LT@foot_box}
+	\pagegoal\vsize
+	\widowpenalty0
+	\clubpenalty0
+	\bool_gset_true:N \g_kivi_TableFoot_bool
+	\leavevmode\box_use:N \g_kivi_LT@head_box
+	\par\nointerlineskip\ignorespaces
+}
+
+\cs_new:cpn {endPricingTabular*} {
+	\thispagestyle{kivitendo.letter.PricingTable}
+	\bool_gset_false:N \g_kivi_TableFoot_bool
+	\@nameuse{Gm@restore@@kivi.letter@default}
+	\Gm@changelayout
+	\bool_gset_true:N \g_kivi_restore_geometry_bool
+	\afterpage{
+		\kivi_conditional_restore_geometry:
+	}
+}
+
+\cs_new:Nn \kivi_conditional_restore_geometry: {
+	\bool_if:NT \g_kivi_restore_geometry_bool
+	{
+	\@nameuse{Gm@restore@@kivi.letter@default}
+	\Gm@changelayout
+	}
+	\bool_gset_false:N \g_kivi_restore_geometry_bool
+}
 \ExplSyntaxOff
 
 \if@kivi@infobox
