using Elwig.Helpers; using Elwig.Models.Entities; using System.Collections.Generic; namespace Elwig.Documents { public class DeliveryNote : BusinessDocument { public new static string Name => "Traubenübernahmeschein"; public Delivery Delivery; public string? Text; public Dictionary MemberBuckets; // 0 - none // 1 - GA only // 2 - GA only and area commitments of varieties from delivery note // 3 - full public int DisplayStats = App.Client.ModeDeliveryNoteStats; public DeliveryNote(Delivery d, AppDbContext? ctx = null) : base($"{Name} Nr. {d.LsNr}", d.Member) { UseBillingAddress = true; ShowDateAndLocation = true; Delivery = d; Aside = Aside.Replace("", "") + $"Lieferung" + $"LS-Nr.:{d.LsNr}" + $"Datum/Zeit:{d.Date:dd.MM.yyyy} / {d.Time:HH:mm}" + $"Zweigstelle:{d.Branch.Name}" + $""; Text = App.Client.TextDeliveryNote; DocumentId = d.LsNr; MemberBuckets = ctx?.GetMemberBuckets(d.Year, d.Member.MgNr).GetAwaiter().GetResult() ?? []; } } }