DeliveryAdminWindow: Add filter for branch when in Receipt mode

This commit is contained in:
2023-11-16 09:32:25 +01:00
parent 363005ad49
commit 6db2e0a4ec
2 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,7 @@ namespace Elwig {
}
}
public static int BranchNum { get; private set; }
public static string ZwstId { get; private set; }
public static string BranchName { get; private set; }
public static int? BranchPlz { get; private set; }
@ -91,6 +92,7 @@ namespace Elwig {
Shutdown();
return;
}
BranchNum = branches.Count;
}
Utils.RunBackground("HTML Initialization", () => Html.Init(PrintingReadyChanged));

View File

@ -296,6 +296,10 @@ namespace Elwig.Windows {
private async Task<(List<string>, IQueryable<Delivery>, IQueryable<DeliveryPart>, List<string>)> GetFilters() {
List<string> filterNames = new();
IQueryable<Delivery> deliveryQuery = Context.Deliveries;
if (IsReceipt && App.BranchNum > 1) {
deliveryQuery = deliveryQuery.Where(d => d.ZwstId == App.ZwstId);
filterNames.Add($"Zweigstelle {App.BranchName}");
}
if (Member != null) {
deliveryQuery = deliveryQuery.Where(d => d.MgNr == Member.MgNr);
filterNames.Add(Member.AdministrativeName);