Entities/MemberHistory: Add DeductYear to simplify billing
Test / Run tests (push) Successful in 2m59s
Test / Run tests (push) Successful in 2m59s
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user