Add optional Document Id to Documents

This commit is contained in:
2023-08-12 20:21:52 +02:00
parent cbb57f7039
commit 65bcc7bbb1
4 changed files with 57 additions and 53 deletions

View File

@ -7,13 +7,13 @@
<h1>@Model.Title</h1>
<table class="delivery">
<colgroup>
<col span="1" style="width: 1cm;"/>
<col span="1" style="width: 50%;"/>
<col span="1" style="width: 50%;"/>
<col span="1" style="width: 3cm;"/>
<col span="1" style="width: 1.25cm;"/>
<col span="1" style="width: 1.25cm;"/>
<col span="1" style="width: 1.5cm;"/>
<col style="width: 1cm;"/>
<col style="width: 50%;"/>
<col style="width: 50%;"/>
<col style="width: 3cm;"/>
<col style="width: 1.25cm;"/>
<col style="width: 1.25cm;"/>
<col style="width: 1.5cm;"/>
</colgroup>
<thead>
<tr>
@ -25,9 +25,9 @@
<th>Gewicht</th>
</tr>
<tr>
<th style="font-size: 8pt">[°Oe]</th>
<th style="font-size: 8pt">[°KMW]</th>
<th style="font-size: 8pt">[kg]</th>
<th style="font-size: 8pt;">[°Oe]</th>
<th style="font-size: 8pt;">[°KMW]</th>
<th style="font-size: 8pt;">[kg]</th>
</tr>
</thead>
<tbody>
@ -57,8 +57,8 @@
@if (Model.Delivery.Comment != null) {
<p class="comment">Amerkung zur Lieferung: @Model.Delivery.Comment</p>
}
<div class="bottom">
<!-- FIXME page breaking -->
@for (int i = 0; i < 2; i++) {
<div class="@(i == 0 ? "bottom" : "hidden")">
@if (Model.Text != null) {
<p class="comment">@Model.Text</p>
}
@ -67,3 +67,4 @@
<div>Mitglied</div>
</div>
</div>
}

View File

@ -15,6 +15,7 @@ namespace Elwig.Documents {
$"<tr><th>Zweigstelle</th><td>{d.Branch.Name}</td></tr>" +
$"</tbody></table>";
Text = App.Client.DeliveryNoteText;
DocumentId = d.LsNr;
}
}
}

View File

@ -21,14 +21,15 @@
<div class="m1"></div>
<div class="m2"></div>
<div class="m3"></div>
<header>@Raw(Model.Header)</header>
<div class="footer-wrapper">
<div class="pre-footer">
<span class="date">@($"{Model.Date:dddd, d. MMMM yyyy}")</span>
<span class="doc-id">@Model.DocumentId</span>
<span class="page"></span>
</div>
<footer>@Raw(Model.Footer)</footer>
</div>
<header>@Raw(Model.Header)</header>
<div class="spacing"></div>
<div class="main-wrapper">
@RenderBody()

View File

@ -36,6 +36,7 @@ namespace Elwig.Documents {
public string Header { get; set; }
public string Footer { get; set; }
public DateTime Date { get; set; }
public string? DocumentId { get; set; }
private async Task<string> Render() {
string name;