ALTER TABLE USR_CONTAPAGAR RENAME TO USR_SAP_CONTPAGAR
/

ALTER TABLE USR_SAP_CONTPAGAR ADD CDUNICOSAP VARCHAR2(50)
/

ALTER TABLE USR_SAP_CONTPAGAR ADD  VRDIFAFNF FLOAT
/
 
CREATE TABLE USR_SAP_DETCONTPAGAR ( 
    CDUNICOSAP 		VARCHAR2(50) 	NOT NULL,    
    NRSEQDET 		NUMBER 			NOT NULL, 
    NMDETALHE 		VARCHAR2(100) 	NOT NULL,
    VRDETALHE 		FLOAT 			NOT NULL,
    IDINTERFACE 	NUMBER, 
    TPINTERFACE 	VARCHAR2(1),
    DTINTERFACEORI 	DATE, 
    DTINTERFACEDEST DATE,
    STATUS 			NUMBER,
	NRORG 			NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
	IDATIVO 		VARCHAR2(1) DEFAULT 'S' NOT NULL,
		CONSTRAINT CKC_IDATIVO_USR_SAP_DETCTPAG CHECK (IDATIVO IN ('S','N')),
	DTINCLUSAO 		DATE 				NULL,
	DTULTATU 		DATE 			NULL,
	NRORGINCLUSAO 	NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')  NULL,
	CDOPERINCLUSAO 	VARCHAR2(12)	DEFAULT '1' NULL,
	NRORGULTATU 	NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')  NULL,
	CDOPERULTATU 	VARCHAR2(12) 	DEFAULT '1'
  )