From f15733f82714d1a38f0001e0f7b6d41091ccdf3b Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner <lorenz.stechauner@necronda.net> Date: Sun, 7 Jan 2024 23:37:15 +0100 Subject: [PATCH] CreditNote: Fix styling --- Elwig/Documents/CreditNote.cshtml | 8 +++++--- Elwig/Documents/CreditNote.css | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Elwig/Documents/CreditNote.cshtml b/Elwig/Documents/CreditNote.cshtml index 1a89c02..6d3339a 100644 --- a/Elwig/Documents/CreditNote.cshtml +++ b/Elwig/Documents/CreditNote.cshtml @@ -88,7 +88,7 @@ <table class="credit-sum"> @{ string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false, bool noTopBorder = false) { - return $"<tr class=\"{(!add && !noTopBorder ? "sum" : "")} {(bold ? "large bold" : "")}\">" + return $"<tr class=\"{(!add && !noTopBorder ? "sum" : !add ? "large" : "")} {(bold ? "large bold" : "")}\">" + $"<td class=\"{(subCat ? "small" : "")}\" style=\"overflow: visible;\">{name}:</td>" + $"<td class=\"number {(subCat ? "small" : "large")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>" + $"<td class=\"number {(subCat ? "small" : "large")}\">" @@ -101,12 +101,14 @@ @if (Model.Payment == null) { @Raw(FormatRow("Gesamt", sum, bold: true, noTopBorder: true)) } else { + var noBorder = true; if (Model.Payment.NetAmount != Model.Payment.Amount) { - @Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount, noTopBorder: true)) + @Raw(FormatRow("Zwischensumme", Model.Payment.NetAmount, noTopBorder: noBorder)) + noBorder = false; @Raw(FormatRow(Model.MemberModifier, Model.Payment.Amount - Model.Payment.NetAmount, add: true)) } if (Model.Credit == null) { - @Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true)) + @Raw(FormatRow("Gesamtbetrag", Model.Payment.Amount, bold: true, noTopBorder: noBorder)) // TODO Mock VAT } else { var hasPrev = Model.Credit.PrevNetAmount != null; diff --git a/Elwig/Documents/CreditNote.css b/Elwig/Documents/CreditNote.css index 6ab6fff..3a2ddbf 100644 --- a/Elwig/Documents/CreditNote.css +++ b/Elwig/Documents/CreditNote.css @@ -42,6 +42,7 @@ table.credit-sum td.sum { font-style: italic; font-size: 8pt; width: 74mm; - float: left; + position: absolute; + left: 0; margin: 2mm 4mm; }