Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod Create ( 
 | 
  Simulation_MP owner, 
 | 
  ProductInStockingPointInPeriodPlanningLeaf pispip 
 | 
) as SimulationPISPIP 
 | 
{ 
 | 
  Description: 'Static method to create a SimulationPISPIP' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Martijn Aug-23-2016 (created) 
 | 
     
 | 
    result := owner.SimulationPISPIP( relnew ); 
 | 
    result.ProductInStockingPointInPeriodPlanningLeaf( relset, pispip ); 
 | 
     
 | 
    result.InventoryHoldingCost( maxvalue( 0.0, pispip.TotalBaseInventoryHoldingCost() ) ) 
 | 
    result.InventoryLevelEnd( maxvalue( 0.0, pispip.InventoryLevelEnd() ) ); 
 | 
    result.SalesDemandQty( maxvalue( 0.0, pispip.SalesDemandQuantity() ) ); 
 | 
    result.TargetInventoryLevel( pispip.TargetInventoryLevel() ); 
 | 
    result.UnfulfilledDemandQty( maxvalue( pispip.GetUnfulfilledQuantity() - pispip.TargetInventoryLevel(), 0.0) ); 
 | 
    result.HasStockout( result.UnfulfilledDemandQty() > 0.1 ); // ingore small values 
 | 
    result.NewSupplyQty( pispip.NewSupplyQuantity()); 
 | 
    return result; 
 | 
  *] 
 | 
} 
 |