public void registerTransaction(SalesLine salesLine)
{
InventTrans inventTrans,inventTransIdReturn;
InventDim inventDim,_inventDim;
InventTransWMS_Register inventTransWMS_register;
TmpInventTransWMS tmpInventTransWMS;
InventTransOrigin inventTransOrigin;
inventTrans = InventTrans::findTransId(salesLine.InventTransId);
if(inventTrans && inventTrans.StatusReceipt != StatusReceipt::Registered)
{
inventDim = inventTrans.inventDim();
inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
while select inventTransIdReturn
join inventTransOrigin
where inventTransOrigin.InventTransId == salesLine.InventTransIdReturn
&& inventTransIdReturn.InventTransOrigin == inventTransOrigin.RecId
&& inventTransIdReturn.DataAreaId == inventTransOrigin.DataAreaId
join _inventDim
where _inventDim.inventDimId == inventTransIdReturn.inventDimId
&& inventTransIdReturn.DataAreaId == _inventDim.DataAreaId
&& inventTransIdReturn.DataAreaId ==curExt()
{
tmpInventTransWMS.clear();
tmpInventTransWMS.initFromInventTrans(inventTrans);
if(_inventDim.inventSerialId)
{
tmpInventTransWMS.InventQty = 1;
inventDim.inventSerialId= InventDim::find(inventTransIdReturn.InventDimId).inventSerialId;
inventDim.wmsLocationId = InventLocation::find(_inventDim.inventLocationId).RetailWMSLocationIdDefaultReturn;
}
tmpInventTransWMS.InventDimId = inventDim::findOrCreate(inventDim).inventDimId;
tmpInventTransWMS.insert();
}
inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS,
inventTrans,
inventTrans.inventDim());
inventTransWMS_register.updateInvent(inventTrans);
}
}
=============================================================
dev sample:
inventTrans,
inventTrans.inventDim());
inventTrans,
inventTrans.inventDim());
留言列表