|
|
@@ -138,10 +138,10 @@ public class MinimumStockEditorControl : DynamicEnclosedEditorControl<ProductIns
|
|
|
_usageDays.Value = _customUsage.IsChecked != true ? 0 : (_usageDays.Value ?? 0) > 0 ? _usageDays.Value : 30;
|
|
|
|
|
|
_usageFactor.IsEnabled = enabled && _customUsage.IsChecked == true;
|
|
|
- _usageFactor.Value = _customUsage.IsChecked != true ? 0 : (_usageFactor.Value ?? 0.0).IsEffectivelyGreaterThan(0.0) ? _usageFactor.Value : 1.0;
|
|
|
+ _usageFactor.Value = _customUsage.IsChecked != true ? 0 : (_usageFactor.Value ?? 0.0) > 0 ? _usageFactor.Value : 1.0;
|
|
|
|
|
|
_stockFactor.IsEnabled = enabled && _customUsage.IsChecked == true;
|
|
|
- _stockFactor.Value = _customUsage.IsChecked != true ? 0 : (_stockFactor.Value ?? 0.0).IsEffectivelyGreaterThan(0.0) ? _stockFactor.Value : 1.0;
|
|
|
+ _stockFactor.Value = _customUsage.IsChecked != true ? 0 : (_stockFactor.Value ?? 0.0) > 0 ? _stockFactor.Value : 1.0;
|
|
|
|
|
|
_customStock.IsEnabled = enabled;
|
|
|
|
|
|
@@ -166,8 +166,8 @@ public class MinimumStockEditorControl : DynamicEnclosedEditorControl<ProductIns
|
|
|
{
|
|
|
yield return new(nameof(ProductInstanceMinimumStock.CustomUsage), _customUsage.IsChecked ?? false);
|
|
|
yield return new(nameof(ProductInstanceMinimumStock.UsageDays), (int)(_usageDays.Value ?? 0L));
|
|
|
- yield return new(nameof(ProductInstanceMinimumStock.UsageFactor), _usageFactor.Value ?? 0F);
|
|
|
- yield return new(nameof(ProductInstanceMinimumStock.StockFactor), _stockFactor.Value ?? 0F);
|
|
|
+ yield return new(nameof(ProductInstanceMinimumStock.UsageFactor), Convert.ToDecimal(_usageFactor.Value ?? 0F));
|
|
|
+ yield return new(nameof(ProductInstanceMinimumStock.StockFactor), Convert.ToDecimal(_stockFactor.Value ?? 0F));
|
|
|
yield return new(nameof(ProductInstanceMinimumStock.CustomStockLevel), _customStock.IsChecked ?? false);
|
|
|
yield return new(nameof(ProductInstanceMinimumStock.StockLevel), (int)(_stockLevel.Value ?? 0L));
|
|
|
}
|
|
|
@@ -179,9 +179,9 @@ public class MinimumStockEditorControl : DynamicEnclosedEditorControl<ProductIns
|
|
|
if (string.Equals(property,nameof(ProductInstanceMinimumStock.UsageDays)))
|
|
|
return (int)(_usageDays.Value ?? 0L);
|
|
|
if (string.Equals(property,nameof(ProductInstanceMinimumStock.UsageFactor)))
|
|
|
- return _usageFactor.Value ?? 0F;
|
|
|
+ return Convert.ToDecimal(_usageFactor.Value ?? 0F);
|
|
|
if (string.Equals(property,nameof(ProductInstanceMinimumStock.StockFactor)))
|
|
|
- return _stockFactor.Value ?? 0F;
|
|
|
+ return Convert.ToDecimal(_stockFactor.Value ?? 0F);
|
|
|
if (string.Equals(property,nameof(ProductInstanceMinimumStock.CustomStockLevel)))
|
|
|
return _customStock.IsChecked ?? false;
|
|
|
if (string.Equals(property,nameof(ProductInstanceMinimumStock.StockLevel)))
|