chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
Quintiq file version 2.0
#parent: #root
Method GetHasValidQuantityToProcess (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  Description: 'check if have valid qty to process'
  TextBody:
  [*
    feedback := '';
    sanitycheckfeedback := '';
    
    if( this.QuantityToProcess() = 0 )
    {
      io := Translations::MP_GlobalParameters_InputString();
    
      if( this.Unit().QuantityToProcess() = GlobalParameters_MP::GetQTProcessOut() )
      {
        io := Translations::MP_GlobalParameters_OutputString();
      }
      feedback := Translations::MP_Operation_ViolateHasValidQuantityToProcess_ZeroQuantity( io, this.QuantityToProcess() );
      sanitycheckfeedback := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
    }
    
    if( not isnull( feedback_o ) and feedback <> '' )
    {
      // Just incase if the name is empty or too long
      name := MacroPlan::GetSubstituteName( this.Name() );
      instance := Translations::MP_Process_Instance( this.DefinitionName(), name );
    
      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( instance, feedback ) );
      sanitycheckfeedback_o.Add( sanitycheckfeedback );
    }
    
    return feedback = '';
  *]
}