yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Quintiq file version 2.0
#parent: #root
DeclarativeOwningNMRelation CalcDependentDemand
{
  #keys: '1[134266.1.45259260]'
  Expression:
  [*
    set := construct( ProductInStockingPointInPeriodPlanningLeafs );
    startofdd := this.DependentDemandStart();
    if ( startofdd.IsFinite() )
    {
      endofdd := Process_MP::GetDependentDemandEnd( startofdd, this.UnitPeriod().Period_MP(), this.Operation() ); //Process_MP::GetOperationEnd( this.UnitPeriod().Period_MP(), startofdd );
      
      set := selectset( this,
                        // Not using Process.ProcessInput as the relation has not been propagated.
                        // This will result in DDIG not being created.
                        Operation.OperationInput.ProductInStockingPoint_MP.ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ),
                        pispip,
                        // The period that the DD belongs to
                        pispip.Period_MP().IsInPeriod( startofdd, endofdd ) );
    }
    return &set;
  *]
  HelperRelation: ProductInStockingPointInPeriodPlanningLeaf
  InstantiationType: DependentDemand
  Relation: DependentDemand
}