yypsybs
2023-10-10 550ebcf02217f8a0c6fe9001fcfa8e42e9cd6b83
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
Quintiq file version 2.0
#parent: #root
Method SetDefaultValue (
  ProductInStockingPointInPeriod pispip
) id:Method_DialogCreateEditDisaggregationFactor_SetDefaultValue
{
  #keys: '[124808.0.1994363534]'
  Body:
  [*
    // Set the default value for the fields in the dialog
    
    data := Dialog.Data();
    
    // Creating disaggregation factor will initially not have any PISPIP related to it
    if( isnull( data.WrappedInstance() ) )
    {
      data.Start( guard( pispip.Start().Date(), MacroPlan.StartOfPlanningPeriod().StartDate() ) );
    }
    
    // Relate to the stocking point of the PISPIP when creating from PISPIP
    if( not isnull( pispip ) )
    {
      data.StockingPoint_MP( relset, pispip.ProductInStockingPoint_MP().StockingPoint_MP() );
    
    }
    
    data.Factor( guard( pispip.DisaggregationFactor().Factor(), 0 ) );
  *]
}