Quintiq file version 2.0
#parent: #root
Method EditSupplySpecification (
  internal[GUIComponent] parent,
  SupplySpecification selection
) id:Method_DialogCreateEditSupplySpecification_EditSupplySpecification
{
  #keys: '[112884.0.287583733]'
  Body:
  [*
    // Edit supply specification
    
    data := shadow( selection );
    Dialog.Data( data );
    Dialog.EnableDisableComponent();
    Dialog.EnableDisableEditorMaxQuantity();
    
    result := this.DoModal( parent );
    
    if( result > 0 )
    {
      selection.Update( data.Unit(),
                        data.Product_MP(),
                        ifexpr( CheckBoxHasStart.Checked(), GUIDateTimeSelectorStart.DateTime(), DateTime::MinDateTime() ), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing
                        ifexpr( CheckBoxHasEnd.Checked(), GUIDateTimeSelectorEnd.DateTime(), DateTime::MaxDateTime() ), // Read-only, apply changes to shadow is not taking place for read-only attribute when editing
                        data.MinQuantity(),
                        data.TargetQuantity(),
                        data.HasMaxQuantity(),
                        data.MaxQuantity(),
                        false );
    }
  *]
}
