[#80] Elwig: Add client parameter to switch between simple and red/white business share mode
Test / Run tests (push) Successful in 2m20s
Test / Run tests (push) Successful in 2m20s
This commit is contained in:
@@ -126,7 +126,15 @@ 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.Shares;
|
||||
if (App.Client.HasRedWhite) {
|
||||
vm.BusinessShares1 = m.SharesRed;
|
||||
vm.BusinessShares2 = m.SharesWhite;
|
||||
vm.BusinessShares3 = m.SharesDormant + m.Shares;
|
||||
} else {
|
||||
vm.BusinessShares1 = m.Shares;
|
||||
vm.BusinessShares2 = m.SharesDormant + m.SharesRed + m.SharesWhite;
|
||||
vm.BusinessShares3 = 0;
|
||||
}
|
||||
vm.AccountingNr = m.AccountingNr;
|
||||
vm.Branch = (Branch?)ControlUtils.GetItemFromSourceWithPk(vm.BranchSource, m.ZwstId);
|
||||
vm.DefaultKg = (AT_Kg?)ControlUtils.GetItemFromSourceWithPk(vm.DefaultKgSource, m.DefaultKgNr);
|
||||
@@ -549,7 +557,10 @@ 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()),
|
||||
Shares = (int)vm.BusinessShares!,
|
||||
Shares = App.Client.HasRedWhite ? 0 : vm.BusinessShares1 ?? 0,
|
||||
SharesRed = App.Client.HasRedWhite ? vm.BusinessShares1 ?? 0 : 0,
|
||||
SharesWhite = App.Client.HasRedWhite ? vm.BusinessShares2 ?? 0 : 0,
|
||||
SharesDormant = App.Client.HasRedWhite ? vm.BusinessShares3 ?? 0 : vm.BusinessShares2 ?? 0,
|
||||
AccountingNr = string.IsNullOrEmpty(vm.AccountingNr) ? null : vm.AccountingNr,
|
||||
IsActive = vm.IsActive,
|
||||
IsVollLieferant = vm.IsVollLieferant,
|
||||
|
||||
Reference in New Issue
Block a user