chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
Quintiq file version 2.0
#parent: #root
Method UpdateUOMAndCurrencyBasedOnPISP () id:Method_DialogCreateEditSalesDemand_UpdateUOMAndCurrencyBasedOnPISP
{
  #keys: '[134266.0.1429275220]'
  Body:
  [*
    // When user changes the selection of product or stocking point,
    // we update the UOM based on their selection PISP, if no such
    // PISP can be found, we just make the UOM the default one
    product := SelectionProduct.Data()
    sp := guard( SelectionStockingPoint.Data(), null( StockingPoint_MP ) )
    
    uom := MacroPlan.DefaultUnitOfMeasure();
    
    if( not isnull( product ) )
    {
      pisp := select( product, ProductInStockingPoint_MP, e, 
                      e.StockingPoint_MP() = sp )
      
      uom := guard( pisp.UnitOfMeasure_MP(), uom )               
    }
    
    SelectionUnitOfMeasure.Data( uom );
    Dialog.SetCurrencyAndUOMForLabels();
  *]
}