yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Quintiq file version 2.0
#parent: #root
DeclarativeReferenceRelation CalcArrivalPISPIP
{
  #keys: '1[134266.1.22297719]'
  Expression:
  [*
    pispip := null( ProductInStockingPointInPeriodPlanningLeaf );
    
    if( this.Trip().HasValidArrival() )
    {
      destpisp := select( this, Trip.LaneLeg.LaneLegOutput.ProductInStockingPoint_MP, pisp,
                          pisp.StockingPoint_MP() = this.Trip().LaneLeg().AsDestinationStockingPointLeg().StockingPoint_MP()
                          and pisp.Product_MP() = this.Product_MP() );
    
      pispip := select( destpisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), p,
                        p.Period_MP() = this.Trip().ArrivalUnitPeriod().Period_MP() );
    }
    
    return pispip;
  *]
  Relation: ArrivalPISPIP
}