Compartir a través de


TmpInventTransMark::inventTransUnmarkTmp Method

Selects transactions to be unmarked.

Syntax

server public static InventTrans inventTransUnmarkTmp(
    InventTransOriginId _inventTransOriginId, 
    InventDim _inventDimCriteria, 
    InventQty _qty, 
    TmpInventTransMark _tmpInventTransMark, 
    Integer _loop)

Run On

Server

Parameters

  • _inventDimCriteria
    Type: InventDim Table
    A parameter that is used as the selection criteria when the _loop parameter is not zero.
  • _qty
    Type: InventQty Extended Data Type
    The quantity of the transaction in which the sign of the quantity indicates whether the selection is performed for a receipt or an issue.
  • _loop
    Type: Integer Extended Data Type
    The number of attempts to select the transactions. Usually at the start it is set to zero. If the quantity of selected transactions is not enough to be unmarked, the value can be increased and this method is called again.

Return Value

Type: InventTrans Table
The InventTrans transactions referred to the _inventTransOriginId parameter value.

Remarks

As the transactions are always unmarked in both directions (Issue<->Receipt), there is another method, the TmpInventTransMark method, which retrieves transactions referred to the _tmpInventTransMark.InventTransOrigin parameter value.

Examples

server static void unmarkTransactions(
                                InventTransOriginId _inventTransOriginId, 
                                InventDim _inventDimCriteria, 
                                InventQty _qty, 
                                tmpInventTransMark _tmpInventTransMark) 
{ 
    Integer loop = 0; 
    InventQty qtyRemain; 
    InventTrans inventTrans; 
    InventTrans inventTransTmp; 
    ; 
 
    // The quantity to be unmarked 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
 
    while (loop < 2) 
    { 
        // Select transactions to be unmarked. 
        inventTrans = TmpInventTransMark::inventTransUnmark(
                                      _inventTransOriginId, 
                                      _inventDimCriteria, 
                                      _qty, 
                                      _tmpInventTransMark, 
                                      loop); 
        while (inventTrans.recId) 
        { 
            //Unmark the transactions. 
            qtyRemain -= abs(inventTrans.financialOpenQty()); 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTrans; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
        loop++; 
    } 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
    loop = 0; 
 
    while (loop < 2) 
    { 
        // Select transactions to be unmarked. 
        inventTransTmp = TmpInventTransMark::inventTransUnmarkTmp(_inventTransOriginId, 
                                         _inventDimCriteria, 
                                         _qty, 
                                         _tmpInventTransMark, 
                                         loop); 
        while (inventTransTmp.recId) 
        { 
            //Unmark transactions. 
 
            qtyRemain -= abs(inventTransTmp.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTransTmp; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
 
        loop++; 
    } 
} 

See Also

Reference

TmpInventTransMark Table