[#20][#80] Elwig: Update member_history and add different types of shares
Test / Run tests (push) Successful in 2m52s
Test / Run tests (push) Successful in 2m52s
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user