
/****** Object:  Table [dbo].[CTB_APURA_ICMS]    Script Date: 08/14/2013 13:28:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CTB_APURA_ICMS](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[MES_APURAC] [int] NOT NULL,
	[ANO_APURAC] [int] NOT NULL,
	[TIPO] [int] NOT NULL,
	[VLR_TOT_CREDITO] [money] NULL,
	[VLR_TOT_DEBITO] [money] NULL,
	[VLR_SLD_CREDOR_ANT] [money] NULL,
	[VLR_SLD_APURADO] [money] NULL,
	[VLR_ICMS_RECOLHER] [money] NULL,
	[VLR_SLD_CREDOR_TRANSPORTAR] [money] NULL,
	[VLR_TOT_DED] [money] NULL,
	[VLR_AJ_CREDITO] [money] NULL,
	[VLR_AJ_DEBITO] [money] NULL,
	[VLR_TOT_AJ_CREDITO] [money] NULL,
	[VLR_TOT_AJ_DEBITO] [money] NULL,
	[VLR_ESTORNO_CRED] [money] NULL,
	[VLR_ESTORNO_DEB] [money] NULL,
	[DT_CAD] [datetime] NULL,
	[CD_USU] [int] NULL,
	[DT_ULT_ALT] [datetime] NULL,
	[CD_USU_ALT] [int] NULL,
	[VLR_OUT_DEB] [money] NULL,
	[VLR_OUT_CRED] [money] NULL,
	[VLR_ICMS_SUBS_ENT] [money] NULL,
	[VLR_ICMS_SUBS_SAI_UF] [money] NULL,
	[VLR_TOT_DIF_ALIQ_ICMS] [money] NULL,
	[VLR_TOT_OUT_OBRIG_ICMS] [money] NULL,
	[VLR_TOT_OUT_OBRIG_RECOLHER] [money] NULL,
	[VLR_TOT_ICMS_SUBS_SAI_OUT_UF] [money] NULL,
	[VLR_TOT_ICMS_IMPORTACAO] [money] NULL,
 CONSTRAINT [PK_CTB_APURA_ICMS] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[MES_APURAC] ASC,
	[ANO_APURAC] ASC,
	[TIPO] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_OUT_DEB]  DEFAULT ((0)) FOR [VLR_OUT_DEB]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_OUT_CRED]  DEFAULT ((0)) FOR [VLR_OUT_CRED]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_ICMS_SUBS_ENT]  DEFAULT ((0)) FOR [VLR_ICMS_SUBS_ENT]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_ICMS_SUBS_SAI_UF]  DEFAULT ((0)) FOR [VLR_ICMS_SUBS_SAI_UF]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_TOT_DIF_ALIQ_ICMS]  DEFAULT ((0)) FOR [VLR_TOT_DIF_ALIQ_ICMS]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_TOT_OUT_OBRIG_ICMS]  DEFAULT ((0)) FOR [VLR_TOT_OUT_OBRIG_ICMS]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_TOT_OUT_OBRIG_RECOLHER]  DEFAULT ((0)) FOR [VLR_TOT_OUT_OBRIG_RECOLHER]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_TOT_ICMS_SUBS_SAI_OUT_UF]  DEFAULT ((0)) FOR [VLR_TOT_ICMS_SUBS_SAI_OUT_UF]
GO

ALTER TABLE [dbo].[CTB_APURA_ICMS] ADD  CONSTRAINT [DF_CTB_APURA_ICMS_VLR_TOT_ICMS_IMPORTACAO]  DEFAULT ((0)) FOR [VLR_TOT_ICMS_IMPORTACAO]
GO


