| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod GetTimeUnitLevel ( | 
|   String timeunit | 
| ) const declarative remote as Number | 
| { | 
|   Description: 'Returns the level (1,2,3,4,5) depending on time unit' | 
|   TextBody: | 
|   [* | 
|     level := 0; | 
|     if( timeunit = Translations::MP_GlobalParameters_Hour() ) | 
|     { | 
|       level := 1; | 
|     } | 
|     // Day | 
|     else if( timeunit = Translations::MP_GlobalParameters_Day() ) | 
|     { | 
|       level := 2; | 
|     } | 
|     // Week | 
|     else if( timeunit = Translations::MP_GlobalParameters_Week() ) | 
|     { | 
|       level := 3; | 
|     } | 
|     // Month | 
|     else if( timeunit = Translations::MP_GlobalParameters_Month() ) | 
|     { | 
|       level := 4; | 
|     } | 
|     // Quarter | 
|     else if( timeunit = Translations::MP_GlobalParameters_Quarter() ) | 
|     { | 
|       level := 5; | 
|     } | 
|     // Year | 
|     else if( timeunit = Translations::MP_GlobalParameters_Year() ) | 
|     { | 
|       level := 6; | 
|     } | 
|      | 
|     return level; | 
|   *] | 
| } |