|
@@ -60,21 +60,6 @@ namespace Comal.Classes
|
|
public FormulaType Type => FormulaType.Virtual;
|
|
public FormulaType Type => FormulaType.Virtual;
|
|
}
|
|
}
|
|
|
|
|
|
- public class StockMovementIsRemnantCondition : ICondition<StockHolding, double, object>
|
|
|
|
- {
|
|
|
|
- public Expression<Func<StockHolding, double>> Left => x => x.Dimensions.Value;
|
|
|
|
-
|
|
|
|
- public Condition Condition => Condition.LessThan;
|
|
|
|
-
|
|
|
|
- public Expression<Func<StockHolding, double>> Right => x => x.Product.DefaultInstance.Dimensions.Value;
|
|
|
|
-
|
|
|
|
- public Expression<Func<StockHolding, object>> True => x => true;
|
|
|
|
-
|
|
|
|
- public Expression<Func<StockHolding, object>> False => x => null;
|
|
|
|
-
|
|
|
|
- public ConditionType Type => ConditionType.Virtual;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
[UserTracking("Warehousing")]
|
|
[UserTracking("Warehousing")]
|
|
public class StockMovement : StockEntity, IRemotable, IPersistent, IOneToMany<StockLocation>, IOneToMany<Product>,
|
|
public class StockMovement : StockEntity, IRemotable, IPersistent, IOneToMany<StockLocation>, IOneToMany<Product>,
|
|
ILicense<WarehouseLicense>, IStockHolding, IJobMaterial, IExportable, IImportable, IPostable
|
|
ILicense<WarehouseLicense>, IStockHolding, IJobMaterial, IExportable, IImportable, IPostable
|
|
@@ -127,10 +112,20 @@ namespace Comal.Classes
|
|
[DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary= Summary.Sum)]
|
|
[DoubleEditor(Visible=Visible.Optional, Editable = Editable.Hidden, Summary= Summary.Sum)]
|
|
public double Units { get; set; }
|
|
public double Units { get; set; }
|
|
|
|
|
|
-
|
|
|
|
|
|
+ private class IsRemnantCondition : ComplexFormulaGenerator<StockMovement, bool>
|
|
|
|
+ {
|
|
|
|
+ public override IComplexFormulaNode<StockMovement, bool> GetFormula() =>
|
|
|
|
+ If<double>(
|
|
|
|
+ x => x.Property(x => x.Dimensions.Value),
|
|
|
|
+ Condition.LessThan,
|
|
|
|
+ x => x.Property(x => x.Product.DefaultInstance.Dimensions.Value))
|
|
|
|
+ .Then(Constant(true))
|
|
|
|
+ .Else(Constant(false));
|
|
|
|
+ }
|
|
|
|
+
|
|
// IsRemnant = Dimensions.Value < Product.Dimensions.Value
|
|
// IsRemnant = Dimensions.Value < Product.Dimensions.Value
|
|
[CheckBoxEditor(Editable = Editable.Hidden)]
|
|
[CheckBoxEditor(Editable = Editable.Hidden)]
|
|
- [Condition(typeof(StockMovementIsRemnantCondition))]
|
|
|
|
|
|
+ [ComplexFormula(typeof(IsRemnantCondition))]
|
|
[EditorSequence(7)]
|
|
[EditorSequence(7)]
|
|
public bool IsRemnant { get; set; }
|
|
public bool IsRemnant { get; set; }
|
|
|
|
|