InventTrans issueInventTrans;
TmpInventTransMark tmpInventTransMask;
Map mapMarkNow;
container con;
real qty;
Map mapTmp;
MapEnumerator mapEnumerator;
InventTransOriginId issueInventTransOriginId =
InventTransOrigin::findByInventTransId('Issue lot ID').RecId;
InventTransOriginId receiptInventTransOriginId =
InventTransOrigin::findByInventTransId('Receipt lot ID').RecId;
InventQty qtyToMark = 11;
ttsBegin;
issueInventTrans = InventTrans::findByInventTransOrigin(
issueInventTransOriginId);
[con, qty] = TmpInventTransMark::packTmpMark(
InventTransOrigin::find(issueInventTransOriginId),
issueInventTrans.inventDim(),
issueInventTrans.Qty);
mapTmp = Map::create(con);
mapEnumerator = mapTmp.getEnumerator();
while (mapEnumerator.moveNext())
{
tmpInventTransMask = mapEnumerator.currentValue();
if (tmpInventTransMask.InventTransOrigin == receiptInventTransOriginId)
{
tmpInventTransMask.QtyMarkNow = qtyToMark;
tmpInventTransMask.QtyRemain -= tmpInventTransMask.QtyMarkNow;
mapMarkNow = new Map(Types::Int64, Types::Record);
mapMarkNow.insert(tmpInventTransMask.RecId, tmpInventTransMask);
TmpInventTransMark::updateTmpMark(
issueInventTransOriginId,
issueInventTrans.inventDim(),
-qtyToMark,
mapMarkNow.pack());
break;
}
}
ttsCommit;
Nessun commento:
Posta un commento