[#20][#80] Elwig: Update member_history and add different types of shares
Test / Run tests (push) Successful in 2m52s

This commit is contained in:
2026-07-01 11:01:15 +02:00
parent 4ebe07f579
commit 8f76d5158e
37 changed files with 857 additions and 264 deletions
+10 -3
View File
@@ -126,7 +126,7 @@ namespace Elwig.Services {
vm.EntryDate = (m.EntryDateString != null) ? string.Join(".", m.EntryDateString.Split("-").Reverse()) : null;
vm.ExitDate = (m.ExitDateString != null) ? string.Join(".", m.ExitDateString.Split("-").Reverse()) : null;
vm.BusinessShares = m.BusinessShares;
vm.BusinessShares = m.Shares;
vm.AccountingNr = m.AccountingNr;
vm.Branch = (Branch?)ControlUtils.GetItemFromSourceWithPk(vm.BranchSource, m.ZwstId);
vm.DefaultKg = (AT_Kg?)ControlUtils.GetItemFromSourceWithPk(vm.DefaultKgSource, m.DefaultKgNr);
@@ -487,6 +487,13 @@ namespace Elwig.Services {
.Include(m => m.TelephoneNumbers)
.Include(m => m.EmailAddresses)
.ToListAsync();
var history1 = await query.IgnoreAutoIncludes()
.SelectMany(m => m.HistoryFrom)
.ToListAsync();
var history2 = await query.IgnoreAutoIncludes()
.SelectMany(m => m.HistoryTo)
.ToListAsync();
var history = history1.Union(history2).DistinctBy(h => h.HistNr).OrderBy(h => h.HistNr).ToList();
var areaComs = await query
.SelectMany(m => m.AreaCommitments)
.Select(c => c.Contract).Distinct()
@@ -499,7 +506,7 @@ namespace Elwig.Services {
.Distinct()
.OrderBy(k => k.KgNr)
.ToList();
await ElwigData.Export(filename, members, areaComs, wbKgs, filterNames);
await ElwigData.Export(filename, members, history, areaComs, wbKgs, filterNames);
});
}
} else if (mode == ExportMode.Upload && App.Config.SyncUrl != null) {
@@ -542,7 +549,7 @@ namespace Elwig.Services {
EntryDateString = string.IsNullOrEmpty(vm.EntryDate) ? null : string.Join("-", vm.EntryDate.Split(".").Reverse()),
ExitDateString = string.IsNullOrEmpty(vm.ExitDate) ? null : string.Join("-", vm.ExitDate.Split(".").Reverse()),
BusinessShares = (int)vm.BusinessShares!,
Shares = (int)vm.BusinessShares!,
AccountingNr = string.IsNullOrEmpty(vm.AccountingNr) ? null : vm.AccountingNr,
IsActive = vm.IsActive,
IsVollLieferant = vm.IsVollLieferant,