Hi
The below code will be helpful to register the batch number during sales return order packing slip posting
public void registerInventory(RefRecId _recId, InventQty _qty, InventBatchId _batchId)
{
InventTransWMS_Register inventTransWMS_register;
TmpInventTransWMS tmpInventTransWMS;
InventDim inventDim;
SalesLine salesLine;
InventTrans inventTranslocal
inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
salesLine = CustConfirmTrans::findRecId(_custConfirmTransRecId).salesLine();
inventDim = salesLine.inventDim();
inventTranslocal = InventTrans::findTransId(salesLine.InventTransId, true);
inventDim.inventBatchId = _inventBatchId;
inventDim = inventDim::findOrCreate(inventDim);
inventTranslocal.inventDimId = inventDim.inventDimId;
tmpInventTransWMS.clear();
tmpInventTransWMS.initFromInventTrans(inventTranslocal);
tmpInventTransWMS.ItemId = inventTranslocal.ItemId;
tmpInventTransWMS.InventQty = _qty;
tmpInventTransWMS.insert();
inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS,
inventTranslocal,
inventDim);
inventTransWMS_register.updateInvent(inventTranslocal);
}
The below code will be helpful to register the batch number during sales return order packing slip posting
public void registerInventory(RefRecId _recId, InventQty _qty, InventBatchId _batchId)
{
InventTransWMS_Register inventTransWMS_register;
TmpInventTransWMS tmpInventTransWMS;
InventDim inventDim;
SalesLine salesLine;
InventTrans inventTranslocal
inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
salesLine = CustConfirmTrans::findRecId(_custConfirmTransRecId).salesLine();
inventDim = salesLine.inventDim();
inventTranslocal = InventTrans::findTransId(salesLine.InventTransId, true);
inventDim.inventBatchId = _inventBatchId;
inventDim = inventDim::findOrCreate(inventDim);
inventTranslocal.inventDimId = inventDim.inventDimId;
tmpInventTransWMS.clear();
tmpInventTransWMS.initFromInventTrans(inventTranslocal);
tmpInventTransWMS.ItemId = inventTranslocal.ItemId;
tmpInventTransWMS.InventQty = _qty;
tmpInventTransWMS.insert();
inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS,
inventTranslocal,
inventDim);
inventTransWMS_register.updateInvent(inventTranslocal);
}
No comments:
Post a Comment