CREATE TABLE USR_SAP_DADOSNF
(
   CDUNICO        VARCHAR2(14),
   CDPAIS         VARCHAR2(04),
	SGESTADO       VARCHAR2(02),
	CDMUNICIPIO    VARCHAR2(07),
   NRINSJUDESNF   VARCHAR2(20),
   NMRAZSODESNF   VARCHAR2(50),
   DSENDEDESTNF   VARCHAR2(50),
   NMBAIRDESTNF   VARCHAR2(30),
   IDTPIJUDESNF   VARCHAR2(01),
   NRMD5ARQTXTNF  VARCHAR2(50),
   NRCOOCUPOMNF   VARCHAR2(10),
   NRECFCUPOMNF   VARCHAR2(10),
   NRSERIEIMPNF   VARCHAR2(30),
   DSMODELOECFNF  VARCHAR2(30),
   DSMARCAECFNF   VARCHAR2(30),
   NRACESSONFCENF VARCHAR2(50),
   NRSEQCUPOMNF   VARCHAR2(3),
   NRSEQDADOSNF   VARCHAR2(4),
	IDINTERFACE    NUMBER       NOT NULL,
	TPINTERFACE    VARCHAR2(01) NOT NULL
		CONSTRAINT CKC_TPINTERFACE_USR_DADOSNF CHECK (TPINTERFACE IN ('I','A','E')),
	DTINTERFACEORI  DATE         NOT NULL,
	DTINTERFACEDEST DATE,
	STATUS          NUMBER       NOT NULL
		CONSTRAINT CKC_STATUS_USR_DADOSNF CHECK (STATUS IN (0,1,2)),
	APPORIGEM       NUMBER       NOT NULL
		CONSTRAINT CKC_APPORIGEM_USR_DADOSNF CHECK (APPORIGEM IN (1,2)),
	APPDESTINO      NUMBER       NOT NULL
		CONSTRAINT CKC_APPDESTINO_USR_DADOSNF CHECK (APPDESTINO IN (1,2))
)
/

ALTER TABLE USR_SAP_NOTAFISCAL
ADD VRTOTALAF FLOAT
/

ALTER TABLE USR_SAP_NOTAFISCAL
ADD VRDIFENFAF FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD NRAUTOFORNE VARCHAR2(300)
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD VRDIFEITNFAF FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD VRTOTAITEMAF FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD VRUNITAF FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD QTPROGENTAF FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD VRUNITITEMCALC FLOAT
/

ALTER TABLE USR_SAP_ITEMPRODUTO
ADD VRTOTITEMCALC FLOAT
/

ALTER TABLE USR_SAP_NOTAFISCAL
ADD VRTOTDIFNEGATIVO FLOAT
/

ALTER TABLE USR_SAP_NOTAFISCAL
ADD VRTOTDIFPOSITIVO FLOAT
/

ALTER TABLE USR_SAP_NOTAFISCAL
ADD IDPROCNOTADEBCRE VARCHAR2(1)
/

-- VERSAO --
BEGIN ATUVEROBJ('GRSTRGO_CUPOMNF','6.35.027'); END;
/
