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

@ -6,31 +6,31 @@
<div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div>
<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;"/>
</colgroup>
<thead>
<tr>
<colgroup>
<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>
<th class="main" rowspan="2" style="text-align: center;">Pos.</th>
<th class="main" rowspan="2">Sorte</th>
<th class="main" rowspan="2">Attribut(e)</th>
<th class="main" rowspan="2">Qualitätsstufe</th>
<th colspan="2">Gradation</th>
<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>
</tr>
</thead>
<tbody>
</tr>
<tr>
<th style="font-size: 8pt;">[°Oe]</th>
<th style="font-size: 8pt;">[°KMW]</th>
<th style="font-size: 8pt;">[kg]</th>
</tr>
</thead>
<tbody>
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
<tr class="main">
<td style="text-align: center;">@part.DPNr</td>
@ -52,18 +52,19 @@
<tr><td></td><td colspan="3" style="font-size: 8pt;">@(part.Temperature != null ? $"Temperatur: {part.Temperature:N1} °C" : "")@(part.Temperature != null && part.Acid != null ? ", " : "")@(part.Acid != null ? $"Säure: {part.Acid:N1} g/l" : "")</td></tr>
}
}
</tbody>
</tbody>
</table>
@if (Model.Delivery.Comment != null) {
<p class="comment">Amerkung zur Lieferung: @Model.Delivery.Comment</p>
}
<div class="bottom">
<!-- FIXME page breaking -->
@if (Model.Text != null) {
@for (int i = 0; i < 2; i++) {
<div class="@(i == 0 ? "bottom" : "hidden")">
@if (Model.Text != null) {
<p class="comment">@Model.Text</p>
}
}
<div class="signatures">
<div>Genossenschaft</div>
<div>Mitglied</div>
</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;