/*
=======================================================================================
'Nível Classificação.: INFORMAÇÃO RESTRITA
'Versão..............: 2111250942 
'Job.................:  
'Nome................: CTB_APURA_ICMS_ST 
'Objetivo............:  
'Tabelas.............: CTB_APURA_ICMS_ST
'Dt Criação..........: 
'Dt Ult Alteracão....: 25/11/2021
'Alterado por........: Marcos Barros 
'Criado por..........: Shirlene 
'=======================================================================================
FARMAGOI-23644
*/
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES  WHERE TABLE_NAME = N'CTB_APURA_ICMS_ST')
BEGIN
CREATE TABLE CTB_APURA_ICMS_ST(
	CD_EMP							int			NOT NULL,
	CD_FILIAL						int			NOT NULL,
	UF								VARCHAR(2)  NOT NULL,
	MES_APURAC						int			NOT NULL,
	ANO_APURAC						int			NOT NULL,
	VLR_SLD_CREDOR_ANT_ST			money		NOT NULL DEFAULT 0,
	VLR_DEVOL_ST					money		NOT NULL DEFAULT 0,
	VLR_RESSARC_ST					money		NOT NULL DEFAULT 0,
	VLR_OUT_CRED_ST					money		NOT NULL DEFAULT 0,
	VLR_AJ_CRED_ST					money		NOT NULL DEFAULT 0,
	VLR_RETENCAO_ST					money		NOT NULL DEFAULT 0,
	VLR_OUT_DEB_ST					money		NOT NULL DEFAULT 0,
	VLR_AJ_DEB_ST					money		NOT NULL DEFAULT 0,
	VLR_SLD_DEV_ANT_ST				money		NOT NULL DEFAULT 0,
	VLR_DEDUCOES_ST					money		NOT NULL DEFAULT 0,
	VLR_ICMS_RECOL_ST				money		NOT NULL DEFAULT 0,
	VLR_SLD_CRED_ST_TRANSPORTAR		money		NOT NULL DEFAULT 0,
	DEB_ESP_ST						money		NOT NULL DEFAULT 0,
	DT_CAD							datetime	NULL,
	CD_USU							int			NULL,
	DT_ULT_ALT						datetime	NULL,
	CD_USU_ALT						int			NULL,
	TIPO							int			NULL,
CONSTRAINT [PK_CTB_APURA_ICMS_ST] PRIMARY KEY CLUSTERED ([CD_EMP] ASC, [CD_FILIAL] ASC,	[UF] ASC, [MES_APURAC] ASC,	[ANO_APURAC] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY];
END;



 
