hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
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
Quintiq file version 2.0
#parent: PanelGoal/CustomDrawDataLayerStrategy
Response OnDrawObject (
  KPIWeight object
) id:Response_PanelGoal_CustomDrawDataLayerStrategy_OnDrawObject
{
  #keys: '[127710.2.19056862]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebCustomDrawDataLayer_OnDrawObject'
  QuillAction
  {
    Body:
    [*
      //Write constraint text
      
      surface.Pen().Color( Color::Black() );
      surface.Font().Size( 10 );
      
      //Write the title out of the region so that it does not trigger tooltip
      x := -100
      y := 0;
      
      //Write the goal titles only for the first goal
      title := ifexpr(  object.StrategyLevel().Level() = 1, 'Constraints:', 'Priority ' + [String]( object.StrategyLevel().Level() - 1) + ':' );
      if( not isnull( object.AsFirstKPIWeightInLevel() ) )
      {
        surface.Font().Bold( true );
        surface.TextZoom( x, y, title );
      }  
      
      //Write the goal names        
      x := 20;
      image := '';
      if(  object.KPI().IsAccount() )
      {
        image := "MONEY";
        if(  object.KPI().astype( Account ).AccountTypeName() = Translations::MP_Account_AccountTypePreference() )
        {                  
          image := "PREFERENCES";
        }
      }
      if( not ( object.Strategy().IsBounded() and  object.Strategy().IsValidKPIWeight() )
          and object.KPI().IsMaximize()
          and object.Level() = 1 )
      {
        image := "WARNING";
      }
      else if( not object.IsValidKPIUsedByOptimizer() )
      {
        image := "GEAR_WARNING";
      }
      
      surface.Image( x-25, y, 20, 20, image  );    
      surface.Font().Bold( false );   
      surface.TextZoom( x, y, object.KPIName() );
    *]
    GroupServerCalls: false
  }
}