lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
Quintiq file version 2.0
#parent: #root
Method SetSmartPlanPreference (
  MacroPlan macroplan,
  String strategy
)
{
  Description:
  [*
    In Product Planning form, right click on 1-Feb-<SOP year>, select "Smart plan..." context menu.
    Click on "Advanced" tab, change smart plan direction to "Upstream". 
    Click "Save my preferences" button to save the changes.
    Click on "OK" to close dialog.
  *]
  TextBody:
  [*
    // Save preference for smart plan
    defaultSmartplanSetting := macroplan.SmartPlanSetting();
    hasUserSetting := true;
    smartPlanDirection := SmartPlanSetting::Upstream();
    
    overrideManualPlanning := defaultSmartplanSetting.OverwriteLockedPlanning();
    onlyPlanOneStep        := defaultSmartplanSetting.OnlyPlanOneStep();
    limitUnit              := defaultSmartplanSetting.LimitUnitBySmartPlan();
    units                  := defaultSmartplanSetting.UnitForSmartPlan( relget );
    
    macroplan.SmartPlanSetting().Update( hasUserSetting, 
                                         smartPlanDirection,
                                         overrideManualPlanning,
                                         onlyPlanOneStep,
                                         strategy,
                                         limitUnit,
                                         units );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}