admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
Quintiq file version 2.0
#parent: #root
StaticMethod GetHasAllDefaultSmartPlanSettings (
  Boolean isuseselectedunits,
  Boolean isplanonestepupstream,
  Boolean isupstream,
  output String feedback_o,
  String smartplandirection
) declarative remote as Boolean
{
  Description: 'Returns a warning to the user about non-default settings that could potentially lead to unexpected smart plan results'
  TextBody:
  [*
    // Returns a warning to the user about non-default settings that could potentially lead to unexpected smart plan results
    isalldefault := true;
    
    // Check if the smart plan direction is towards downstream
    if( smartplandirection <> SmartPlanSetting::MiddleOut() )
    {
      isalldefault := false;
      feedback_o := feedback_o + 
                    String::NewLine() 
                    + Translations::MP_Designer_DialogSmartPlan_SmartPlanDirection( smartplandirection );
    }
    // Check if the smart plan is using selected units only
    if( isuseselectedunits )
    {
      isalldefault := false;
      feedback_o := feedback_o + 
                    String::NewLine() 
                    + Translations::MP_Designer_DialogSmartPlan_OnlyUseSelectedUnits();
    }
    // Check if smart plan is limited to planning one step upstream only
    if( isplanonestepupstream )
    {
      isalldefault := false;
      feedback_o := feedback_o +
                    String::NewLine() 
                    + Translations::MP_Designer_DialogSmartPlan_OnlyOneStepUpstream();
    }
    
    // Add feedback text if the smart plan s using any non-default settings
    if( not isalldefault )
    {
      feedback_o := Translations::MP_Designer_DialogSmartPlan_HasNonDefaultSettings()
                    + feedback_o;
    }
    
    return isalldefault;
  *]
}