protected override decimal GetReqQty(ItemFlow itemFlow)
{
string item = itemFlow.Item;
DateTime? winTime = itemFlow.Flow.WindowTime;
decimal maxInv = itemFlow.MaxInv;
decimal safeInv = itemFlow.SafeInv;
#region Demand
OrderTracer demand = this.GetDemand_OrderTracer(itemFlow);
itemFlow.AddOrderTracer(demand);
#endregion
foreach (var loc in itemFlow.DemandSources)
{
#region OnhandInv
OrderTracer onhandInv = this.GetOnhandInv_OrderTracer(loc, item);
itemFlow.AddOrderTracer(onhandInv);
#endregion
#region InspectInv
OrderTracer inspectInv = this.GetInspectInv_OrderTracer(loc, item);
itemFlow.AddOrderTracer(inspectInv);
#endregion
#region OrderRct
var orderRcts = this.GetOrderRct(loc, item, null, winTime);
itemFlow.AddOrderTracer(orderRcts);
#endregion
}
decimal reqQty = 0;
bool isReq = this.CheckReq(itemFlow);
if (isReq)
{
demand.Qty = maxInv;//Actual demand
reqQty = this.GetReqQty(itemFlow.OrderTracers);
}
return reqQty;
}