CreditNote: Fix styling

This commit is contained in:
2024-01-07 23:37:15 +01:00
parent 05b6e8ddd6
commit f15733f827
2 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}