|
|
@@ -180,7 +180,39 @@ namespace Comal.Classes
|
|
|
[DoubleEditor(Editable = Editable.Disabled)]
|
|
|
[EditorSequence(12)]
|
|
|
public double OnOrder { get; set; }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ private class GeneralOrderFormula : ComplexFormulaGenerator<JobRequisitionItem, double>
|
|
|
+ {
|
|
|
+ public override IComplexFormulaNode<JobRequisitionItem, double> GetFormula() =>
|
|
|
+ Formula(
|
|
|
+ FormulaOperator.Divide,
|
|
|
+ Formula(
|
|
|
+ FormulaOperator.Add,
|
|
|
+
|
|
|
+ Aggregate<PurchaseOrderItem>(
|
|
|
+ AggregateCalculation.Sum,
|
|
|
+ x => x.Property(x => x.Unallocated),
|
|
|
+ new Filter<PurchaseOrderItem>(x => x.ReceivedDate).IsEqualTo(null)
|
|
|
+ .And(x => x.Job.ID).IsEqualTo(Guid.Empty)
|
|
|
+ )
|
|
|
+ .WithLink(x => x.Product.ID, x => x.Product.ID),
|
|
|
+
|
|
|
+
|
|
|
+ Aggregate<PurchaseOrderItemAllocation>(
|
|
|
+ AggregateCalculation.Sum,
|
|
|
+ x => x.Property(x => x.Quantity),
|
|
|
+ new Filter<PurchaseOrderItemAllocation>(x => x.Item.ReceivedDate).IsEqualTo(null)
|
|
|
+ .And(x => x.Job.ID).IsEqualTo(Guid.Empty)
|
|
|
+ ).WithLink(x => x.Item.Product.ID, x => x.Product.ID)
|
|
|
+ ),
|
|
|
+ Property(x => x.Dimensions.Value)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ [ComplexFormula(typeof(GeneralOrderFormula))]
|
|
|
+ [DoubleEditor(Editable = Editable.Hidden)]
|
|
|
+ public double GeneralOrder { get; set; }
|
|
|
+
|
|
|
private class TreatmentRequiredFormula : ComplexFormulaGenerator<JobRequisitionItem, double>
|
|
|
{
|
|
|
public override IComplexFormulaNode<JobRequisitionItem, double> GetFormula() =>
|