Document: Remove break-before: avoid for tr.sum
This commit is contained in:
		@@ -41,7 +41,7 @@
 | 
			
		||||
                <th class="unit">[@Model.CurrencySymbol]</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </thead>
 | 
			
		||||
        <tbody>
 | 
			
		||||
        <tbody class="sum">
 | 
			
		||||
            @foreach (var p in Model.Data.Rows) {
 | 
			
		||||
                var rows = Math.Max(p.Buckets.Length, p.Modifiers.Length + 1);
 | 
			
		||||
                @for (int i = 0; i < rows; i++) {
 | 
			
		||||
@@ -79,35 +79,32 @@
 | 
			
		||||
            }
 | 
			
		||||
        </tbody>
 | 
			
		||||
        @{
 | 
			
		||||
            string FormatRow(string name, decimal? value, bool add = false, bool halfLine = true, bool bold = false, bool subCat = false) {
 | 
			
		||||
                return $"<tr class=\"{(halfLine || add ? "" : "sum")} {(bold ? "large bold" : "")}\">"
 | 
			
		||||
            string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false) {
 | 
			
		||||
                return $"<tr class=\"{(bold ? "large bold" : "")}\">"
 | 
			
		||||
                     + $"<td colspan=\"4\"></td>"
 | 
			
		||||
                     + $"<td class=\"{(halfLine && !add ? "sum" : "")} {(subCat ? "small" : "")}\" colspan=\"4\" style=\"overflow: visible;\">{name}:</td>"
 | 
			
		||||
                     + $"<td class=\"number {(subCat ? "small" : "large")} {(halfLine && !add ? "sum" : "")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>"
 | 
			
		||||
                     + $"<td colspan=\"2\" class=\"number {(subCat ? "small" : "large")} {(halfLine && !add ? "sum" : "")}\">"
 | 
			
		||||
                     + $"<td class=\"{(!add ? "sum" : "")} {(subCat ? "small" : "")}\" colspan=\"4\" style=\"overflow: visible;\">{name}:</td>"
 | 
			
		||||
                     + $"<td class=\"number {(subCat ? "small" : "large")} {(!add ? "sum" : "")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>"
 | 
			
		||||
                     + $"<td colspan=\"2\" class=\"number {(subCat ? "small" : "large")} {(!add ? "sum" : "")}\">"
 | 
			
		||||
                     +   $"<span class=\"fleft\">{Model.CurrencySymbol}</span>{Math.Abs(value ?? 0):N2}</td>"
 | 
			
		||||
                     + $"</tr>\n";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        <tbody style="break-inside: avoid; break-before: avoid;">
 | 
			
		||||
        <thead><tr></tr></thead>
 | 
			
		||||
        <tbody style="break-inside: avoid;">
 | 
			
		||||
            @{ var sum = Model.Data.Rows.Sum(p => p.Amount); }
 | 
			
		||||
            @if (Model.Payment == null) {
 | 
			
		||||
                @Raw(FormatRow("Gesamt", sum, halfLine: false, bold: true))
 | 
			
		||||
                @Raw(FormatRow("Gesamt", sum, bold: true))
 | 
			
		||||
            } else {
 | 
			
		||||
                var totalLine = false;
 | 
			
		||||
                if (Model.Payment.NetAmount != Model.Payment.Amount) {
 | 
			
		||||
                    @Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount, halfLine: totalLine))
 | 
			
		||||
                    totalLine = true;
 | 
			
		||||
                    @Raw(FormatRow(Model.MemberModifier, Model.Payment.Amount - Model.Payment.NetAmount, add: true, halfLine: totalLine))
 | 
			
		||||
                    @Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount))
 | 
			
		||||
                    @Raw(FormatRow(Model.MemberModifier, Model.Payment.Amount - Model.Payment.NetAmount, add: true))
 | 
			
		||||
                }
 | 
			
		||||
                if (Model.Credit == null) {
 | 
			
		||||
                    @Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true, halfLine: totalLine))
 | 
			
		||||
                    totalLine = true;
 | 
			
		||||
                    @Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true))
 | 
			
		||||
                    // TODO Mock VAT
 | 
			
		||||
                } else {
 | 
			
		||||
                    var hasPrev = Model.Credit.PrevNetAmount != null;
 | 
			
		||||
                    @Raw(FormatRow(hasPrev ? "Gesamtbetrag" : "Nettobetrag", Model.Credit.NetAmount, bold: true, halfLine: totalLine))
 | 
			
		||||
                    totalLine = true;
 | 
			
		||||
                    @Raw(FormatRow(hasPrev ? "Gesamtbetrag" : "Nettobetrag", Model.Credit.NetAmount, bold: true))
 | 
			
		||||
                    if (hasPrev) {
 | 
			
		||||
                        @Raw(FormatRow("Bisher berücksichtigt", -Model.Credit.PrevNetAmount, add: true))
 | 
			
		||||
                        @Raw(FormatRow("Nettobetrag", Model.Credit.NetAmount - (Model.Credit.PrevNetAmount ?? 0)))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user