IF COL_LENGTH('PDV_CONSLD_ERROS','CD_CLI') IS NULL
BEGIN
	ALTER TABLE PDV_CONSLD_ERROS ADD CD_CLI INT
END

GO

--DROP TABLE PDV_CONSLD_ERROS_QUITACAO
IF	OBJECT_ID('PDV_CONSLD_ERROS_QUITACAO') IS NULL
BEGIN
CREATE TABLE PDV_CONSLD_ERROS_QUITACAO (
	
	ID			BIGINT		NOT NULL	IDENTITY(1,1)	PRIMARY KEY,
	LOG_ID		BIGINT		NOT NULL	FOREIGN KEY		REFERENCES PDV_CONSLD_ERROS(ID),
	TP_TIT		INT			NOT NULL,
	NR_FAT		VARCHAR(40) NULL,
	CD_PARC		INT			NULL,
	VLR_TIT		MONEY		NOT NULL,
	DT_VENC		DATETIME	NOT NULL,
	VLR_JUR		MONEY		NOT NULL,
	VLR_DESC	MONEY		NOT NULL,
	VLR_PAGO	MONEY		NOT NULL

)



END