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
28
29
30
31
Quintiq file version 2.0
#parent: #root
Method Postpone (
  structured[BaseSalesDemandInPeriod] selection,
  structured[Period_MP] postponementperiods,
  internal[GUIComponent] parent
) as BaseSalesDemandInPeriod id:Method_DialogPostponeSalesDemandInPeriod_Postpone
{
  #keys: '[11660.1.243550068]'
  Body:
  [*
    // Postpone the planning sales demands in period
    data := shadow( selection.Element( 0 ) );
    Dialog.Data( data );
    
    DataHolderBaseSalesDemandInPeriods.Data( selection.Copy() );
    DataHolderPostponementPeriodsInForm.Data( postponementperiods.Copy() );
    
    result := this.DoModal( parent );
    
    postponedSDIP := null( BaseSalesDemandInPeriod );
    
    if ( result > 0 )
    {
      postponedSDIP := SalesDemandInPeriod::ManualPostponeToPeriod( selection,
                                                                    SelectionPostponeToPeriod.Data(),
                                                                    ApplicationLibMacroPlanner.FormatStringToReal( EditorPostponeQuantity.Text() ) );
    }
    return postponedSDIP;
  *]
}