ALTER TABLE ITMAPARECUP ADD VRALIQITEM FLOAT NULL
/

CREATE TABLE AJFISAUTOMAPA
(
	NRAJFISAUTOMAPA  NUMBER       NOT NULL,
	CDAJUSTFISC      VARCHAR2(10) NULL,
	NRSEQUMAPAPU     VARCHAR2(10) NULL,
	IDTPAJUSTE       VARCHAR2(03) NULL,
	CDAJUSTEITMAPA   VARCHAR2(10) NULL,
	CDFILIAL         VARCHAR2(04) NULL,
	NRLANCTONF       VARCHAR2(10) NULL,
	IDENTRSAIDOP     VARCHAR2(01) NULL,
	CDTIPOOPER       VARCHAR2(02) NULL,
	NRNOTAFISC       VARCHAR2(20) NULL,
	CDSERIE          VARCHAR2(05) NULL,
	DTENTRSAID       DATE         NULL,
	DTEMISSAO        DATE         NULL,
	CDMODDOCFISC     VARCHAR2(02) NULL,
	CDPARTICIPANTE   VARCHAR2(21) NULL,
	CDFILIORIGEM     VARCHAR2(04) NULL,
	VRCONTABIL       FLOAT        NULL,
	VRNOTAFISC       FLOAT        NULL,
	CDPRODUTO        VARCHAR2(10) NULL,
	CDCLASFISC       VARCHAR2(10) NULL,
	VRALIQITEM       FLOAT        NULL,
	VRALIQFECP       FLOAT        NULL,
	VRADICFECP       FLOAT        NULL,
	CDFISCOPERIT     VARCHAR2(11) NULL,
	CDSITUTRIBIT     VARCHAR2(03) NULL,
	CDFISCALIT       VARCHAR2(01) NULL,
	VRBASECALCIT     FLOAT        NULL,
	VRIMPOSTOIT      FLOAT        NULL,
	CDBENEFFISCAL    VARCHAR2(10) NULL,
	VRAJUSTE         FLOAT        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_AJFISAUTOMAPA CHECK (IDATIVO IN ('S','N')),
		CONSTRAINT PK_AJFISAUTOMAPA PRIMARY KEY (NRAJFISAUTOMAPA)
  )
/

CREATE INDEX FIS00916_FK ON AJFISAUTOMAPA (NRSEQUMAPAPU ASC)
/

ALTER TABLE AJFISAUTOMAPA
   ADD CONSTRAINT FKFIS00916AJFISAUTOMAPA FOREIGN KEY  (NRSEQUMAPAPU)
       REFERENCES MAPAAPURAC (NRSEQUMAPAPU) ON DELETE CASCADE
/
