Compartir a través de


TmpInventTransMark::inventTransMark Method

Selects transactions that will be marked.

Syntax

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

Run On

Server

Parameters

  • _inventDimCriteria
    Type: InventDim Table
    The _inventDimCriteria parameter 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.
  • _tmpInventTransMark
    Type: TmpInventTransMark Table
    The temporary information about a transaction to be marked against the selected InventTrans table transactions.
  • _loop
    Type: Integer Extended Data Type
    The number of tries to select the transactions. Usually at the start it is set to zero. If the quantity of selected transactions is not enough for the marking, the value can be increased and this method is called again.

Return Value

Type: InventTrans Table
The transactions to be marked against an issue or receipt with the _tmpInventTransMark.InventTransId parameter value.

Remarks

As the marking is always done in both directions (Issue<->Receipt), there is another method, the TmpInventTransMark method, which retrieves transactions to be marked against an issue or a receipt with the _inventTransOriginId parameter value.

Examples

server static void markTransactions(
                                InventTransOriginId _inventTransOriginId, 
                                InventDim _inventDimCriteria, 
                                InventQty _qty, 
                                tmpInventTransMark _tmpInventTransMark) 
{ 
    Integer loop = 0; 
    InventQty qtyRemain; 
    InventTrans inventTrans;    ; 
    InventTrans inventTransTmp; 

 
    // The quantity to be marked 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
 
    while (loop < 4) 
    { 
        // Select transactions to be marked against _tmpInventTransMark 
        inventTrans = TmpInventTransMark::inventTransMark(_inventTransOriginId, 
                                    _inventDimCriteria, 
                                    _qty, 
                                    _tmpInventTransMark, 
                                    loop); 
        while (inventTrans.recId) 
        { 
            qtyRemain -= abs(inventTrans.financialOpenQty()); 
 
            if (! qtyRemain) 
            { 
                break; 
            } 
 
            next inventTrans; 
        } 
 
        if (! qtyRemain) 
        { 
            break; 
        } 
 
        loop++; 
    } 
 
    qtyRemain = abs(_tmpInventTransMark.qtyMarkNow); 
    loop = 0; 
 
    while (loop < 3) 
    { 
    // Select transactions to be marked against _inventTransId 
    inventTransTmp = TmpInventTransMark::inventTransMarkTmp( 
                                       _inventTransOriginId, 
                                       _qty, 
                                       _tmpInventTransMark, 
                                       loop); 
        while (inventTransTmp.recId) 
        { 
            qtyRemain -= abs(inventTrans.financialOpenQty()); 
            if (! qtyRemain) 
            { 
                break; 
            } 
            next inventTransTmp; 
        } 
        if (! qtyRemain) 
        { 
            break; 
        } 
        loop++; 
    } 
}

See Also

Reference

TmpInventTransMark Table