static void OnHandOnDate(Args _args)
{
ItemId itemId;
InventDim inventDimCriteria;
InventDimParm inventDimParm;
InventSumDatePhysicalDim inventSumDateDim;
InventTable InventTable;
InventLocation Inventlocation;
ABUSnapshot ABUSnapshot;
InventSiteId inventSiteId;
transDate Dated;
;
while select * from
InventTable
order by itemid
where InventTable.itemid like 'P*'
//where InventTable.itemid == "P000005"
{
Dated = systemDateGet();
while select * from
Inventlocation
order by inventlocationid
//where Inventlocation.InventLocationId == "CNK"
where Inventlocation.WMSLocationIdDefaultReceipt == 'Staging'
{
itemId = InventTable.ItemId;
inventDimCriteria.InventLocationId = Inventlocation.InventLocationId;
inventDimCriteria.InventStatusId = "AVAILABLE";
inventDimParm.initFromInventDim(inventDimCriteria);
//inventSumDateDim = InventSumDatePhysicalDim::newParameters(mkdate(03,06,2022), itemId, inventDimCriteria, inventDimParm);
// Dated
inventSumDateDim = InventSumDatePhysicalDim::newParameters(Dated, itemId, inventDimCriteria, inventDimParm);
info(strfmt("itemid : %1 Phs: %2 Whs : %3",itemId, inventSumDateDim.physicalQuantity(), Inventlocation.InventLocationId));
ttsbegin;
ABUSnapshot.ItemId = itemId;
ABUSnapshot.ProductName = EcoResProduct::find(InventTable.Product).productName();
ABUSnapshot.WHS = Inventlocation.InventLocationId;
ABUSnapshot.Site = InventLocation::find(Inventlocation.InventLocationId).InventSite().SiteId;
ABUSnapshot.Date = Dated;
ABUSnapshot.DataAreaName = curext();
ABUSnapshot.Qty = inventSumDateDim.physicalQuantity();
ABUSnapshot.insert();
ttsCommit;
}
}
}
0 comments:
Post a Comment