IF OBJECT_ID('PDV_CUPOM_NAO_FISCAL_RPS_PEND') IS NULL
BEGIN
CREATE TABLE [dbo].[PDV_CUPOM_NAO_FISCAL_RPS_PEND](
	[CD_EMP] [int] NOT NULL,
	[CD_FILIAL] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_CTR_IT] [int] NULL,
	[CD_PROD] [int] NULL,
	[QT_IT] [money] NULL,
	[VLR_UNITARIO] [money] NULL,
	[VLR_DESC] [money] NULL,
	[VLR_TOTAL] [money] NULL,
 CONSTRAINT [PK_PDV_CUPOM_NAO_FISCAL_RPS_PEND] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_FILIAL] ASC,
	[CD_CTR] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [dbo].[PDV_CUPOM_NAO_FISCAL_RPS_PEND]  WITH CHECK ADD  CONSTRAINT [FK_PDV_CUPOM_NAO_FISCAL_RPS_PEND_PDV_CUPOM_NAO_FISCAL] FOREIGN KEY([CD_EMP], [CD_FILIAL], [CD_CTR])
REFERENCES [dbo].[PDV_CUPOM_NAO_FISCAL] ([CD_EMP], [CD_FILIAL], [CD_CTR])

ALTER TABLE [dbo].[PDV_CUPOM_NAO_FISCAL_RPS_PEND] CHECK CONSTRAINT [FK_PDV_CUPOM_NAO_FISCAL_RPS_PEND_PDV_CUPOM_NAO_FISCAL]
END