[#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:
@@ -47,8 +47,8 @@ namespace Elwig.Windows {
|
||||
SeasonVatFlatrateInput.Text = (s.VatFlatrate * 100).ToString();
|
||||
SeasonStartInput.Text = $"{s.StartDate:dd.MM.yyyy}";
|
||||
SeasonEndInput.Text = $"{s.EndDate:dd.MM.yyyy}";
|
||||
SeasonMinKgPerShareInput.Text = s.MinKgPerShare.ToString();
|
||||
SeasonMaxKgPerShareInput.Text = s.MaxKgPerShare.ToString();
|
||||
SeasonMinKgPerShareInput.Text = s.MinKgPerShare?.ToString() ?? s.MinKgPerShareRed?.ToString() ?? s.MinKgPerShareWhite?.ToString() ?? "0";
|
||||
SeasonMaxKgPerShareInput.Text = s.MaxKgPerShare?.ToString() ?? s.MaxKgPerShareRed?.ToString() ?? s.MaxKgPerShareWhite?.ToString() ?? "0";
|
||||
SeasonPenaltyPerKgInput.Text = s.PenaltyPerKg?.ToString() ?? "";
|
||||
SeasonPenaltyInput.Text = s.PenaltyAmount?.ToString() ?? "";
|
||||
SeasonPenaltyNoneInput.Text = s.PenaltyNone?.ToString() ?? "";
|
||||
@@ -96,10 +96,22 @@ namespace Elwig.Windows {
|
||||
s.VatNormal = double.Parse(SeasonVatNormalInput.Text) / 100;
|
||||
if (SeasonVatFlatrateInput.Text.Length > 0)
|
||||
s.VatFlatrate = double.Parse(SeasonVatFlatrateInput.Text) / 100;
|
||||
if (SeasonMinKgPerShareInput.Text.Length > 0)
|
||||
s.MinKgPerShare = int.Parse(SeasonMinKgPerShareInput.Text);
|
||||
if (SeasonMaxKgPerShareInput.Text.Length > 0)
|
||||
s.MaxKgPerShare = int.Parse(SeasonMaxKgPerShareInput.Text);
|
||||
if (ParameterBusinessShareModeInput.SelectedIndex == 0) {
|
||||
s.MinKgPerShare = (SeasonMinKgPerShareInput.Text.Length > 0) ? int.Parse(SeasonMinKgPerShareInput.Text) : null;
|
||||
s.MaxKgPerShare = (SeasonMaxKgPerShareInput.Text.Length > 0) ? int.Parse(SeasonMaxKgPerShareInput.Text) : null;
|
||||
s.MinKgPerShareRed = null;
|
||||
s.MaxKgPerShareRed = null;
|
||||
s.MinKgPerShareWhite = null;
|
||||
s.MaxKgPerShareWhite = null;
|
||||
} else {
|
||||
s.MinKgPerShare = null;
|
||||
s.MaxKgPerShare = null;
|
||||
s.MinKgPerShareRed = (SeasonMinKgPerShareInput.Text.Length > 0) ? int.Parse(SeasonMinKgPerShareInput.Text) : null;
|
||||
s.MaxKgPerShareRed = (SeasonMaxKgPerShareInput.Text.Length > 0) ? int.Parse(SeasonMaxKgPerShareInput.Text) : null;
|
||||
s.MinKgPerShareWhite = s.MinKgPerShareRed;
|
||||
s.MaxKgPerShareWhite = s.MaxKgPerShareRed;
|
||||
}
|
||||
|
||||
s.PenaltyPerKg = (SeasonPenaltyPerKgInput.Text.Length > 0) ? decimal.Parse(SeasonPenaltyPerKgInput.Text) : null;
|
||||
s.PenaltyAmount = (SeasonPenaltyInput.Text.Length > 0) ? decimal.Parse(SeasonPenaltyInput.Text) : null;
|
||||
s.PenaltyNone = (SeasonPenaltyNoneInput.Text.Length > 0) ? decimal.Parse(SeasonPenaltyNoneInput.Text) : null;
|
||||
@@ -160,8 +172,8 @@ namespace Elwig.Windows {
|
||||
MaxKgPerHa = s?.MaxKgPerHa ?? 10000,
|
||||
VatNormal = s?.VatNormal ?? 0.10,
|
||||
VatFlatrate = s?.VatFlatrate ?? 0.13,
|
||||
MinKgPerShare = s?.MinKgPerShare ?? 500,
|
||||
MaxKgPerShare = s?.MaxKgPerShare ?? 1000,
|
||||
MinKgPerShare = s?.MinKgPerShare,
|
||||
MaxKgPerShare = s?.MaxKgPerShare,
|
||||
PenaltyPerKgValue = s?.PenaltyPerKgValue,
|
||||
PenaltyAmoutValue = s?.PenaltyAmoutValue,
|
||||
PenaltyNoneValue = s?.PenaltyNoneValue,
|
||||
@@ -181,6 +193,7 @@ namespace Elwig.Windows {
|
||||
AbsValue = m.AbsValue * mult / div,
|
||||
RelValue = m.RelValue,
|
||||
IsActive = m.IsActive,
|
||||
IsRedacted = m.IsRedacted,
|
||||
}));
|
||||
}
|
||||
await ctx.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user