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

View File

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

View File

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

View File

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