admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
StaticMethod CreateSalesDemands (
  MacroPlan macroplan,
  ProductInStockingPointInPeriodPlanningLeafs pispips
)
{
  Description: "Automatically creates the sales demand for pispips that doesn't have dependent demand"
  TextBody:
  [*
    // ju jinn Dec-9-2014 (created)
    
    
    if( isnull( pispips ) )
    {
      //skip the creation as long as there is a demand in any of the pispip
      traverse( macroplan, LeafProductInStockingPoint, pisp,
                not exists( pisp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispip, ( pispip.DependentDemand( relsize ) + pispip.DisaggregationFactor(relsize) ) > 0 )
              )
      {
          traverse( pisp, ProductInStockingPointInPeriod, pispip )
          {
            pispip.CreateSalesDemand( macroplan );
          }
      }
    }
    else
    {
      traverse( pispips, Elements, pispip )
      {
        pispip.CreateSalesDemand( macroplan );
      }
    }
  *]
}