InventTransferMultiShip inventTransferMultiShip; inventTransferMultiReceive inventTransferMultiReceive; InventTransferMultiPick InventTransferMultiPick; parmId parmId; List list = new List(Types::String); WMSPickingRoute localWMSPickingRoute; numberSequenceReference numberSequenceReference; NumberSeq numberSeq; InventTransferTable inventTransferTable; InventTransferLine inventTransferLine; InventDim inventDim; Num num; inventTransferParmUpdate inventTransferParmUpdate; inventTransferParmTable inventTransferParmTable; ; inventTransferTable.clear(); inventTransferTable.initValue(); ttsBegin; numberSeq = NumberSeq::newGetNum(InventParameters::numRefTransferId()); num = numberSeq.num(); ttsCommit; inventTransferTable.TransferId = num; inventTransferTable.InventLocationIdFrom = "AUSTIN"; inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdFrom)); inventTransferTable.InventLocationIdTo = "CINCINN"; inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdTo)); inventTransferTable.TransferStatus = InventTransferStatus::Created; //inventTransferTable.lin = 1; inventTransferTable.insert(); inventTransferLine.clear(); inventTransferLine.initFromInventTransferTable(inventTransferTable, NoYes::Yes); inventTransferLine.ItemId = "0001"; inventDim.inventSiteId = "CENTRAL"; inventDim.InventLocationId = "AUSTIN"; inventDim = inventDim::findOrCreate(inventDim); inventTransferLine.initFromInventTable(InventTable::find("0001")); inventTransferLine.InventDimId = inventDim.inventDimId; inventTransferLine.QtyTransfer = 2; inventTransferLine.QtyShipNow = 2; inventTransferLine.QtyReceiveNow = 2; inventTransferLine.QtyRemainShip = 2; inventTransferLine.QtyRemainReceive = 2; inventTransferLine.insert(); //Update transfer order as shipped //Generate ParmId parmId = RunBaseMultiParm::getSysParmId(); //inventTransferMultiShip inventTransferParmUpdate.ParmId = parmId; inventTransferParmUpdate.insert(); inventTransferParmTable.initValue(); inventTransferParmTable.ParmId = parmId; inventTransferParmTable.TransferId = inventTransferTable.TransferId; inventTransferParmTable.PickUpdateQty = InventTransferPickUpdateQty::All; inventTransferParmTable.EditLines = NoYes::Yes; inventTransferParmTable.AutoReceiveQty = NoYes::No; inventTransferParmTable.TransDate = systemDateGet(); inventTransferParmTable.UpdateType = InventTransferUpdateType::PickingList; inventTransferParmTable.insert(); InventTransferMultiPick = new InventTransferMultiPick(); InventTransferMultiPick.runUpdate(inventTransferParmTable); //Picking list registration select localWMSPickingRoute where localWMSPickingRoute.transRefId == inventTransferTable.TransferId; list.addEnd(localWMSPickingRoute.PickingRouteID); WMSPickingRoute::finishMulti(list.pack());//Note - this is not in a single tts, so some routes might be posted and others fail wmsDeliverPickedItems::checkDeliverPickedItems(localWMSPickingRoute.PickingRouteID,list.pack()); //Update transfer order as shipped //Generate ParmId parmId = RunBaseMultiParm::getSysParmId(); //inventTransferMultiShip inventTransferParmUpdate.ParmId = parmId; inventTransferParmUpdate.insert(); inventTransferParmTable.clear(); inventTransferParmTable.initValue(); inventTransferParmTable.ParmId = parmId; inventTransferParmTable.TransferId = inventTransferTable.TransferId; inventTransferParmTable.ShipUpdateQty = InventTransferShipUpdateQty::All; inventTransferParmTable.EditLines = NoYes::Yes; inventTransferParmTable.AutoReceiveQty = NoYes::No; inventTransferParmTable.TransDate = systemDateGet(); inventTransferParmTable.UpdateType = InventTransferUpdateType::Shipment; inventTransferParmTable.insert(); inventTransferMultiShip = new inventTransferMultiShip(); inventTransferMultiShip.runUpdate(inventTransferParmTable); //Update transfer order as received //Generate ParmId parmId = RunBaseMultiParm::getSysParmId(); inventTransferParmUpdate.ParmId = parmId; inventTransferParmUpdate.insert(); inventTransferParmTable.clear(); inventTransferParmTable.initValue(); inventTransferParmTable.ParmId = parmId; inventTransferParmTable.TransferId = inventTransferTable.TransferId; inventTransferParmTable.ReceiveUpdateQty = InventTransferReceiveUpdateQty::All; inventTransferParmTable.EditLines = NoYes::Yes; inventTransferParmTable.AutoReceiveQty = NoYes::No; inventTransferParmTable.TransDate = systemDateGet(); inventTransferParmTable.UpdateType = InventTransferUpdateType::Receive; inventTransferParmTable.insert(); inventTransferMultiReceive = new inventTransferMultiReceive(); inventTransferMultiReceive.runUpdate(inventTransferParmTable);
Wednesday, October 28, 2015
The code below can be used to create a new transfer order which is the picked, registered, shipped and received
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment