Kevin Kok Khah Whey
2023-09-25 34d29be6a3eb0c025da50b77f2107c4ad259c6c0
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
38
39
40
41
42
Quintiq file version 2.0
#parent: #root
Method ShowHideComponents (
  Boolean isbatchedit
) id:Method_DialogCreateEditPISPSpecification_ShowHideComponents
{
  #keys: '[124808.2.593321940]'
  Body:
  [*
    // Show/hide components
    
    data := Dialog.Data();
    
    pisp := select( data, ProductInStockingPoint_MP.WrappedInstance, p, p = DataHolderPISP.Data() );
    
    uom := guard( pisp.UnitOfMeasure_MP(), null( UnitOfMeasure_MP ) );
    
    isshown := false;
    
    if( not isnull( uom ) )
    {
      isshown := uom <> SelectionUnitOfMeasurement.Data();
    }
    
    ImageUnitOfMeasurement.Visible( isshown );
    ImageUnitOfMeasurement.SetProperty( 'Tooltip', pisp.GetUpdateUOMWarningMessage() );
    
    // Update components visibility for batch edit
    CheckBoxIsBatchEditUOM.Visible( isbatchedit );
    CheckBoxIsBatchEditIsNegativeInventoryAllowed.Visible( isbatchedit );
    CheckBoxIsBatchEditIsExcluded.Visible( isbatchedit );
    CheckBoxIsBatchEditIsExcludedFromBalancing.Visible( isbatchedit );
    CheckBoxIsBatchEditInputLotSize.Visible( isbatchedit );
    
    canEditSafetyStock := forall( data, ProductInStockingPoint_MP.WrappedInstance, p, p.IsLeaf() );
    CheckBoxIsBatchEditIsSafetyStockKept.Visible( isbatchedit and canEditSafetyStock );
    CheckBoxIsSafetyStockKept.Visible( canEditSafetyStock );
    CheckBoxIsBatchEditIsExcludeShelfLife.Visible( isbatchedit );
    
    TabPageValueCost.Enabled( not isbatchedit );
  *]
}