Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CanAdjustQuantity ( 
 | 
  SalesDemandBases salesDemands, 
 | 
  String adjustType, 
 | 
  Real value, 
 | 
  output String feedback_o 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Indicate if sales demands quantity can be adjusted base on the adjust type' 
 | 
  TextBody: 
 | 
  [* 
 | 
     
 | 
    isZeroSet := adjustType = SalesDemandBase::Adjust_Set() and value < 0; 
 | 
    isMultiplyZero := adjustType = SalesDemandBase::Adjust_Multiply() and value < 0; 
 | 
    isAdjustedZero := exists( salesDemands, Elements, e, SalesDemandBase::GetAdjustedQuantity( e.Quantity(), adjustType, value ) < 0 ); 
 | 
     
 | 
    // Check if a quantity is entered 
 | 
    if( value.IsMinInfinity() ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_SalesDemand_AdjustQuantity_IsEmpty(); 
 | 
    } 
 | 
    else if( isZeroSet or isMultiplyZero or isAdjustedZero ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_SalesDemand_CanAdjustQuantity(); 
 | 
    } 
 | 
     
 | 
    return feedback_o = ''; 
 | 
  *] 
 | 
} 
 |