CREATE TABLE INT_PEDIDO_AVIVA
(
   PEDEXTERNO     VARCHAR2(15),
   DTENTPED       DATE,
   CDCLIENTE      VARCHAR2(20),
   DSPEDVEN       VARCHAR2(500),
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_ITEMPED_AVIVA
(
   PEDEXTERNO     VARCHAR2(15),
   NRITEMPED      INTEGER,
   CDPRODEXTERNO  VARCHAR2(20),
   QTITEMPED      FLOAT,
   DTENTITPED     DATE,
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_AUTOFORNE_TEK
(
   NRAUTOFORN        VARCHAR2(10),
   DSEMAILOPERAPROV  VARCHAR2(50),
   DSEMAILOPERSOL    VARCHAR2(50),
   NMRAZSOCFORN      VARCHAR2(100),
   LOG_ERRO          VARCHAR2(500),
   DTGRAVACAO        DATE,
   HRGRAVACAO        VARCHAR2(5),
   DTIMPORTACAO      DATE,
   HRIMPORTACAO      VARCHAR2(5)
)
/

CREATE TABLE INT_ITEMAUTF_TEK
(
   NRAUTOFORN     VARCHAR2(10),
   CDPRODEXTERNO  VARCHAR2(20),
   DSEMAILOPERSOL VARCHAR2(50),
   NMPRODUTO      VARCHAR2(50),
   DTPROGENTAF    DATE,
   SGUNIDADE      VARCHAR2(10),
   QTPROGENTAF    FLOAT,
   DTAUTOFORN     DATE,
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_COMPRA_AVIVA
(
   DTENTRADA      DATE,
   CDPRODEXTERNO  VARCHAR2(20),
   VRQUANTIDADE   FLOAT,
   VRUNITARIO     FLOAT,
   IDINTERFACE    VARCHAR2(1),
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_SALDOEST_TEK
(
   CDPRODEXTERNO  VARCHAR2(20),
   QTESTOQDIA     FLOAT,
   SGUNIDADE      VARCHAR2(10),
   DTPOSICAO      DATE,
   IDINTERFACE    VARCHAR2(5),
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_EXPEDICAO_TEK
(
   NREXPEDICAO    VARCHAR2(10),
   CDCLIENTE      VARCHAR2(20),
   CDFILIRECE     VARCHAR2(4),
   CDPRODEXTERNO  VARCHAR2(20),
   NRPEDPROD      VARCHAR2(15),
   NRITEMPED      VARCHAR2(10),
   QTITEMPROD     FLOAT,
   CDALMOXARIFE   VARCHAR2(6),
   SGUNIDADE      VARCHAR2(10),
   DTENTRSAID     DATE,
   IDINTERFACE    VARCHAR2(5),
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

CREATE TABLE INT_PRODACAB_TEK
(
   CDPRODEXTERNO  VARCHAR2(20),
   CDALMOXARIFE   VARCHAR2(6),
   QTLANCTOEST    FLOAT,
   SGUNIDADE      VARCHAR2(10),
   DTENTRSAID     DATE,
   IDINTERFACE    VARCHAR2(5),
   LOG_ERRO       VARCHAR2(500),
   DTGRAVACAO     DATE,
   HRGRAVACAO     VARCHAR2(5),
   DTIMPORTACAO   DATE,
   HRIMPORTACAO   VARCHAR2(5)
)
/

ALTER TABLE ITEMAUTF
ADD DTEXPORTA_RIQ DATE
/

ALTER TABLE ITEMPRODUTO
ADD DTEXPORTA_RIQ DATE
/

ALTER TABLE EXPEDICAO
ADD DTEXPORTA_RIQ DATE
/

ALTER TABLE PRODACABADO
ADD DTEXPORTA_RIQ DATE
/

ALTER TABLE INT_PEDIDO_AVIVA
ADD CDTIPOOPERWEB VARCHAR2(10)
/

ALTER TABLE INT_PEDIDO_AVIVA
ADD CDFILIALPED VARCHAR2(30)
/

ALTER TABLE PEDIDO
ADD PEDEXTERNO VARCHAR2(15)
/

ALTER TABLE INT_PRODACAB_TEK
ADD VRCUSTOPROD FLOAT;
/

ALTER TABLE INT_PEDIDO_AVIVA
ADD PEDIDO_GERADO VARCHAR2(14)
/

ALTER TABLE INT_COMPRA_AVIVA
ADD LANC_GERADO VARCHAR2(14)
/

-- VERSAO --
BEGIN ATUVEROBJ('ESTRUTURA_AVIVA','6.39.014'); END;
/
