hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
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
Quintiq file version 2.0
#parent: #root
Method InitializeComponents (
  Product_MP product,
  StockingPoint_MP stockingpoint
) id:Method_DialogCreateEditPostponementPenalty_InitializeComponents
{
  #keys: '[139394.0.1870666578]'
  Body:
  [*
    // Set label for penalty
    productuom := guard( product.UnitOfMeasureName(), '' );
    pisp := select( product, ProductInStockingPoint_MP, pisp, pisp.StockingPoint_MP() = stockingpoint );
    
    currency := guard( stockingpoint.Currency_MP().Name(), MacroPlan.BaseCurrency().Name() )
    uom := guard( pisp.UnitOfMeasureName(), productuom );
    
    // Set the label based on the translations
    EditFieldPenalty.Label( Translations::MP_WebDesigner_DialogCreateEditPostponedSalesDemandCost_CostPerUoM( currency, uom ) );
    
    if( DataHolderDialogDatas.Data().Size() > 1 )
    {
      DropDownListProduct.Enabled( false, 
                                   Translations::MP_Designer_DisableSelectorForBatchEditAndWhenEditFromPeriodList( 'product' ) );
      DropDownListStockingPoint.Enabled( false, 
                                         Translations::MP_Designer_DisableSelectorForBatchEditAndWhenEditFromPeriodList( 'stocking point' ) );
      DateSelectorStart.Enabled( false, 
                                     Translations::MP_Designer_DisableSelectorForBatchEditAndWhenEditFromPeriodList( 'start date' ) );
    }
  *]
}