ALTER TABLE CTBIMPTPOPER ADD CDCTBLEXCLICMS VARCHAR2(20) NULL
/

CREATE INDEX CTB00320_FK ON CTBIMPTPOPER (CDCTBLEXCLICMS ASC)
/

ALTER TABLE CTBIMPTPOPER
   ADD CONSTRAINT FKCTB00320CONTCTBL FOREIGN KEY (CDCTBLEXCLICMS)
      REFERENCES CONTCTBL (CDCONTCTBL)
/

ALTER TABLE CTBIMPTPOPER ADD CDFILEXCLICMS VARCHAR2(4) NULL
/

CREATE INDEX CTB00321_FK ON CTBIMPTPOPER (CDFILEXCLICMS ASC)
/

ALTER TABLE CTBIMPTPOPER
   ADD CONSTRAINT FKCTB00321FILIAL FOREIGN KEY (CDFILEXCLICMS)
      REFERENCES FILIAL (CDFILIAL)
/

CREATE TABLE CTBPRDFILTPOPER
(  CDFILIAL            VARCHAR2(4)     NOT NULL, 
   CDPRODUTO           VARCHAR2(10)    NOT NULL,
   IDENTRSAIDOP        VARCHAR2(1)     NOT NULL,
   CDTIPOOPER          VARCHAR2(2)     NOT NULL,
   CDCTBLPRODFIL       VARCHAR2(20)    NULL,
   CDCTBLPRODFILCMV    VARCHAR2(20)    NULL,
   NRORG               NUMBER 	       DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
   IDATIVO             VARCHAR2(1)     DEFAULT 'S'					NOT NULL,
   DTINCLUSAO          DATE            DEFAULT SYSDATE,
   DTULTATU            DATE            DEFAULT SYSDATE,
   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',
		CONSTRAINT CKC_IDATIVO_CTBPRDFILTPOPER CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_CTBPRDFILTPOPER PRIMARY KEY (CDFILIAL, CDPRODUTO, IDENTRSAIDOP, CDTIPOOPER)
   )
/

CREATE INDEX CTB00322_FK ON CTBPRDFILTPOPER (CDFILIAL ASC, CDPRODUTO ASC)
/

ALTER TABLE CTBPRDFILTPOPER
   ADD CONSTRAINT FKCTB00322PRODFILI FOREIGN KEY (CDFILIAL, CDPRODUTO)
      REFERENCES PRODFILI (CDFILIAL, CDPRODUTO)
/

CREATE INDEX CTB00323_FK ON CTBPRDFILTPOPER (IDENTRSAIDOP ASC, CDTIPOOPER ASC)
/

ALTER TABLE CTBPRDFILTPOPER
   ADD CONSTRAINT FKCTB00323TIPOOPER FOREIGN KEY (IDENTRSAIDOP, CDTIPOOPER)
      REFERENCES TIPOOPERAC (IDENTRSAIDOP, CDTIPOOPER)
/

CREATE INDEX CTB00324_FK ON CTBPRDFILTPOPER (CDCTBLPRODFIL ASC)
/

ALTER TABLE CTBPRDFILTPOPER
   ADD CONSTRAINT FKCTB00324TIPOOPER FOREIGN KEY (CDCTBLPRODFIL)
      REFERENCES CONTCTBL (CDCONTCTBL)
/

CREATE INDEX CTB00325_FK ON CTBPRDFILTPOPER (CDCTBLPRODFILCMV ASC)
/

ALTER TABLE CTBPRDFILTPOPER
   ADD CONSTRAINT FKCTB00325TIPOOPER FOREIGN KEY (CDCTBLPRODFILCMV)
      REFERENCES CONTCTBL (CDCONTCTBL)
/

ALTER TABLE CONTOPECTBL ADD IDCONTVREXCICMSEP VARCHAR2(1) DEFAULT 'N' NOT NULL
   CONSTRAINT CKC_IDCONTVREXCICMSEP_CONT CHECK (IDCONTVREXCICMSEP IN ('S','N'))
/

ALTER TABLE IMPOSTONF ADD VRIMPICMSBASE  FLOAT NULL
/

ALTER TABLE ITEMPROIMPOS ADD VRIMPICMSBASE  FLOAT NULL
/

ALTER TABLE ITVENDAIMPOS ADD VRIMPICMBPIS FLOAT NULL
/

ALTER TABLE ITVENDAIMPOS ADD VRIMPICMBCOFINS FLOAT NULL
/

ALTER TABLE TRABITPROIMPOS ADD VRIMPICMSBASE  FLOAT NULL
/