DeliveryAdminWindow: Add filter for branch when in Receipt mode
This commit is contained in:
@ -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));
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user