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; } |