lazhen
2025-01-07 b3987122cbbc46c5c59d3173f37fca3170b6dc5a
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
Quintiq file version 2.0
#parent: #root
Method SetDefaultValueFromProductInStockingPointInPeriod (
  ProductInStockingPointInPeriod pispip
) id:Method_DialogCreateEditSalesDemand_SetDefaultValueFromProductInStockingPointInPeriod
{
  #keys: '[122892.0.1580105535]'
  Body:
  [*
    // Set default values for creating sales demand from product planning context menu
    data := Dialog.Data();
    
    // Use PISPIP's start and end date
    data.StartDate( pispip.Start().Date() );
    data.EndDate( pispip.End().Date() );
    data.Currency_MP( relset, MacroPlan.BaseCurrency() );
    
    // Use default priority
    priority := SalesDemandBase::GetDefaultPriority( MacroPlan );
    data.Priority( relset, priority );
    
    // Use stocking point's UoM
    uom := pispip.ProductInStockingPoint_MP().UnitOfMeasure_MP();
    data.UnitOfMeasure_MP( relset, uom );
  *]
}