Quintiq file version 2.0
#parent: #root
StaticMethod GetProcessQuantity (
Period_MP period,
Operations operations,
ProductInStockingPoint_MPs pisps,
Boolean isdependentdemand,
output String tooltip
) declarative remote as Real
{
Description: 'Return quantities of operations to pisps in a period or pisp to operations in a period'
TextBody:
[*
value := 0.0;
// Insert table tag for tooltip
// Routing step name
routingstep := select( operations, Elements.RoutingStep, rs, true );
tooltip := "
";
tooltip := tooltip + 'Routing step: | '
+ routingstep.Name() + ' |
';
// Routing name
tooltip := tooltip + 'Routing: | '
+ routingstep.Routing().Name() + ' |
';
// Period
tooltip := tooltip + 'Period: | '
+ period.StartDate().Format( 'D-MM-Y' ) + ' until ' + period.EndDate().Format( 'D-MM-Y' ) + ' |
';
// A separating line
tooltip := tooltip + '
';
// Units and products headers
tooltip := tooltip + 'Unit: | '
+ select( operations, Elements.OperationOutput, e, true ).ProductInStockingPoint_MP().Product_MP().Name() + ' quantity: |
';
if( isdependentdemand )
{
traverse( operations, Elements.PeriodTask_MP.DependentDemand, dd,
exists( pisps, Elements, e, e = dd.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP() )
and dd.Start() >= period.Start()
and dd.End() <= period.End() )
{
value := value + dd.Quantity();
tooltip := tooltip + '' + dd.PeriodTask_MP().Process_MP().Name() + ' | '
+ dd.Quantity().AsQUILL() + ' |
';
}
}
else
{
traverse( operations, Elements.PeriodTask_MP.NewSupply, ns,
exists( pisps, Elements, e, e = ns.ProductInStockingPointInPeriodPlanningLeaf().ProductInStockingPoint_MP() )
and ns.Start() >= period.Start()
and ns.End() <= period.End() )
{
value := value + ns.Quantity();
tooltip := tooltip + '' + ns.PeriodTask_MP().Process_MP().Name() + ' | '
+ ns.Quantity().AsQUILL() + ' |
';
}
}
// Sum for multi operation routing step
if( operations.Size() > 1 )
{
tooltip := tooltip + 'All | ' + value.AsQUILL() + ' |
';
}
return value;
*]
}