CREATE TABLE ARRECADAADMGER (
  NRARRECADAADMGER 	NUMBER(10) NOT NULL,
  CDANO 			NUMBER(10) NOT NULL,
  CDFILIALADM 		VARCHAR2(4) NOT NULL,
  VRMES01 			DOUBLE PRECISION NULL, 
  VRMES02 			DOUBLE PRECISION NULL, 
  VRMES03 			DOUBLE PRECISION NULL, 
  VRMES04 			DOUBLE PRECISION NULL, 
  VRMES05 			DOUBLE PRECISION NULL, 
  VRMES06 			DOUBLE PRECISION NULL, 
  VRMES07 			DOUBLE PRECISION NULL, 
  VRMES08 			DOUBLE PRECISION NULL, 
  VRMES09 			DOUBLE PRECISION NULL, 
  VRMES10 			DOUBLE PRECISION NULL, 
  VRMES11 			DOUBLE PRECISION NULL, 
  VRMES12 			DOUBLE PRECISION 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_ARRECADAADMGER CHECK (IDATIVO IN ('S','N')),
	CONSTRAINT PK_ARRECADAADMGER PRIMARY KEY(NRARRECADAADMGER)
)
/

ALTER TABLE ARRECADAADMGER ADD CONSTRAINT FKGOP00736CDFILIALADM FOREIGN KEY (CDFILIALADM) REFERENCES FILIAL (CDFILIAL)
/

CREATE INDEX GOP00736_FK ON ARRECADAADMGER (CDFILIALADM ASC)
/

CREATE TABLE ARRECADAADMUNI (
  NRARRECADAADMUNI 	NUMBER(10) NOT NULL,
  CDANO 			NUMBER(10) NOT NULL,
  CDFILIAL 			VARCHAR2(4) NOT NULL,
  CDFILIALADM 		VARCHAR2(4) NOT NULL,
  VRMES01 			DOUBLE PRECISION NULL, 
  VRMES02 			DOUBLE PRECISION NULL, 
  VRMES03 			DOUBLE PRECISION NULL, 
  VRMES04 			DOUBLE PRECISION NULL, 
  VRMES05 			DOUBLE PRECISION NULL, 
  VRMES06 			DOUBLE PRECISION NULL, 
  VRMES07 			DOUBLE PRECISION NULL, 
  VRMES08 			DOUBLE PRECISION NULL, 
  VRMES09 			DOUBLE PRECISION NULL, 
  VRMES10 			DOUBLE PRECISION NULL, 
  VRMES11 			DOUBLE PRECISION NULL, 
  VRMES12 			DOUBLE PRECISION 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_ARRECADAADMUNI CHECK (IDATIVO IN ('S','N')),
	CONSTRAINT PK_ARRECADAADMUNI PRIMARY KEY(NRARRECADAADMUNI)
)
/

ALTER TABLE ARRECADAADMUNI ADD CONSTRAINT FKGOP00737CDFILIAL FOREIGN KEY (CDFILIAL) REFERENCES FILIAL (CDFILIAL)
/

ALTER TABLE ARRECADAADMUNI ADD CONSTRAINT FKGOP00738CDFILIALADM FOREIGN KEY (CDFILIALADM) REFERENCES FILIAL (CDFILIAL)
/

CREATE INDEX GOP00737_FK ON ARRECADAADMUNI (CDFILIAL ASC)
/

CREATE INDEX GOP00738_FK ON ARRECADAADMUNI (CDFILIALADM ASC)
/