CREATE TABLE [dbo].[lrr_sts](
	[site_cd] [varchar](4) NOT NULL,
	[lrr_sts_cat_cd] [varchar](20) NOT NULL,
	[lrr_sts_typ_cd] [varchar](25) NOT NULL,
	[lrr_sts_status] [varchar](3) NOT NULL,
	[lrr_sts_desc] [varchar](255) NULL,
	[lrr_sts_disable_flag] [varchar](1) NULL,
	[scn_sts_email_flag] [varchar](1) NULL,
	[audit_user] [varchar](50) NULL,
	[audit_date] [datetime] NOT NULL,
	[column1] [varchar](60) NULL,
	[column2] [varchar](60) NULL,
	[column3] [varchar](60) NULL,
	[column4] [varchar](60) NULL,
	[column5] [varchar](60) NULL,
	[RowID] [numeric](12, 0) IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
GO


DELETE	cf_table
WHERE	table_name = 'lrr_sts'
GO

INSERT	cf_table (	table_name,           
					table_desc,
					custom_report,
					audit_user,
					audit_date )
VALUES (			'lrr_sts',
					'Linen Extra Request Status Record',
					'0',
					'admin',
					GETDATE())
GO

DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_cat_cd'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_cat_cd', 
		'Category:', 
		'Category:', 
		'Category', 
		'Category', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_typ_cd'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_typ_cd', 
		'Type:', 
		'Type:', 
		'Type', 
		'Type', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO

DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_status'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_status', 
		'Status:', 
		'Status:', 
		'Status', 
		'Status', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO



DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_desc'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_desc', 
		'Description:', 
		'Description:', 
		'Description', 
		'Description', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_disable_flag'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_disable_flag', 
		'Disable?:', 
		'Disable?:', 
		'Disable?', 
		'Disable?', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


DELETE	cf_label
WHERE	table_name = 'lrr_sts'
AND 	column_name = 'lrr_sts_email_flag'
GO

INSERT 	cf_label (language_cd, table_name, column_name, 
		default_label,
		customize_label, 
		default_header, 
		customize_header, 
		cfr_flag, cf_label_required, audit_user, audit_date ) 
SELECT 	language_cd, 'lrr_sts', 'lrr_sts_email_flag', 
		'Email:', 
		'Email:', 
		'Email', 
		'Email', 
		'0', '0', 'admin', getdate() 
FROM	cf_language 
GO


Insert into sts_cat (site_cd, sts_cat_cat_cd, sts_cat_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'Linen Extra Request Status', 'admin', getdate() From cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'OPEN', 'Open Status', 'admin', getdate() from cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'COMPLETE', 'Complete Status', 'admin', getdate() from cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'CLOSE', 'Close Status', 'admin', getdate() from cf_site
GO

Insert into sts_typ (site_cd, sts_typ_cat_cd, sts_typ_typ_cd, sts_typ_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'CANCEL', 'Cancel Status', 'admin', getdate() from cf_site
GO

Insert into lrr_sts (site_cd, lrr_sts_cat_cd, lrr_sts_typ_cd, lrr_sts_status, lrr_sts_disable_flag, lrr_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'OPEN', 'OPN', '0', 'Open', 'admin',  getdate() from cf_site
GO

Insert into lrr_sts (site_cd, lrr_sts_cat_cd, lrr_sts_typ_cd, lrr_sts_status, lrr_sts_disable_flag, lrr_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'COMPLETE', 'ISU', '0', 'Issue Complete', 'admin',  getdate() from cf_site
GO

Insert into lrr_sts (site_cd, lrr_sts_cat_cd, lrr_sts_typ_cd, lrr_sts_status, lrr_sts_disable_flag, lrr_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'CLOSE', 'CLO', '0', 'Close', 'admin',  getdate() from cf_site
GO

Insert into lrr_sts (site_cd, lrr_sts_cat_cd, lrr_sts_typ_cd, lrr_sts_status, lrr_sts_disable_flag, lrr_sts_desc, audit_user, audit_date)
Select cf_site.site_cd, 'LINEN EXTRA REQUEST', 'CANCEL', 'CNX', '0', 'Cancel', 'admin',  getdate() from cf_site
GO
