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
Quintiq file version 2.0
#parent: #root
Method GetHasValidPostponementOverMaxPeriod (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  Description: 'Indicate if the postponed sales demand is postponed to a valid period respecting the max postponed period'
  TextBody:
  [*
    value := true;
    message := '';
    
    // If have associated PS, else the 2nd check will be use (only 1 violation show on original sales demand instead of one per postponed sdip)    
    if( not this.GetHasValidPostponementOverMaxPeriod() )
    {
      value := false;
      message := this.GetViolationMessageForInvalidPostponementOverMaxPeriod();
    }
    
    if( not isnull( feedback_o ) 
        and not value )
    { 
      instance := Translations::MP_BaseSalesDemandInPeriod_Instance( this.SalesSegmentName(), this.StartDate() );
      feedback_o.Add( SanityCheckMessage::GetFormattedMessage( instance, message ) );
      sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryPlanningIssue() );
    }
    
    return value;
  *]
}