lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Quintiq file version 2.0
#parent: #root
Method EnableDisableComponent (
  Boolean isbatchedit
) id:Method_DialogCreateEditInventorySupply_EnableDisableComponent
{
  #keys: '[105706.1.439166160]'
  Body:
  [*
    // Enable disable components
    if( isbatchedit )
    {
      SelectionProduct.DisableWithUserFeedback( Translations::MP_Designer_DisableSelectorForBatchEdit( 'stocking point' ) );
      SelectionStockingPoint.DisableWithUserFeedback( Translations::MP_Designer_DisableSelectorForBatchEdit( 'product' ) );
      GUIDateTimeSelectorDate.DisableWithUserFeedback( Translations::MP_Designer_DisableSelectorForBatchEdit( 'start date' ) );
      GUIDateTimeSelectorManufacturedDate.DisableWithUserFeedback( Translations::MP_Designer_DisableSelectorForBatchEdit( 'manufactured date' ) );
    }
    else
    {
      product := SelectionProduct.Data();
      hasshelflife := guard( product.HasShelfLife() or product.HasMaturation(), false );
      GUIDateTimeSelectorManufacturedDate.Enabled( hasshelflife );
      data := Dialog.Data();
      // set default to inventory supply date 
      if ( hasshelflife and not isnull( data ) and data.ManufacturedDate().IsInfinite() )
      {
        Dialog.Data().ManufacturedDate( data.Date() );
      }
    }
    
    EditorQuantity.Enabled( not isbatchedit
                            or( isbatchedit and CheckBoxBatchEditQuantity.Checked() ) );
    
    EditorDescription.Enabled( not isbatchedit
                               or( isbatchedit and CheckBoxBatchEditDescription.Checked() ) );
  *]
}