Document: Remove break-before: avoid for tr.sum
This commit is contained in:
@ -41,7 +41,7 @@
|
|||||||
<th class="unit">[@Model.CurrencySymbol]</th>
|
<th class="unit">[@Model.CurrencySymbol]</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody class="sum">
|
||||||
@foreach (var p in Model.Data.Rows) {
|
@foreach (var p in Model.Data.Rows) {
|
||||||
var rows = Math.Max(p.Buckets.Length, p.Modifiers.Length + 1);
|
var rows = Math.Max(p.Buckets.Length, p.Modifiers.Length + 1);
|
||||||
@for (int i = 0; i < rows; i++) {
|
@for (int i = 0; i < rows; i++) {
|
||||||
@ -79,35 +79,32 @@
|
|||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
@{
|
@{
|
||||||
string FormatRow(string name, decimal? value, bool add = false, bool halfLine = true, bool bold = false, bool subCat = false) {
|
string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false) {
|
||||||
return $"<tr class=\"{(halfLine || add ? "" : "sum")} {(bold ? "large bold" : "")}\">"
|
return $"<tr class=\"{(bold ? "large bold" : "")}\">"
|
||||||
+ $"<td colspan=\"4\"></td>"
|
+ $"<td colspan=\"4\"></td>"
|
||||||
+ $"<td class=\"{(halfLine && !add ? "sum" : "")} {(subCat ? "small" : "")}\" colspan=\"4\" style=\"overflow: visible;\">{name}:</td>"
|
+ $"<td class=\"{(!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 class=\"number {(subCat ? "small" : "large")} {(!add ? "sum" : "")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>"
|
||||||
+ $"<td colspan=\"2\" class=\"number {(subCat ? "small" : "large")} {(halfLine && !add ? "sum" : "")}\">"
|
+ $"<td colspan=\"2\" class=\"number {(subCat ? "small" : "large")} {(!add ? "sum" : "")}\">"
|
||||||
+ $"<span class=\"fleft\">{Model.CurrencySymbol}</span>{Math.Abs(value ?? 0):N2}</td>"
|
+ $"<span class=\"fleft\">{Model.CurrencySymbol}</span>{Math.Abs(value ?? 0):N2}</td>"
|
||||||
+ $"</tr>\n";
|
+ $"</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); }
|
@{ var sum = Model.Data.Rows.Sum(p => p.Amount); }
|
||||||
@if (Model.Payment == null) {
|
@if (Model.Payment == null) {
|
||||||
@Raw(FormatRow("Gesamt", sum, halfLine: false, bold: true))
|
@Raw(FormatRow("Gesamt", sum, bold: true))
|
||||||
} else {
|
} else {
|
||||||
var totalLine = false;
|
|
||||||
if (Model.Payment.NetAmount != Model.Payment.Amount) {
|
if (Model.Payment.NetAmount != Model.Payment.Amount) {
|
||||||
@Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount, halfLine: totalLine))
|
@Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount))
|
||||||
totalLine = true;
|
@Raw(FormatRow(Model.MemberModifier, Model.Payment.Amount - Model.Payment.NetAmount, add: true))
|
||||||
@Raw(FormatRow(Model.MemberModifier, Model.Payment.Amount - Model.Payment.NetAmount, add: true, halfLine: totalLine))
|
|
||||||
}
|
}
|
||||||
if (Model.Credit == null) {
|
if (Model.Credit == null) {
|
||||||
@Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true, halfLine: totalLine))
|
@Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true))
|
||||||
totalLine = true;
|
|
||||||
// TODO Mock VAT
|
// TODO Mock VAT
|
||||||
} else {
|
} else {
|
||||||
var hasPrev = Model.Credit.PrevNetAmount != null;
|
var hasPrev = Model.Credit.PrevNetAmount != null;
|
||||||
@Raw(FormatRow(hasPrev ? "Gesamtbetrag" : "Nettobetrag", Model.Credit.NetAmount, bold: true, halfLine: totalLine))
|
@Raw(FormatRow(hasPrev ? "Gesamtbetrag" : "Nettobetrag", Model.Credit.NetAmount, bold: true))
|
||||||
totalLine = true;
|
|
||||||
if (hasPrev) {
|
if (hasPrev) {
|
||||||
@Raw(FormatRow("Bisher berücksichtigt", -Model.Credit.PrevNetAmount, add: true))
|
@Raw(FormatRow("Bisher berücksichtigt", -Model.Credit.PrevNetAmount, add: true))
|
||||||
@Raw(FormatRow("Nettobetrag", Model.Credit.NetAmount - (Model.Credit.PrevNetAmount ?? 0)))
|
@Raw(FormatRow("Nettobetrag", Model.Credit.NetAmount - (Model.Credit.PrevNetAmount ?? 0)))
|
||||||
|
@ -19,7 +19,8 @@ table.credit tr.last td {
|
|||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.credit .sum {
|
table.credit tr.sum,
|
||||||
|
table.credit tr .sum {
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,11 +128,6 @@ main table tr.border {
|
|||||||
border-top: 0.5pt solid black;
|
border-top: 0.5pt solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
main table tr.sum,
|
|
||||||
main table td.sum {
|
|
||||||
break-before: avoid;
|
|
||||||
}
|
|
||||||
|
|
||||||
main table th.unit {
|
main table th.unit {
|
||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
}
|
}
|
||||||
@ -152,3 +147,7 @@ main table .rborder {border-right: 0.5pt solid black;}
|
|||||||
main table .fleft {
|
main table .fleft {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main tbody.sum tr:last-child {
|
||||||
|
border-bottom: 0.5pt solid black;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user