Quintiq file version 2.0
#parent: #root
Method NewStockingPointCapacity (
  internal[GUIComponent] parent,
  StockingPoint_MP stockingpoint
) as StockingPointCapacity id:Method_DialogCreateEditStockingPointCapacity_NewStockingPointCapacity_205
{
  #keys: '[132444.0.68686110]'
  Body:
  [*
    // New stocking point capacity from selected stocking point
    
    data := stockingpoint.StockingPointCapacity( relshadow, StockingPointID := stockingpoint.ID(), Start := MacroPlan.StartOfPlanning().Date() );
    
    Dialog.Data( data );
    Dialog.SetDefaultValue( null( StockingPointInPeriod ) );
    Dialog.ShowHideComponents( false );
    
    result := Dialog.DoModal( parent );
    newobj := null( StockingPointCapacity );
    
    if( result > 0 )
    {
      newobj := StockingPointCapacity::Create( data.StockingPoint_MP(),
                                               data.Start(),
                                               data.MaxCapacity(),
                                               false );
    }
    
    return newobj;
  *]
}
