CREATE TABLE IF NOT EXISTS public.dis_aux_consulta_pedido ( terminal_ip character varying(50) NOT NULL, filial_dis integer NOT NULL, filial_orc integer NOT NULL, orcamento integer NOT NULL, sequencia integer NOT NULL, produto integer NOT NULL, qtde_venda numeric(18,6) NOT NULL, qtde_devolucao numeric(18,6) NOT NULL, qtde_entregue numeric(18,6) NOT NULL, qtde_entregar numeric(18,6) NOT NULL, data_emissao date NOT NULL, data_previsao_entrega date NOT NULL, gerou_nf_caixa character varying(1) NOT NULL, cliente integer NOT NULL, endereco_entrega integer NOT NULL, tipo_entrega integer NOT NULL, vlr_pago numeric(18,6) NOT NULL, vlr_unitario numeric(18,6) NOT NULL, vlr_total numeric(18,6) NOT NULL, status character varying(1) NOT NULL, CONSTRAINT pk_dis_aux_consulta_pedido PRIMARY KEY (terminal_ip, filial_dis, filial_orc, orcamento, sequencia) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.dis_aux_consulta_pedido OWNER to postgres; COMMENT ON TABLE public.dis_aux_consulta_pedido IS 'Auxiliar da Consulta de Pedido na Distribuição'; CREATE TABLE IF NOT EXISTS public.dis_aux_consulta_pedido_romaneio ( terminal_ip character varying(50) NOT NULL, filial_romaneio integer NOT NULL, romaneio integer NOT NULL, filial_orcamento integer NOT NULL, orcamento integer NOT NULL, seq_item_orcamento integer NOT NULL, data_emissao date NOT NULL, hora_emissao time without time zone NOT NULL, veiculo character varying NOT NULL, data_entrega date NOT NULL, hora_entrega time without time zone NOT NULL, situacao character(1) NOT NULL, observacao character varying NOT NULL, qtd_total numeric(18,10) NOT NULL, qtd_entregue numeric(18,10) NOT NULL, CONSTRAINT pk_dis_aux_consulta_pedido_romaneio PRIMARY KEY (terminal_ip, filial_romaneio, romaneio, filial_orcamento, orcamento, seq_item_orcamento) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.dis_aux_consulta_pedido_romaneio OWNER to postgres; COMMENT ON TABLE public.dis_aux_consulta_pedido IS 'Auxiliar da Consulta o Romaneio do Pedido na Distribuição';