Hello Experts,
In RDP some piece of code are given here:
where salesLine.ItemId == queryInventTable.ItemId &&
{
avgAnnualSales += salesLine.QtyOrdered ;
}
if(avgAnnualSales > 0)
avgAnnualSales = avgAnnualSales/12;
else
avgAnnualSales = 0;
if(tReOrderReportTmp.CurrentStock > 0 && tReOrderReportTmp.AnnualAvgSalesQty > 0)
tReOrderReportTmp.MonthCoverSales = tReOrderReportTmp.CurrentStock / tReOrderReportTmp.AnnualAvgSalesQty;
else
tReOrderReportTmp.MonthCoverSales = 0;
tReOrderReportTmp.MinStockQty = (tReOrderReportTmp.AnnualAvgSalesQty/30) * tReOrderReportTmp.LeadTime ;
tReOrderReportTmp.insert();
where salesLine.ItemId == queryInventTable.ItemId &&
{
avgAnnualSales += salesLine.QtyOrdered ;
}
if(avgAnnualSales > 0)
avgAnnualSales = avgAnnualSales/12;
else
avgAnnualSales = 0;
// Added Codes Start
while select inventTrans
join salesLine where inventTrans.ItemId == salesLine.ItemId && salesLine.createdDateTime >= DateTimeUtil::addMonths(DateTimeUtil::utcNow(), -12)
join queryInventTable where inventTrans.ItemId == queryInventTable.ItemId
join inventTransOrigin where inventTrans.ItemId == inventTransOrigin.ItemId && inventTrans.InventTransOrigin==inventTransOrigin.RecId && inventTransOrigin.ReferenceCategory == InventTransType::BOMLine
tReOrderReportTmp.BOMQty = BOMQty1;
//Added Codes End
if(tReOrderReportTmp.CurrentStock > 0 && tReOrderReportTmp.AnnualAvgSalesQty > 0)
tReOrderReportTmp.MonthCoverSales = tReOrderReportTmp.CurrentStock / tReOrderReportTmp.AnnualAvgSalesQty;
else
tReOrderReportTmp.MonthCoverSales = 0;
tReOrderReportTmp.MinStockQty = (tReOrderReportTmp.AnnualAvgSalesQty/30) * tReOrderReportTmp.LeadTime ;
tReOrderReportTmp.insert();
*This post is locked for comments