Quintiq file version 2.0
|
#parent: #root
|
StaticMethod ValidateInput (
|
output String feedback_o,
|
output String sanitycheckfeedback_o,
|
Real minquantity,
|
Real maxquantity,
|
Real defaultquantity,
|
OperationInput operationinput
|
) declarative remote as Boolean
|
{
|
Description: 'Validate input for factor'
|
TextBody:
|
[*
|
feedback_o := '';
|
sanitycheckfeedback_o := '';
|
|
// call validate input of base class on top, instead of at the end of the if stmt
|
// so that feedback_o is not re-set to empty string.
|
OperationInputOutput::ValidateInput( feedback_o, sanitycheckfeedback_o, defaultquantity, operationinput );
|
|
if( operationinput.IsElementOfInputGroup() )
|
{
|
// check min qty if its input
|
if( minquantity < 0 )
|
{
|
feedback_o := Translations::MP_OperationInputOutput_ValidateInput_IsNegativeMinQuantity( minquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// check max qty if its input
|
else if( maxquantity < 0 )
|
{
|
feedback_o := Translations::MP_OperationInputOutput_ValidateInput_IsNegativeMaxQuantity( maxquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// check min and max if its input with range
|
else if( minquantity > maxquantity )
|
{
|
feedback_o := Translations::MP_OperationInputOutput_ValidateInput_IsMaxQtyLessThanMinQty( maxquantity, minquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
// check min and max if its input with range
|
else if( defaultquantity > maxquantity or defaultquantity < minquantity )
|
{
|
feedback_o := Translations::MP_OperationInputOutput_ValidateInput_IsQuantityOutOfBounds( defaultquantity, minquantity, maxquantity );
|
sanitycheckfeedback_o := SanityCheckCategoryLevel::GetSanityCheckCategoryDataIssue();
|
}
|
}
|
|
return feedback_o = '';
|
*]
|
}
|