yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Quintiq file version 2.0
#parent: pnlActions/btnOKRun
Response OnClick () id:Response_pnlActions_btnOKRun_OnClick
{
  #keys: '[127710.2.15647450]'
  DefinitionID: 'Responsedef_WebButton_OnClick'
  Precondition:
  [*
    activescenario := DataHolderActiveScenario.Data();
    return not ScenarioManager::HasOptimizerRun( ScenarioManager, activescenario, feedback )
           and Period_MP::HasPeriod( feedback, MacroPlan )
           and MacroPlan.CanPlan( feedback )
           and ScenarioManager::HasCapacityForMaximumNumberofConcurrentRuns( ScenarioManager, activescenario, true, feedback )
           and AlgorithmRun::ValidateInputSelectOptimizer( feedback,
                                                           null( OptimizerPuzzle ),
                                                           DropDownListStrategy.Data(),
                                                           DropDownListPeriodsFrom.Data(),
                                                           DropDownListPeriodsTo.Data(),
                                                           MacroPlan, 
                                                           true ); //iswebapp = TRUE
  *]
  QuillAction
  {
    Body:
    [*
      // Run algorithm
      this.Enabled( false, '' );
      
      issmartplan := false;
      issmartplanfromperiodtask := false;
      hastotalsupplyuser := false;
      totalsupplyuser := 0.0;
      smartplanpispip := null( ProductInStockingPointInPeriodPlannings );
      forcenoautoscaling := false; 
      isupstreamsmartplan := false;
      ismiddleoutsmartplan := false;
      isonlyplanonestepupstream := false;
      ispostprocessing := false;
      isusingselectedunits := false;
      units := null( Units );
      process := null( Process_MP );
      // Set IsOptimizerRunning in designer, prevent the dialog to reopen when user click to terminate
      MacroPlan.IsOptimizerRunning( true );
      MacroPlan.RunOptimizer( issmartplan,
                              issmartplanfromperiodtask,
                              hastotalsupplyuser,
                              totalsupplyuser,
                              smartplanpispip,
                              isupstreamsmartplan,
                              ismiddleoutsmartplan,
                              isonlyplanonestepupstream,
                              ispostprocessing,
                              forcenoautoscaling, 
                              DataHolderSelectedStrategy.Data(),
                              CheckboxOverrideManualPlan.Checked(),  //override manual planning
                              DropDownListPeriodsFrom.Data(),
                              DropDownListPeriodsTo.Data(),
                              false,
                              isusingselectedunits,
                              units,
                              process,  // IsInventoryOptimizationRun 
                              DropDownListPuzzle.Data() );
      Form.Close();
    *]
    GroupServerCalls: false
  }
}