供应地点取料品存储地点

BOM取料品仓库

如果BOM子项上已经有存储地点了且与料品不一样,这个脚本会强制刷成一样的

update A set SupplyWareHouse=C.WareHouse

from cbo_bomcomponent A,cbo_itemmaster B,CBO_InventoryInfo C,Base_Organization D

where A.itemmaster=B.ID and B.ID=C.itemmaster and B.Org=D.ID

and A.IssueStyle=0 and C.WareHouse is not null

and D.Code='10'

只刷料品存储地点非空时,且子项上供应地点为空的记录

update A set SupplyWareHouse=C.WareHouse

from cbo_bomcomponent A,cbo_itemmaster B,CBO_InventoryInfo C,Base_Organization D

where A.itemmaster=B.ID and B.ID=C.itemmaster and B.Org=D.ID

and A.IssueStyle=0 and C.WareHouse is not null and A.SupplyWareHouse is null

and D.Code='10'

生产订单备料取料品仓库

update A set SupplyWh=C.WareHouse

from MO_MOPickList A,cbo_itemmaster B,CBO_InventoryInfo C,Base_Organization D

where A.itemmaster=B.ID and B.ID=C.itemmaster and B.Org=D.ID

and A.IssueStyle=0 and C.WareHouse is not null and A.SupplyWh is null

and D.Code='20'

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容