Quintiq file version 2.0
#parent: #root
Method PopulateScenarioComparisonNewSupplies (
  structured[MacroPlan] macroplans,
  structured[Period_MP] activeperiods,
  structured[Unit] units,
  structured[StockingPoint_MP] sps,
  structured[Product_MP] products
) id:Method_ApplicationMacroPlanner_PopulateScenarioComparisonNewSupplies
{
  #keys: '[138546.0.73400301]'
  Body:
  [*
    // Populate new supplies for scenario comparison
    pisps := selectset( macroplans, Elements.Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsForProduct( products ) );
    
    operationInputOutputs := selectset( pisps, Elements.OperationOutput, oo,
                                        oo.Operation().IsInUnit( units )
                                        or oo.ProductInStockingPoint_MP().IsInStockingPoint( sps ) );
    
    newsupplies := selectset( operationInputOutputs, Elements.NewSupply, ns, 
                              ns.ProductInStockingPointInPeriod().Period_MP().IsInPeriods( activeperiods ) );
     
    DataHolderScenarioComparisonNewSupply.Data( &newsupplies );
    DataHolderScenarioComparisonNewSupply.Data();
  *]
}
