CREATE TABLE IF NOT EXISTS public.vnd_aux_faturamento_vnd_orcamento ( usuario integer NOT NULL, filial_orc integer NOT NULL, orcamento integer NOT NULL, vlr_pago numeric(18, 6) NOT NULL, CONSTRAINT pk_vnd_aux_faturamento_vnd_orcamento PRIMARY KEY (usuario, filial_orc, orcamento) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.vnd_aux_faturamento_vnd_orcamento OWNER to postgres; CREATE TABLE IF NOT EXISTS public.vnd_aux_faturamento_rlc_orcamento_x_duplicata ( usuario integer NOT NULL, filial_orcamento integer NOT NULL, orcamento integer NOT NULL, filial_duplicata integer NOT NULL, sequencia_duplicata integer NOT NULL, CONSTRAINT pk_vnd_aux_faturamento_rlc_orcamento_x_duplicata PRIMARY KEY (usuario, filial_orcamento, orcamento, filial_duplicata, sequencia_duplicata) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.vnd_aux_faturamento_rlc_orcamento_x_duplicata OWNER to postgres; CREATE TABLE IF NOT EXISTS public.vnd_aux_faturamento_rcb_dup_rcb ( usuario integer NOT NULL, filial_dup integer NOT NULL, sequencia integer NOT NULL, vlr_nota numeric(18, 6) NOT NULL, vlr_ja_pago numeric(18, 6) NOT NULL, vlr_restante numeric(18, 6) NOT NULL, situacao character varying(1) NOT NULL, duplicata_doc integer NOT NULL, parcela integer NOT NULL, CONSTRAINT pk_vnd_aux_faturamento_rcb_dup_rcb PRIMARY KEY (usuario, filial_dup, sequencia) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.vnd_aux_faturamento_rcb_dup_rcb OWNER to postgres; CREATE TABLE IF NOT EXISTS public.vnd_aux_faturamento_flx_mov_financ ( usuario integer NOT NULL, filial_mov integer NOT NULL, sequencia integer NOT NULL, filial_pedido integer NOT NULL, pedido integer NOT NULL, vlr_movto numeric(18, 6) NOT NULL, data_pagamento date NOT NULL, tipo_pgto integer NOT NULL, tipo_movto_finan integer NOT NULL, filial_duplicata integer NOT NULL, sequencia_duplicata integer NOT NULL, CONSTRAINT pk_vnd_aux_faturamento_flx_mov_financ PRIMARY KEY (usuario, filial_mov, sequencia) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.vnd_aux_faturamento_flx_mov_financ OWNER to postgres; CREATE TABLE IF NOT EXISTS public.vnd_aux_faturamento_nfs_nota_x_pedido ( usuario integer NOT NULL, filial_orcamento integer NOT NULL, orcamento integer NOT NULL, filial_nota integer NOT NULL, nota_fiscal integer NOT NULL, serie character varying(6) NOT NULL, CONSTRAINT pk_vnd_aux_faturamento_nfs_nota_x_pedido PRIMARY KEY (usuario, filial_orcamento, orcamento, filial_nota, nota_fiscal, serie) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.vnd_aux_faturamento_nfs_nota_x_pedido OWNER to postgres;