查询库存时点现有量 Function
Posted xtwkh1973
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了查询库存时点现有量 Function相关的知识,希望对你有一定的参考价值。
static qty availQty(ItemId itemId,
InventLocationId locationId = "",
wmsLocationid wmsLocationId = "",
InventBatchId batchId = "",
InventSerialId serialId = "",
TransDate pointDate = systemDateGet())
Query _Query;
QueryRun _QueryRun;
InventSum _inventsum;
InventDim _InventDim;
inventDim inventDimCriteria;
inventdimparm inventDimparmCriteria;
inventDimParm inventDimparmGroupby;
InventSumDatePhysicalDim inventSumDateDim;
Qty availQty ;
;
inventDimCriteria.clear();
if (locationId)
inventDimCriteria.InventLocationId = locationId;
if (wmsLocationid)
inventDimCriteria.wMSLocationId = wmsLocationid;
if (batchId)
inventDimCriteria.inventBatchId = batchId;
if (serialId)
inventDimCriteria.inventSerialId = serialId;
inventDimparmCriteria.clear();
inventDimparmCriteria.ItemIdFlag = Noyes::Yes;
if (locationId)
inventDimparmCriteria.InventLocationIdFlag = Noyes::Yes;
if (wmsLocationid)
inventDimParmCriteria.WMSLocationIdFlag = NoYes::Yes;
if (batchId)
inventDimParmCriteria.InventBatchIdFlag = NoYes::Yes;
if (serialId)
inventDimParmCriteria.InventSerialIdFlag = NoYes::Yes;
inventDimparmGroupby.clear();
inventDimparmGroupby.ItemIdFlag = Noyes::Yes;
if (locationId)
inventDimparmGroupby.InventLocationIdFlag = Noyes::Yes;
if (wmsLocationid)
inventDimparmGroupby.WMSLocationIdFlag = NoYes::Yes;
if (batchId)
inventDimparmGroupby.InventBatchIdFlag = NoYes::Yes;
if (serialId)
inventDimparmGroupby.InventSerialIdFlag = NoYes::Yes;
_Query = new Query();
Inventsum::newQuery(_Query,itemId,inventDimCriteria,inventDimparmCriteria,inventDimparmGroupby);
_queryRun = new QueryRun(_query);
while(_queryrun.next())
_inventsum = _Queryrun.get(tablenum(InventSum));
_inventDim = _QueryRun.get(tablenum(InventDim));
inventSumDateDim = InventSumDatePhysicalDim::newParameters(pointDate,_InventSum.ItemId,_inventdim,inventDimparmCriteria);
availQty = inventSumDateDim.postedQty() + inventSumDateDim.receivedQty() -
InventSumDateDim.deductedQty() + InventSumDateDim.registeredQty() - InventSumDateDim.pickedQty();
return availQty;
以上是关于查询库存时点现有量 Function的主要内容,如果未能解决你的问题,请参考以下文章