表InventTableModule新增方法:
public UnitIDBase TEK_GetUnitByItemid(String15 d_itemid) { InventTableModule d_inventTableModule; select firstOnly d_inventTableModule where d_inventTableModule.itemid == d_itemid; //info(d_inventTableModule.UnitId); return d_inventTableModule.UnitId; }
SQL获取所有单位:
select e.displayproductnumber,e.searchname, -- e.producttype,e.recid,u.fromunitofmeasure,u.tounitofmeasure, '1', (SELECT TOP 1 symbol FROM unitofmeasure WHERE recid = u.FromUnitOfMeasure) as Fromunit, ' = ' as '=', u.factor, (SELECT TOP 1 symbol FROM unitofmeasure WHERE recid = u.ToUnitOfMeasure) as Tounit, e.modifiedby FROM EcoResProduct e LEFT JOIN unitofmeasureconversion u ON u.product = e.recid -- LEFT JOIN unitofmeasure as um -- ON um.recid = u.fromunitofmeasure
单位转换请看:http://maryd.cn/?id=45
留言评论
暂无留言