Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CanEnterSupplyQuantity (
|
output String feedback_o,
|
ProductInStockingPointInPeriods pispips,
|
Strings attributenames,
|
output Boolean isSupply_o
|
) declarative remote as Boolean
|
{
|
Description: 'Used to verify that user can specify supply quantity on a product planning matrix cell.'
|
TextBody:
|
[*
|
// Check 3 conditions:
|
// 1 - whether the pispips are of planning periods
|
// 2 - whether the selected attribute can be edited
|
// 3 - whether the params and profiles are there
|
feedback_o := '';
|
// These are the editable attributes
|
supplyQty := attribute( ProductInStockingPointInPeriod, DisplaySupplyQuantity ).Name();
|
|
uniqueattributes := attributenames.Unique();
|
isEditSupply := uniqueattributes.Element( 0 ) = supplyQty;
|
|
if( uniqueattributes.Size() > 1 )
|
{
|
feedback_o := Translations::MP_ProductInStockingPointInPeriod_CanOnlyEditOneAttribute();
|
}
|
// Not allowed to batch edit total supplies
|
else if( isEditSupply
|
and attributenames.Size() > 1 )
|
{
|
feedback_o := Translations::MP_ProductInStockingPointInPeriod_CanOnlyEditOneTotalSupply();
|
}
|
else if( not forall( uniqueattributes, Elements, e,
|
e = supplyQty ) )
|
{
|
feedback_o := Translations::MP_ProductInStockingPointInPeriod_CanEditValuesFromMatrix();
|
}
|
else if( not forall( pispips, Elements.Period_MP, period, period.IsPlanning() ) )
|
{
|
feedback_o := Translations::MP_Period_CannotPlanSupply();
|
}
|
else
|
{
|
isSupply_o := isEditSupply;
|
}
|
|
return feedback_o = '';
|
*]
|
}
|