diff --git a/Elwig/Documents/CreditNote.cshtml b/Elwig/Documents/CreditNote.cshtml index cbd101c..834eb10 100644 --- a/Elwig/Documents/CreditNote.cshtml +++ b/Elwig/Documents/CreditNote.cshtml @@ -41,7 +41,7 @@ [@Model.CurrencySymbol] - + @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 @@ } @{ - string FormatRow(string name, decimal? value, bool add = false, bool halfLine = true, bool bold = false, bool subCat = false) { - return $"" + string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false) { + return $"" + $"" - + $"{name}:" - + $"{(value < 0 ? "–" : (add ? "+" : ""))}" - + $"" + + $"{name}:" + + $"{(value < 0 ? "–" : (add ? "+" : ""))}" + + $"" + $"{Model.CurrencySymbol}{Math.Abs(value ?? 0):N2}" + $"\n"; } } - + + @{ 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))) diff --git a/Elwig/Documents/CreditNote.css b/Elwig/Documents/CreditNote.css index 525385f..5e9c328 100644 --- a/Elwig/Documents/CreditNote.css +++ b/Elwig/Documents/CreditNote.css @@ -19,7 +19,8 @@ table.credit tr.last td { padding-bottom: 0; } -table.credit .sum { +table.credit tr.sum, +table.credit tr .sum { font-size: 12pt; } diff --git a/Elwig/Documents/Document.Table.css b/Elwig/Documents/Document.Table.css index f49357b..488a2c1 100644 --- a/Elwig/Documents/Document.Table.css +++ b/Elwig/Documents/Document.Table.css @@ -128,11 +128,6 @@ main table tr.border { border-top: 0.5pt solid black; } -main table tr.sum, -main table td.sum { - break-before: avoid; -} - main table th.unit { font-size: 8pt; } @@ -152,3 +147,7 @@ main table .rborder {border-right: 0.5pt solid black;} main table .fleft { float: left; } + +main tbody.sum tr:last-child { + border-bottom: 0.5pt solid black; +}