14.02.2024, 19:11 | #1 |
Участник
|
a33ik: UnitOfMeasureConverter::convert() method is depreciated
Источник: http://daxonline.org/1940-unitofmeas...preciated.html
============== Message: BP Rule: [BPDeprecatedUOMProductParameter]:BPDeprecatedUOMProductParameter: The product parameter in UnitOfMeasureConverter class method 'convert' is deprecated, use the EcoResProductUnitConverter class instead. Original deprecated code: salesLine.SalesDeliverNow = UnitOfMeasureConverter::convert( salesLine.InventDeliverNow, UnitOfMeasure::unitOfMeasureIdBySymbol(salesLine.inventTable().inventUnitId()), UnitOfMeasure::unitOfMeasureIdBySymbol(salesLine.SalesUnit), NoYes::Yes, InventTable::itemProduct(salesLine.ItemId)); Used to convert quantity from invent to sales. Replacement using EcoResProductUnitConverter class: salesLine.SalesDeliverNow = EcoResProductUnitConverter::convertGivenUnitSymbolsForReleasedProduct( salesLine.ItemId, salesLine.InventDimId, salesLine.InventDeliverNow, salesLine.inventTable().inventUnitId(), salesLine.SalesUnit, NoYes::Yes); Reference: smmSalesCustItemStatisticsDP.unitConvertValue() class: public Qty unitConvertValue( ItemId _itemId, InventDimId _inventDimId, ModuleInventPurchSales _module, UnitOfMeasureSymbol _unitFrom, Qty _value = 1) { UnitOfMeasureSymbol unitTo = InventTableModule::find(_itemId, _module).UnitId; if (_unitFrom != unitTo) { UnitOfMeasureSymbol unitInvent = InventTableModule::find(_itemId, ModuleInventPurchSales::Invent).UnitId; EcoResProductUnitConverter productUnitConverter = EcoResProductUnitConverter::newGivenUnitSymbolsForReleasedProduct( _itemId, _inventDimId, _unitFrom, unitInvent, NoYes::Yes); InventQty inventQty = productUnitConverter.convertValue(_value); productUnitConverter.parmFromUnitOfMeasureSymbol(unitInvent); productUnitConverter.parmToUnitOfMeasureSymbol(unitTo); return productUnitConverter.convertValue(inventQty); } return _value; } Источник: http://daxonline.org/1940-unitofmeas...preciated.html |
|
|
|