增加按料品类别,按销售订单的数量级来设置发料数量级的损耗
原 料品发料数量级损耗维护 表上增加料品类别。修改主键。
if not exists (select * from dbo.syscolumns where id = object_id(N'oscm_wastagecontrol') and OBJECTPROPERTY(id, N'IsUserTable') = 1 and name='part_type') alter table oscm_wastagecontrol add part_type varchar(20) not null default ''
if exists ( select * from sys.foreign_keys where parent_object_id = object_id(N'oscm_wastagecontrol') and name = 'PK_oscm_wastagecontrol') ALTER TABLE [dbo].[oscm_wastagecontrol] DROP CONSTRAINT [PK_oscm_wastagecontrol]
if not exists ( select * from dbo.sysindexes where id = object_id(N'oscm_wastagecontrol') and name = 'PK_oscm_wastagecontrol') ALTER TABLE [dbo].[oscm_wastagecontrol] ADD CONSTRAINT [PK_oscm_wastagecontrol] PRIMARY KEY CLUSTERED ( [r_type] ASC, [part_no] ASC, [part_type] ASC, [end_qty] ASC, [org_no] ASC, [cust_no] ASC ) ON [PRIMARY]