yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: #root
Method GetIsPlannedGreaterThanFeedback (
  output Strings feedback_o,
  output Strings sanitycheckfeedback_o
) declarative remote as Boolean
{
  Description: 'Returns true when planned quantity is larger than or equal to the feedback'
  TextBody:
  [*
    // desmondt Jul-15-2015 (created)
    isvalid := true;
    gp := this.MacroPlan().GlobalParameters_MP();
    
    if( this.FeedbackQuantity() > 0 )
    {
      isvalid := this.Quantity() >= this.FeedbackQuantity()
                 or gp.GetIsBalanceWithinTolerance( this.FeedbackQuantity(), this.Quantity() );
    
      if( not isnull( feedback_o ) and not isvalid )
      {
        productname := this.Product_MP().Name();
        legname := this.Trip().LaneLeg().Name();
        tripdate := this.Trip().Arrival().Date();
        instance := ProductInTrip::GetInstanceText( productname, legname, tripdate );
        message := Translations::MP_ProductInTrip_ViolateIsPlannedGreaterThanFeedback( this, gp.NumberOfDecimals() );
    
        feedback_o.Add( SanityCheckMessage::GetFormattedMessage( instance, message ) );
        sanitycheckfeedback_o.Add( SanityCheckCategoryLevel::GetSanityCheckCategoryPlanningIssue() );
      }
    }
    return isvalid;
  *]
}