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
24
25
26
27
28
29
30
31
32
33
34
35
36
Quintiq file version 2.0
#parent: #root
Method GetIsInPISPIP (
  ProductInStockingPointInPeriods pispips
) declarative remote as Boolean
{
  Description:
  [*
    Given PISPIP, indicate if the trip is transporting the product in stocking point and arrive at the period.
    Trips will be filtered based on its destination stocking point, product and period when a PISPIP in the product planning Gantt chart is selected.
  *]
  TextBody:
  [*
    // desmondt Jun-4-2015 (created)
    value := false;
    
    if( this.HasValidArrival() )
    {
      value := exists( pispips, Elements, pispip,
                       exists( this,
                               ProductInTrip.ArrivalPISPIP.ProductInStockingPoint_MP,
                               prodintransit,
                               ( prodintransit = pispip.ProductInStockingPoint_MP()
                                 or ( pispip.ProductInStockingPoint_MP().StockingPoint_MP() = prodintransit.StockingPoint_MP()
                                      and pispip.ProductInStockingPoint_MP().Product_MP().IsParentOf( prodintransit.Product_MP() ) 
                                    )
                               )
                               and this.ArrivalUnitPeriod().Period_MP().IsInPeriod( pispip.Start(), pispip.End() )
                             )
                     );
    }
    
    
    return value;
  *]
}