Quintiq file version 2.0
#parent: #root
Method UIShowHideComponentForBatchEdit (
  Boolean isInit,
  Boolean isBatchEdit
) id:Method_DialogCreateEditStockingPoint_UIShowHideComponentForBatchEdit
{
  #keys: '[135040.0.219771730]'
  Body:
  [*
    // Handles the toggling of the batch related component
    if(  isInit )
    {
      //for initialize, control batch checkboxes visibility
      CheckBoxBatchEditInfinite.Visible( isBatchEdit );  
      CheckBoxBatchEditValidity.Visible( isBatchEdit );
      CheckBoxBatchEditNote.Visible( isBatchEdit );
    
      //disable all other component  
      if( isBatchEdit )
      {
        disableText := Translations::MP_StockingPoint_DialogCreateEdit_DisableForBatchEdit();
        disableFlag := false;
        
        selParentUnit.Enabled( disableFlag, disableText );
        EditFieldID.Enabled( disableFlag, disableText );
        EditFieldName.Enabled( disableFlag, disableText );
        DropDownListUOM.Enabled( disableFlag, disableText );
        DropDownListCurrency.Enabled( disableFlag, disableText );
      }
    }
    
    //batch infinite
    batchInfiniteActive:= ifexpr( isInit
                                 ,not isBatchEdit //when isBatchEdit,default=disable all
                                 ,CheckBoxBatchEditInfinite.Checked() 
                                );
    CheckboxInfiniteCapacity.Enabled( batchInfiniteActive, "" );
    
    //batch valididity
    batchValidActive:= ifexpr( isInit
                              ,not isBatchEdit //when isBatchEdit,default=disable all
                              ,CheckBoxBatchEditValidity.Checked() 
                              );
    CheckboxHasEnd.Enabled( batchValidActive, "" );
    CheckboxHasStart.Enabled( batchValidActive, "" );
    dsStart.Enabled( batchValidActive and CheckboxHasStart.Checked(), "" );
    dsEnd.Enabled( batchValidActive and CheckboxHasEnd.Checked(), "" );
    
    //batch Note
    batchNoteActive:= ifexpr( isInit
                              ,not isBatchEdit //when sBatchEdit,default=disable all
                              ,CheckBoxBatchEditNote.Checked() 
                            ); 
    EditFieldNotes.Enabled( batchNoteActive, "" );
  *]
}
