From cf05a0c658d535c07e35c724272a612c20203133 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Fri, 2 Aug 2024 11:42:27 +0200 Subject: [PATCH] DeliveryJournalData: Add delivery and member branch to excel export --- Elwig/Documents/PaymentVariantSummary.cshtml | 2 +- Elwig/Helpers/Utils.cs | 2 +- Elwig/Models/Dtos/DeliveryJournalData.cs | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Elwig/Documents/PaymentVariantSummary.cshtml b/Elwig/Documents/PaymentVariantSummary.cshtml index c7db8bb..972ba72 100644 --- a/Elwig/Documents/PaymentVariantSummary.cshtml +++ b/Elwig/Documents/PaymentVariantSummary.cshtml @@ -49,7 +49,7 @@ @(Model.BillingData.ConsiderContractPenalties ? "Ja" : "Nein") - Nto./bto.-Zuschl: + Rebel-Zuschl.: @($"{Utils.GetSign(Model.BillingData.NetWeightModifier)}{Math.Abs(Model.BillingData.NetWeightModifier) * 100:N2}") % / @($"{Utils.GetSign(Model.BillingData.GrossWeightModifier)}{Math.Abs(Model.BillingData.GrossWeightModifier) * 100:N2}") % diff --git a/Elwig/Helpers/Utils.cs b/Elwig/Helpers/Utils.cs index 707bfe3..0c4adb6 100644 --- a/Elwig/Helpers/Utils.cs +++ b/Elwig/Helpers/Utils.cs @@ -197,7 +197,7 @@ namespace Elwig.Helpers { } public static void MailTo(string emailAddress) { - MailTo(new string[] { emailAddress }); + MailTo([emailAddress]); } public static void MailTo(IEnumerable emailAddresses) { diff --git a/Elwig/Models/Dtos/DeliveryJournalData.cs b/Elwig/Models/Dtos/DeliveryJournalData.cs index 525a589..5fec093 100644 --- a/Elwig/Models/Dtos/DeliveryJournalData.cs +++ b/Elwig/Models/Dtos/DeliveryJournalData.cs @@ -14,16 +14,18 @@ namespace Elwig.Models.Dtos { ("Pos", "Pos.", null, 10), ("Date", "Datum", null, 20), ("Time", "Zeit", null, 20), + ("DeliveryBranch", "Zweigstelle", null, 30), ("MgNr", "MgNr.", null, 12), ("Name1", "Name", null, 40), ("Name2", "Vorname", null, 40), + ("MemberBranch", "Stamm-Zwst.", null, 30), ("SortId", "Sorte", null, 10), ("AttrId", "Attr.", null, 15), ("CultId", "Bewirt.", null, 15), ("QualId", "Qualität", null, 15), ("Gradation", "Gradation", "°Oe|°KMW", 40), ("Weight", "Gewicht", "kg", 20), - ("NetGross", "bto./nto.", null, 20), + ("IsNetWeight", "Gerebelt", null, 20), ("HkId", "Herkunft", null, 20), ("Modifiers", "Zu-/Abschläge", null, 40), ("Comment", "Anmerkung", null, 60), @@ -35,7 +37,7 @@ namespace Elwig.Models.Dtos { public static async Task FromQuery(IQueryable query, List filterNames) { return new((await query - .Include(p => p.Delivery.Member) + .Include(p => p.Delivery.Member.Branch) .Include(p => p.Delivery.Branch) .Include(p => p.PartModifiers).ThenInclude(m => m.Modifier) .Include(p => p.Variety) @@ -53,10 +55,12 @@ namespace Elwig.Models.Dtos { public int Pos; public DateOnly Date; public TimeOnly? Time; + public string DeliveryBranch; public int MgNr; public string Name1; public string Name2; public string AdministrativeName; + public string? MemberBranch; public string SortId; public string Variety; public string? AttrId; @@ -71,7 +75,6 @@ namespace Elwig.Models.Dtos { public double Oe => Gradation.Oe; public int Weight { get; set; } public bool IsNetWeight; - public string NetGross => IsNetWeight ? "n" : "b"; public string? Modifiers; public string? Comment; @@ -83,10 +86,12 @@ namespace Elwig.Models.Dtos { Pos = p.DPNr; Date = d.Date; Time = d.Time; + DeliveryBranch = d.Branch.Name; MgNr = m.MgNr; Name1 = m.FamilyName; Name2 = m.AdministrativeName2; AdministrativeName = m.AdministrativeName; + MemberBranch = m.Branch?.Name; SortId = p.SortId; Variety = p.Variety.Name;