From 65bcc7bbb138c27520243715f3642b6da474495b Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 12 Aug 2023 20:21:52 +0200 Subject: [PATCH] Add optional Document Id to Documents --- Elwig/Documents/DeliveryNote.cshtml | 105 +++++++++++++------------ Elwig/Documents/DeliveryNote.cshtml.cs | 1 + Elwig/Documents/Document.cshtml | 3 +- Elwig/Documents/Document.cshtml.cs | 1 + 4 files changed, 57 insertions(+), 53 deletions(-) diff --git a/Elwig/Documents/DeliveryNote.cshtml b/Elwig/Documents/DeliveryNote.cshtml index 59cd4df..9f16223 100644 --- a/Elwig/Documents/DeliveryNote.cshtml +++ b/Elwig/Documents/DeliveryNote.cshtml @@ -6,64 +6,65 @@
@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")

@Model.Title

-- - - - - - - - - - - - - - - - - - - - - - - - - @foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) { - - - - - - - - + + + + + + + + + + + + + + + + + - - - @if (part.Comment != null) { - - } - @if (part.Temperature != null || part.Acid != null) { + + + + + + + + @foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) { + + + + + + + + + + + + @if (part.Comment != null) { + + } + @if (part.Temperature != null || part.Acid != null) { } } - +
Pos.SorteAttribut(e)QualitätsstufeGradationGewicht
[°Oe][°KMW][kg]
@part.DPNr@part.Variant.Name@string.Join(" / ", part.Attributes)@part.Quality.Name@($"{part.Oe:N0}")@($"{part.Kmw:N1}")@($"{part.Weight:N0}")
Pos.SorteAttribut(e)QualitätsstufeGradationGewicht
Herkunft: @part.OriginString
- @(part.ManualWeighing ? "Handwiegung" : $"Waage: {part.ScaleId ?? "?"}, ID: {part.WeighingId ?? "?"}") (@(part.IsGerebelt ? "gerebelt gewogen" : "nicht gerebelt gewogen")) -
Anmerkung: @part.Comment
[°Oe][°KMW][kg]
@part.DPNr@part.Variant.Name@string.Join(" / ", part.Attributes)@part.Quality.Name@($"{part.Oe:N0}")@($"{part.Kmw:N1}")@($"{part.Weight:N0}")
Herkunft: @part.OriginString
+ @(part.ManualWeighing ? "Handwiegung" : $"Waage: {part.ScaleId ?? "?"}, ID: {part.WeighingId ?? "?"}") (@(part.IsGerebelt ? "gerebelt gewogen" : "nicht gerebelt gewogen")) +
Anmerkung: @part.Comment
@(part.Temperature != null ? $"Temperatur: {part.Temperature:N1} °C" : "")@(part.Temperature != null && part.Acid != null ? ", " : "")@(part.Acid != null ? $"Säure: {part.Acid:N1} g/l" : "")
@if (Model.Delivery.Comment != null) {

Amerkung zur Lieferung: @Model.Delivery.Comment

} -
- -@if (Model.Text != null) { -

@Model.Text

-} -
-
Genossenschaft
-
Mitglied
+@for (int i = 0; i < 2; i++) { +
+ @if (Model.Text != null) { +

@Model.Text

+ } +
+
Genossenschaft
+
Mitglied
+
-
+} diff --git a/Elwig/Documents/DeliveryNote.cshtml.cs b/Elwig/Documents/DeliveryNote.cshtml.cs index 9915ba6..0f83a16 100644 --- a/Elwig/Documents/DeliveryNote.cshtml.cs +++ b/Elwig/Documents/DeliveryNote.cshtml.cs @@ -15,6 +15,7 @@ namespace Elwig.Documents { $"Zweigstelle{d.Branch.Name}" + $""; Text = App.Client.DeliveryNoteText; + DocumentId = d.LsNr; } } } diff --git a/Elwig/Documents/Document.cshtml b/Elwig/Documents/Document.cshtml index d711c63..9db33ad 100644 --- a/Elwig/Documents/Document.cshtml +++ b/Elwig/Documents/Document.cshtml @@ -21,14 +21,15 @@
-
@Raw(Model.Header)
+
@Raw(Model.Header)
@RenderBody() diff --git a/Elwig/Documents/Document.cshtml.cs b/Elwig/Documents/Document.cshtml.cs index 2dbddc6..177553f 100644 --- a/Elwig/Documents/Document.cshtml.cs +++ b/Elwig/Documents/Document.cshtml.cs @@ -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 Render() { string name;