Entities/MemberHistory: Add DeductYear to simplify billing
Test / Run tests (push) Successful in 2m59s

This commit is contained in:
2026-07-03 10:43:14 +02:00
parent a71c41af5c
commit 3b4dbd51fd
8 changed files with 16 additions and 15 deletions
@@ -60,7 +60,7 @@ namespace Elwig.Windows {
CustomPayments = await ctx.CustomPayments.Where(p => p.Year == Year).ToDictionaryAsync(p => p.MgNr, p => p);
var history = await ctx.MemberHistory
.Where(h => h.DateString.CompareTo($"{Year}-01-01") >= 0 && h.DateString.CompareTo($"{Year}-12-31") <= 0 && h.Reason == "auto" && h.Shares > 0)
.Where(h => h.DeductYear == Year)
.GroupBy(h => h.ToMember)
.ToDictionaryAsync(h => h.Key.MgNr, h => h.Sum(g => g.Shares));