K3 批量更新BOM用量的

不解釋(不懂解釋了也沒有用),看懂後再動手……


將部分BOM的原料從'01.0050.0011升級爲'01.0050.0014,單位用量由以前的降低25%


update b set b.FItemID=(select FItemID from t_ICItem where t_ICItem.fnumber='01.0050.0014'),b.FQty=ROUND(b.FQty*(100-25)/100,(select FQtyDecimal from t_ICItem where t_ICItem.fnumber='01.0050.0014'))
--,b.FAuxQty=b.fqty  
from ICBOM a ,ICBOMCHILD  b,t_ICItem c,t_ICItem d
where a.finterid=b.finterid
and a.fitemid=c.FItemID
and b.fitemid=d.FItemID
and a.FUseStatus=1072
and d.fnumber in 
('01.0050.0011')
and c.fnumber in 
(
'1-00268-2001-00-00',
'1-00888-2001-02-00',
'1-01588-2001-01-00',
'1-01598-2001-01-00',
'1-01608-2001-01-00',
'1-03010-2001-01-00',
'1-03011-2001-00-00',
'1-03011-2001-01-00',
'1-03011-2002-00-00',
'1-03011-2003-01-00',
'1-03011-2004-01-00',
'1-04258-2001-01-00',

'1-04258-2002-01-00'

)

/*
select * from t_BillLockTable
select * from ICBOMCHILD b where b.FAuxQty<>b.fqty
select * from ICBOMCHILD b where b.FAuxQty>=0
go
update b set b.FAuxQty=b.fqty from ICBOMCHILD b where b.FAuxQty<>b.fqty
*/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章