Monday, 28 September 2020

Get Batch Reserve Quantity with Item Id Unit Conversion

Below code will return batch reserve quantity with item id unit conversion, if you do not need unit conversion simply use without conversion method.

/// <summary>

    /// Get reserve physical Quantity

    /// </summary>

    /// <param name = "_salesLine">Sales line</param>

    /// <returns>Reserve physical Qty</returns>

    public InventQtyReservPhysical getReservedPhysicalQty(SalesLine  _salesLine)

    {

        InventQtyReservPhysical inventQtyReservPhysical;

       

        if(_salesLine!=null)

        {

            InventTable inventTable = InventTable::find(_salesLine.ItemId);

            inventQtyReservPhysical = decRound(UnitOfMeasureConverter::convert(_salesLine.reservedPhysical(),

            UnitOfMeasure::unitOfMeasureIdBySymbol(inventTable.inventUnitId()),

            UnitOfMeasure::unitOfMeasureIdBySymbol(_salesLine.SalesUnit),

            NoYes::No,

            InventTable::itemProduct(inventTable.ItemId),

            NoYes::No), 0);

        }

        return inventQtyReservPhysical;

    }


No comments:

Post a Comment

Getting Started with Claude Code in VS Code: A Step-by-Step Setup Guide

Introduction You can have Claude Code running inside VS Code in about 10 minutes: install one extension, sign in, and run a couple of co...