Quintiq file version 2.0
#parent: #root
Method EditInventorySpecification (
  internal[GUIComponent] parent,
  structured[InventorySpecification] selection
) id:Method_DialogCreateEditInventorySpecification_EditInventorySpecification
{
  #keys: '[11660.0.763179500]'
  Body:
  [*
    // Edit inventory specifications
    isbatchedit := selection.Size() > 1;
    Dialog.ShowHideComponentForBatchEdit( isbatchedit, true );
    
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      InventorySpecification::Update( selection,
                                      data.Product_MP(),
                                      data.StockingPoint_MP(),
                                      GUIStartDateTimeSelector.DateTime().Date(), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing.
                                      false,
                                      false,
                                      0.0,
                                      0.0,
                                      CheckBoxBatchEditMinLevel.Checked(),
                                      data.HasMinLevelInDays(),
                                      data.MinLevelInDays(),
                                      data.MinLevelInQuantity(),
                                      CheckBoxBatchEditMaxLevel.Checked(),
                                      data.HasMaxLevel(),
                                      data.HasMaxLevelInDays(),
                                      data.MaxLevelInDays(),
                                      data.MaxLevelInQuantity(),
                                      false );
    }
  *]
}
