[#47] Billing: Add penalty per business share
All checks were successful
Test / Run tests (push) Successful in 2m2s
All checks were successful
Test / Run tests (push) Successful in 2m2s
This commit is contained in:
@ -49,13 +49,17 @@ namespace Elwig.Windows {
|
||||
SeasonPenaltyPerKgInput.Text = s.PenaltyPerKg?.ToString() ?? "";
|
||||
SeasonPenaltyInput.Text = s.PenaltyAmount?.ToString() ?? "";
|
||||
SeasonPenaltyNoneInput.Text = s.PenaltyNone?.ToString() ?? "";
|
||||
SeasonPenaltyPerBsInput.Text = s.PenaltyPerBsAmount?.ToString() ?? "";
|
||||
SeasonPenaltyPerBsNoneInput.Text = s.PenaltyPerBsNone?.ToString() ?? "";
|
||||
SeasonBsValueInput.Text = s.BusinessShareValue?.ToString() ?? "";
|
||||
|
||||
var sym = s.Currency.Symbol ?? "";
|
||||
var sym = s.Currency.Symbol ?? s.Currency.Code;
|
||||
SeasonModifierAbsInput.Unit = $"{sym}/kg";
|
||||
SeasonPenaltyPerKgInput.Unit = $"{sym}/kg";
|
||||
SeasonPenaltyInput.Unit = sym;
|
||||
SeasonPenaltyNoneInput.Unit = sym;
|
||||
SeasonPenaltyPerBsInput.Unit = $"{sym}/GA";
|
||||
SeasonPenaltyPerBsNoneInput.Unit = $"{sym}/GA";
|
||||
SeasonBsValueInput.Unit = $"{sym}/GA";
|
||||
AreaCommitmentTypePenaltyPerKgInput.Unit = $"{sym}/kg";
|
||||
AreaCommitmentTypePenaltyInput.Unit = sym;
|
||||
@ -72,6 +76,8 @@ namespace Elwig.Windows {
|
||||
SeasonPenaltyPerKgInput.Text = "";
|
||||
SeasonPenaltyInput.Text = "";
|
||||
SeasonPenaltyNoneInput.Text = "";
|
||||
SeasonPenaltyPerBsInput.Text = "";
|
||||
SeasonPenaltyPerBsNoneInput.Text = "";
|
||||
SeasonBsValueInput.Text = "";
|
||||
}
|
||||
_seasonUpdate = false;
|
||||
@ -94,6 +100,8 @@ namespace Elwig.Windows {
|
||||
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;
|
||||
s.PenaltyPerBsAmount = (SeasonPenaltyPerBsInput.Text.Length > 0) ? decimal.Parse(SeasonPenaltyPerBsInput.Text) : null;
|
||||
s.PenaltyPerBsNone = (SeasonPenaltyPerBsNoneInput.Text.Length > 0) ? decimal.Parse(SeasonPenaltyPerBsNoneInput.Text) : null;
|
||||
s.BusinessShareValue = (SeasonBsValueInput.Text.Length > 0) ? decimal.Parse(SeasonBsValueInput.Text) : null;
|
||||
|
||||
UpdateButtons();
|
||||
@ -119,5 +127,11 @@ namespace Elwig.Windows {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckDecimal((TextBox)sender, false, 4, 2));
|
||||
Season_Changed(sender, evt);
|
||||
}
|
||||
|
||||
private void SeasonPenaltyPerBsInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||
if (SeasonList.SelectedItem is not Season s) return;
|
||||
InputTextChanged((TextBox)sender, Validator.CheckDecimal((TextBox)sender, false, 4, s.Precision));
|
||||
Season_Changed(sender, evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user