Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CanClosePermanent ( 
 | 
  output String feedback_o, 
 | 
  Number nrofopenunit, 
 | 
  Number input_openunit, 
 | 
  Number nroftemporarilyclosedunit, 
 | 
  Number input_temporarilyclosedunit 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  Description: 'Used in the designer' 
 | 
  TextBody: 
 | 
  [* 
 | 
    feedback_o := ''; 
 | 
     
 | 
    // Nr of open unit = 0 and Nr of temporarily close unit = 0 
 | 
    if( nrofopenunit = 0 and nroftemporarilyclosedunit = 0 ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_UnitPeriod_CanClosePermanent_NoClosedUnit(); 
 | 
    } 
 | 
    // Inputs open unit greater than nr of open unit 
 | 
    else if( input_openunit > nrofopenunit ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_UnitPeriod_CanClosePermanent_NoAvailableUnit( nrofopenunit, nroftemporarilyclosedunit ); 
 | 
    } 
 | 
    // Inputs temp close unit greater than nr og temp close unit 
 | 
    else if( input_temporarilyclosedunit > nroftemporarilyclosedunit ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_UnitPeriod_CanClosePermanent_NoAvailableUnit( nrofopenunit, nroftemporarilyclosedunit ); 
 | 
    } 
 | 
    // Inputs open unit = 0 and inputs temp close unit = 0 
 | 
    else if( input_openunit = 0 and input_temporarilyclosedunit = 0 ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_UnitPeriod_CanClosePermanent_UnitEmpty(); 
 | 
    } 
 | 
    // Input open unit lesser 0 OR input temp close unit lesser than 0 
 | 
    else if( input_openunit < 0 or input_temporarilyclosedunit < 0 ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_UnitPeriod_CanClosePermanent_IsNegativeValue(); 
 | 
    } 
 | 
    return feedback_o = ''; 
 | 
  *] 
 | 
} 
 |