static void San_MarkInventTrans(InventTransId _inventTransId,InventTransId _refInventTransId,InventQty _qtyTomark)
{
InventTrans issueInventTrans;
TmpInventTransMark tmpInventTransMask;
Map mapMarkNow;
container conget;
real qty;
Map mapMark;
MapEnumerator mapEnumerator;
{
InventTrans issueInventTrans;
TmpInventTransMark tmpInventTransMask;
Map mapMarkNow;
container conget;
real qty;
Map mapMark;
MapEnumerator mapEnumerator;
InventTransOriginId issueInventTransOriginId = InventTransOrigin::findByInventTransId(_inventTransId).RecId;
InventTransOriginId receiptInventTransOriginId = InventTransOrigin::findByInventTransId(_refInventTransId).RecId;
InventTransOriginId receiptInventTransOriginId = InventTransOrigin::findByInventTransId(_refInventTransId).RecId;
InventQty qtyToMark = _qtyTomark;
ttsBegin;
issueInventTrans = InventTrans::findByInventTransOrigin(issueInventTransOriginId);
issueInventTrans = InventTrans::findByInventTransOrigin(issueInventTransOriginId);
[conget, qty] = TmpInventTransMark::packTmpMark(
InventTransOrigin::find(issueInventTransOriginId),
issueInventTrans.inventDim(),
issueInventTrans.Qty);
InventTransOrigin::find(issueInventTransOriginId),
issueInventTrans.inventDim(),
issueInventTrans.Qty);
mapMark = Map::create(conget);
mapEnumerator = mapMark.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);
mapEnumerator = mapMark.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());
}
}
ttsCommit;
}
issueInventTransOriginId,
issueInventTrans.inventDim(),
-qtyToMark,
mapMarkNow.pack());
}
}
ttsCommit;
}
No comments:
Post a Comment