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
Quintiq file version 2.0
#parent: #root
Method GetHasValidOperationInputOutputQuantity (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  Description: 'check if operation input and output quantity diff factor is okay.'
  TextBody:
  [*
    // desmondt Nov-12-2014 (created)
    valid := this.GetHasValidOperationInputOutputQuantity();
    factorlimit := this.MacroPlan().GlobalParameters_MP().DifferenceFactor1e3();
    
    if( not isnull( feedback_o ) and not valid )
    {
      // format because translations do not support representations yet
      formatfactorlimit := factorlimit.Format( "N(Dec(0), Thousands)" );
      formatinputqty := this.InputQuantity().Format( "N(Dec(0), Thousands)" );
      formatoutputqty := this.OutputQuantity().Format( "N(Dec(0), Thousands)" );
      name := MacroPlan::GetSubstituteName( this.Name() );
      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( Translations::MP_Process_Instance( this.DefinitionName(), name ),
                                                               Translations::MP_Operation_ViolateHasValidOperationInputOutputQuantityRange( formatfactorlimit,
                                                                                                                                            formatinputqty,
                                                                                                                                            formatoutputqty )
                                                                                                                                           )
                                                             );
      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue() );                                                         
    }
    
    return valid;
  *]
}