CREATE TABLE IF NOT EXISTS "prod2" ( "codigo" INTEGER, "qtde" FLOAT, "dt_ultima_compra" DATE, "dt_ultima_venda" DATE, "dt_ultimo_inventario" DATE, "qtde_inventario" FLOAT, "codigo_filial" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Controle do estoque - Arquivo somente com a qtde e historico da ultima movimentacao' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); alter table prod2 add if not exists codigo_filial integer; CREATE TABLE IF NOT EXISTS "filiais" ( "codigo_filial" INTEGER, "descricao" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Nome das filiais' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE TABLE IF NOT EXISTS "integrae" ( "numero" AUTOINC, "nome_arquivo" VARCHAR(60), "tipo" INTEGER, "ativo" BOOLEAN, "enviado" BOOLEAN, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Arquivo de pacotes do integrador - Envio' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE TABLE IF NOT EXISTS "integrai" ( "data" DATE, "hora" TIME, "identificador" VARCHAR(20), "pacote_numero" INTEGER, "filial_origem" INTEGER, "filial_destino" INTEGER, "nome_arquivo" VARCHAR(60), "tipo" INTEGER, "ativo" BOOLEAN, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Pacotes do integrador - Recebidos' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "pacote_numero" ON "integrai" ("pacote_numero","filial_origem"); alter table cr add if not exists filial integer; alter table cp add if not exists filial integer; alter table caixa add if not exists filial integer; alter table despesas add if not exists filial integer; alter table cupom1 add if not exists tem_nfce boolean; alter table cupom1 add if not exists nfce_numero integer; alter table confignf add if not exists ICMS_INTER float; CREATE TABLE IF NOT EXISTS "cliente2" ( "codigo" INTEGER, "descricao" VARCHAR(60), "arquivo" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Imagens do cliente' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "codigo" ON "cliente2" ("codigo"); alter table compra add if not exists Valor_Soma_Produtos float; alter table confignf add if not exists Compra_Atualizar_Preco_Pela_Venda boolean; CREATE TABLE IF NOT EXISTS "etiquetas" ( "codigo" AUTOINC, "descricao" VARCHAR(60), "script" MEMO, PRIMARY KEY ("codigo") COMPRESS NONE DESCRIPTION 'Modelos de etiquetas' LOCALE CODE 0 USER MAJOR VERSION 4 ); alter table ficha add if not exists debito_liquido float; alter table ficha add if not exists credito_liquido float; alter table produtos add if not exists CEST varchar(8); CREATE TABLE IF NOT EXISTS "cest" ( "CEST" VARCHAR(8), "NCM" VARCHAR(8), "CONTEUDO" VARCHAR(200), PRIMARY KEY ("RecordID") COMPRESS NONE TEXT INDEX ("NCM") STOP WORDS 'A AN AND BE FOR HOW IN IS IT OF ON OR THAT THE THIS TO WAS WHAT WHEN WHICH WHY WILL' SPACE CHARS #1+#2+#3+#4+#5+#6+#7+#8+#9+#10+#11+#12+#13 +#14+#15+#16+#17+#18+#19+#20+#21+#22+#23 +#24+#25+#26+#27+#28+#29+#30+#31+#32+'*+'+ ',-./:;<=>\`' INCLUDE CHARS '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_ab'+ 'cdefghijklmnopqrstuvwxyz€‚ƒ„…†‡ˆ‰Š‹ŒŽ'+ '‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·'+ '¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß'+ 'à áâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ' DESCRIPTION 'Tabela do CEST' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "CEST" ON "cest" ("CEST"); CREATE INDEX IF NOT EXISTS "NCM" ON "cest" ("NCM"); alter table cf add if not exists IBPT_Trib_Fed float; alter table cf add if not exists IBPT_Trib_Est float; alter table cf add if not exists IBPT_Trib_Mun float; alter table cf add if not exists IBPT_Trib_Total float; alter table cf add if not exists ICMS_CST_CSOSN varchar(4); alter table cf add if not exists CFOP varchar(4); alter table cf add if not exists PIS_COFINS_CST varchar(4); alter table cf add if not exists PIS_Aliq float; alter table cf add if not exists COFINS_Aliq float; alter table produtos add if not exists CST_CSOSN_ICMS varchar(5); alter table produtos add if not exists CFOP varchar(5); alter table produtos add if not exists UN_Trib varchar(6); alter table produtos add if not exists Qtde_Trib float; alter table confignf add if not exists pGLP FLOAT; alter table confignf add if not exists pGNn FLOAT; alter table confignf add if not exists pGNi FLOAT; CREATE TABLE IF NOT EXISTS "prod4" ( "codigo" INTEGER, "descricao" VARCHAR(40), "arquivo" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Fotos do produto' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "codigo" ON "prod4" ("codigo"); alter table nfe1 add if not exists xPed varchar(20); alter table os2 add if not exists item_absoluto autoinc; alter table os1 add if not exists item_absoluto autoinc; alter table os5 add if not exists item_absoluto autoinc; alter table estoque add if not exists movimento float; alter table produtos add if not exists id_prod float; alter table nfe add if not exists indFinal boolean; alter table nfe add if not exists vol_transp_quantidade varchar(15); alter table nfe add if not exists vol_transp_especie varchar(20); alter table nfe add if not exists vol_transp_marca varchar(20); alter table nfe add if not exists vol_transp_numeracao varchar(20); alter table nfe add if not exists vol_transp_pesoliquido varchar(15); alter table nfe add if not exists vol_transp_pesobruto varchar(15); alter table operacao add if not exists indFinal boolean; alter table compra add if not exists Arquivo_XML varchar(60); alter table compra1 add if not exists VL_Despesas float; alter table nfe drop if exists codigocidade; alter table nfe drop if exists cnpj; alter table nfe drop if exists cep; alter table nfe drop if exists endereco; alter table nfe drop if exists nro; alter table nfe drop if exists complemento; alter table nfe drop if exists bairro; alter table nfe drop if exists codcidade; alter table nfe drop if exists cidade; alter table nfe drop if exists uf; alter table nfe drop if exists telefone; alter table nfe drop if exists ie; alter table nfe drop if exists nome; alter table nfe drop if exists email; alter table nfe drop if exists codigopais; alter table nfe drop if exists pais; alter table nfe drop if exists modelo; alter table nfe drop if exists indpag; alter table nfe drop if exists cuf; alter table nfe drop if exists cmunfg; alter table nfe drop if exists cdv; alter table nfe drop if exists efeito; alter table nfe drop if exists lote; alter table nfe drop if exists NFe_Emitir_Bloqueto; alter table nfe drop if exists NFe_Conta_Bloqueto; alter table nfe drop if exists NFE_Em_Manifesto; alter table nfe drop if exists Gerar_receita; alter table nfe drop if exists lancar_movimento_em_receitas; alter table nfe drop if exists receita_numero; alter table nfe drop if exists cupom; alter table nfe drop if exists idcidade_entrega; alter table nfe drop if exists verProc; alter table anfe drop if exists indpag; alter table anfe drop if exists modelo; alter table anfe drop if exists tpnf; alter table anfe drop if exists finnfe; alter table anfe drop if exists verproc; alter table anfe drop if exists cuf; alter table anfe drop if exists cmunfg; alter table anfe drop if exists tpimp; alter table anfe drop if exists tpemiss; alter table anfe drop if exists cdv; alter table anfe drop if exists tpamb; alter table anfe drop if exists cnpj; alter table anfe drop if exists cep; alter table anfe drop if exists endereco; alter table anfe drop if exists nro; alter table anfe drop if exists complemento; alter table anfe drop if exists bairro; alter table anfe drop if exists cidade; alter table anfe drop if exists uf; alter table anfe drop if exists telefone; alter table anfe drop if exists ie; alter table anfe drop if exists nome; alter table anfe drop if exists enderecoentrega; alter table anfe drop if exists cidadeentrega; alter table anfe drop if exists bairroentrega; alter table anfe drop if exists ufentrega; alter table anfe drop if exists codigopais; alter table anfe drop if exists pais; alter table anfe drop if exists vlmo; alter table anfe drop if exists baseissqn; alter table anfe drop if exists vlissqn; alter table anfe drop if exists obs1; alter table anfe drop if exists obs2; alter table anfe drop if exists obs3; alter table anfe drop if exists obs4; alter table anfe drop if exists obs5; alter table anfe drop if exists obs6; alter table anfe drop if exists lote; alter table anfe drop if exists "nfe-xml"; alter table anfe drop if exists "canc-xml"; alter table anfe drop if exists motivo; alter table anfe drop if exists id; alter table anfe add if not exists chNF varchar(60); alter table anfe drop if exists freteporcontade; alter table anfe drop if exists codigotransp; alter table anfe drop if exists cnpjtransp; alter table anfe drop if exists nometransp; alter table anfe drop if exists ietransp; alter table anfe drop if exists enderecotransp; alter table anfe drop if exists cidadetransp; alter table anfe drop if exists uftransp; alter table anfe drop if exists placa; alter table anfe drop if exists ufplaca; alter table anfe drop if exists rntc; alter table anfe drop if exists transp_email; alter table anfe drop if exists email; alter table anfe drop if exists Gerar_receita; alter table anfe drop if exists nro_entrega; alter table anfe drop if exists complemento_entrega; alter table anfe drop if exists codigo_operacao; alter table anfe drop if exists tpEmis; alter table confignf add if not exists COMPRA_Cadastrar_Automatico boolean; alter table compra1 add if not exists CEST varchar(10); alter table compra1 add if not exists Usar_Margem_do_Cadastro boolean; alter table cp drop if exists foto; alter table cp drop if exists os; alter table cp add if not exists nro autoinc; alter table caixa add if not exists nro autoinc; alter table caixa drop if exists foto; alter table despesas add if not exists nro autoinc; alter table despesas drop if exists foto; alter table cr drop if exists bordero; alter table cr drop if exists foto; alter table cr drop if exists coo_numero; alter table cr drop if exists os; alter table cr drop if exists exportado; alter table cr drop if exists retornado; alter table cr drop if exists NF_numero; alter table cp drop if exists exportado; alter table os4 add if not exists arquivo_documento varchar(100); alter table os4 drop if exists imagem; alter table os4 drop if exists pdf; alter table os4 drop if exists doc; alter table os4 drop if exists xml; alter table os drop if exists termo; alter table os drop if exists solicitante; alter table os drop if exists nome_solicitante; alter table os drop if exists fantasia_solicitante; alter table os drop if exists status_destaque; alter table compra drop if exists foto; alter table compra drop if exists xml; CREATE TABLE IF NOT EXISTS "compra3" ( "numero" INTEGER, "nome_terminal" VARCHAR(20), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Compras marcadas' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "compra3" ("numero"); alter table produtos drop if exists foto; alter table produtos drop if exists icms; alter table produtos drop if exists lmc; alter table produtos drop if exists inteiro; alter table confignf add if not exists obs7 varchar(100); alter table produtos drop if exists arquivo_foto; alter table produtos drop if exists tipo_comissao; alter table produtos drop if exists cadastro_ativo; alter table produtos drop if exists composto; alter table produtos drop if exists baixarestoque; alter table produtos drop if exists tipo; alter table produtos drop if exists exportar; alter table produtos add if not exists vBCSTRet float; alter table produtos add if not exists vICMSSTRet float; alter table produtos add if not exists pST float; alter table nfce1 add if not exists vBCSTRet float; alter table nfce1 add if not exists vICMSSTRet float; alter table nfce1 add if not exists pST float; alter table cupom1 add if not exists vBCSTRet float; alter table cupom1 add if not exists vICMSSTRet float; alter table cupom1 add if not exists pST float; alter table anfe drop if exists codigocidade; alter table anfe drop if exists codcidade; alter table nfce drop if exists destinatario_fantasia; alter table nfce drop if exists destinatario_cnpj_cpf; alter table nfce drop if exists destinatario_ie; alter table nfce drop if exists destinatario_endereco; alter table nfce drop if exists destinatario_numero; alter table nfce drop if exists destinatario_complemento; alter table nfce drop if exists destinatario_bairro; alter table nfce drop if exists destinatario_ibge_cidade; alter table nfce drop if exists destinatario_cidade; alter table nfce drop if exists destinatario_uf; alter table nfce drop if exists destinatario_fone; alter table nfce drop if exists destinatario_email; alter table nfce drop if exists obs_linha1; alter table nfce drop if exists obs_linha2; alter table nfce drop if exists obs_linha3; alter table nfce drop if exists obs_linha4; alter table nfce drop if exists obs_linha5; alter table nfce drop if exists obs_linha6; alter table nfce drop if exists obs; alter table nfce drop if exists nfce_motivo_cancelamento; alter table cupom drop if exists loja; alter table cupom drop if exists caixa; alter table cupom drop if exists marca_executar; alter table cupom drop if exists nfce_email_enviado; alter table cupom drop if exists nfce_sms_enviado; alter table cupom drop if exists nfe_email_enviado; alter table cupom drop if exists exportado; alter table cupom drop if exists serie; alter table compra drop if exists modelo; alter table compra drop if exists serie; alter table compra drop if exists cnpj; alter table compra drop if exists ie; alter table compra drop if exists nome; alter table compra drop if exists fantasia; alter table compra drop if exists fone; alter table compra drop if exists cep; alter table compra drop if exists endereco; alter table compra drop if exists nro; alter table compra drop if exists complemento; alter table compra drop if exists bairro; alter table compra drop if exists idcidade; alter table compra drop if exists cidade; alter table compra drop if exists uf; alter table compra drop if exists cc; alter table compra1 drop if exists aliquota_icms_ecf; alter table compra1 drop if exists embalado; alter table compra1 drop if exists embalagem; alter table compra1 drop if exists qtdeembalado; alter table compra1 drop if exists vlembalagem; alter table compra1 drop if exists qtdeembalagens; alter table compra1 drop if exists cfop_contabil; alter table compra1 drop if exists cst_icms_contabil; alter table compra1 drop if exists atualizarestoque; alter table compra1 drop if exists atualizarcadastro; alter table compra1 drop if exists ref1; alter table compra1 drop if exists ref2; alter table compra1 drop if exists ref3; alter table compra1 drop if exists ref4; alter table compra1 drop if exists preco_alterado; alter table compra1 drop if exists Registro_alterado; alter table compra1 add if not exists vBCSTRet float; alter table compra1 add if not exists vICMSSTRet float; alter table compra1 add if not exists pST float; alter table nfe1 add if not exists vBCSTRet float; alter table nfe1 add if not exists vICMSSTRet float; alter table nfe1 add if not exists pST float; alter table nfce1 redefine if exists cfop varchar(4); alter table ficha add if not exists ID_Lcto autoinc; alter table pre drop if exists osnro; alter table pre drop if exists lotacao; alter table pre drop if exists codigo_absoluto_item_na_comanda; alter table pre drop if exists valor_consumacao_camarote; alter table pre drop if exists valor_pre_consumo_camarote; alter table pre drop if exists comanda_com_camarote; alter table pre drop if exists camarote_codigo_produto_consumo; alter table pre drop if exists sexo; alter table pre drop if exists agrupador; alter table pre drop if exists encerramento; alter table pre drop if exists osnro; alter table pre add if not exists Conferencia_Aprovada boolean; alter table pre add if not exists Conferente integer; alter table pre1 add if not exists Qtde_Conferida float; alter table funcion add if not exists user_senha varchar(80); alter table cupom add if not exists Conferencia_Aprovada boolean; alter table cupom add if not exists Conferente integer; alter table nfe add if not exists incluir_ipi_na_bcicms_st boolean; alter table nfe add if not exists incluir_ipi_na_bcicms boolean; alter table cupom add if not exists data_prevenda date; alter table cupom add if not exists hora_prevenda time; alter table cupom add if not exists data_conferencia date; alter table cupom add if not exists hora_conferencia time; alter table pre add if not exists data_conferencia date; alter table pre add if not exists hora_conferencia time; alter table formas add if not exists bandeira_cartao integer; alter table formas add if not exists tipo_financiamento varchar(2); alter table formas add if not exists rede varchar(20); alter table formas add if not exists tipo_operacao varchar(2); alter table cotacao1 add if not exists fornecedor integer; alter table cotacao1 add if not exists preco_cotado float; alter table cotacao add if not exists custo_cotado float; alter table cotacao2 add if not exists Valor_Frete float; alter table cotacao2 add if not exists Valor_Despesas float; alter table cotacao3 add if not exists Qtde_orcada float; alter table cotacao2 add if not exists total_liquido float; alter table cotacao2 add if not exists oc_numero integer; alter table cotacao1 add if not exists Qtde_orcada float; alter table cotacao1 add if not exists oc_numero integer; alter table cotacao1 add if not exists numero_envio integer; CREATE TABLE IF NOT EXISTS "oc" ( "numero" AUTOINC, "identificador" VARCHAR(13), "cotacao" VARCHAR(13), "data" DATE, "hora" TIME, "codigo" INTEGER, "total" FLOAT, "status" VARCHAR(1), PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'Ordem de compra' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE TABLE IF NOT EXISTS "oc1" ( "numero" INTEGER, "codigo" INTEGER, "ref" VARCHAR(20), "descricao" VARCHAR(60), "un" VARCHAR(2), "barra" VARCHAR(20), "marca" VARCHAR(30), "qtde" FLOAT, "valor" FLOAT, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Produtos da Ordem de Compra' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "oc1" ("numero"); alter table cupom add if not exists Turno_Numero integer; alter table formas add if not exists taxa_encargo float; alter table cupom1 add if not exists arredondamento float; alter table cupom1 add if not exists vl_desconto_unit float; alter table cupom1 drop if exists informacao_complementar; CREATE TABLE IF NOT EXISTS "pdv2" ( "numero" INTEGER, "codigo" INTEGER, "qtde" FLOAT, "valor" FLOAT, "data" DATE, "hora" TIME, "operador" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Itens cancelados antes fechar a vena' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "pdv2" ("numero"); alter table integrae add if not exists CNPJ_CPF_do_Destinatario varchar(20); alter table integrae add if not exists data date; alter table integrae add if not exists hora time; alter table integrae add if not exists pacote_numero integer; CREATE TABLE IF NOT EXISTS "integra" ( "codigo" INTEGER, "nome" VARCHAR(60), "cnpj" VARCHAR(20), "data_base" DATE, "certificado_serie" VARCHAR(20), "data_limite" DATE, "filial" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Clientes Integradores do grupo' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nome" ON "integra" ("nome"); alter table cliente add if not exists data_alteracao date; alter table cliente add if not exists hora_alteracao time; alter table sistema add if not exists CR_Numero_sequencial float; alter table funcion add if not exists id varchar(20); alter table compra2 add if not exists id varchar(20); alter table sistema add if not exists CLI_Numero_sequencial integer; alter table nfe1 add if not exists CEST_NCM varchar(10); alter table balanco add if not exists qtde_itens float; alter table balanco add if not exists qtde_produtos float; CREATE INDEX IF NOT EXISTS "estoque" ON "produtos" ("similar","qtde" DESC); alter table os1 add if not exists prod_baixado_do_estoque boolean; alter table sistema add if not exists OS_Numero_sequencial integer; alter table sistema add if not exists CUPOM_Numero_sequencial integer; alter table sistema add if not exists COMPRA_Numero_sequencial integer; alter table sistema add if not exists PROD_Numero_sequencial integer; alter table balanco add if not exists convenio float; alter table sistema add if not exists HOST_TPC_IP varchar(20); alter table confignf add if not exists NFCE_Informar_Responsavel_Tecnico boolean; alter table cupom2 add if not exists tpIntegra integer; alter table cupom2 add if not exists CNPJ varchar(20); alter table cupom2 add if not exists tBand integer; alter table cupom2 add if not exists cAut varchar(20); alter table sistema add if not exists codigo integer; alter table cupom add if not exists marca boolean; alter table produtos add if not exists cBenef varchar(10); alter table nfe1 add if not exists cBenef varchar(10); alter table sistema add if not exists NFCe_Numero_sequencial integer; CREATE TABLE IF NOT EXISTS "dfe" ( "numero" AUTOINC, "dhResp" TIMESTAMP, "ultNSU" VARCHAR(15), "maxNSU" VARCHAR(15), "NSU" VARCHAR(15), "chNFe" VARCHAR(50), "CNPJ" VARCHAR(20), "xNome" VARCHAR(60), "IE" VARCHAR(20), "dhEmi" TIMESTAMP, "vNF" FLOAT, "dhRecbto" TIMESTAMP, "nProt" VARCHAR(20), "manifestada" BOOLEAN, "baixada" BOOLEAN, "marcada" BOOLEAN, "rejeitada" BOOLEAN, "arquivada" BOOLEAN, PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'Distribuição de Documentos Eletrônicos' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 8 ); CREATE INDEX IF NOT EXISTS "chave" ON "dfe" ("chNFe"); CREATE INDEX IF NOT EXISTS "emissao" ON "dfe" ("dhEmi"); alter table sistema add if not exists dfe_Ultimo_NSU varchar(20); alter table confignf add if not exists INTEGRADOR_Usuario_CNPJ varchar(20); alter table confignf add if not exists INTEGRADOR_Modo_de_Integracao integer; alter table confignf add if not exists CNPJ_Principal varchar(20); alter table mdfe add if not exists tpCarga integer; alter table mdfe add if not exists xProd varchar(40); alter table mdfe add if not exists cEAN varchar(15); alter table mdfe add if not exists NCM varchar(8); CREATE TABLE IF NOT EXISTS "cupom8" ( "numero" INTEGER, "Conferencia_Aprovada" BOOLEAN, "Conferente" INTEGER, "data_conferencia" DATE, "hora_conferencia" TIME, "data_prevenda" DATE, "hora_prevenda" TIME, PRIMARY KEY ("RecordID") COMPRESS NONE LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom8" ("numero"); alter table cupom drop if exists Conferencia_Aprovada; alter table cupom drop if exists Conferente; alter table cupom drop if exists data_conferencia; alter table cupom drop if exists hora_conferencia; alter table cupom drop if exists data_prevenda; alter table cupom drop if exists hora_prevenda; DROP INDEX if exists cupom."id1"; alter table cupom drop if exists id1; alter table cupom drop if exists id2; alter table cupom drop if exists id3; alter table cupom drop if exists id4; alter table cupom drop if exists descricao_id1; alter table cupom drop if exists descricao_id2; alter table cupom drop if exists descricao_id3; alter table cupom drop if exists descricao_id4; CREATE TABLE IF NOT EXISTS "cupom9" ( "numero" INTEGER, "id1" VARCHAR(30), "id2" VARCHAR(30), "id3" VARCHAR(30), "id4" VARCHAR(60), "descricao_id1" VARCHAR(20), "descricao_id2" VARCHAR(20), "descricao_id3" VARCHAR(20), "descricao_id4" VARCHAR(20), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Informações complementares da venda' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom9" ("numero"); CREATE TABLE IF NOT EXISTS "cupom10" ( "numero" INTEGER, "enderecoentrega" VARCHAR(60), "bairroentrega" VARCHAR(30), "cidadeentrega" VARCHAR(30), "obsentrega" VARCHAR(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Endereço de entrega' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); alter table cupom drop if exists enderecoentrega; alter table cupom drop if exists bairroentrega; alter table cupom drop if exists cidadeentrega; alter table cupom drop if exists obsentrega; CREATE INDEX IF NOT EXISTS "numero" ON "cupom10" ("numero"); DROP INDEX if exists cupom."coo"; DROP INDEX if exists cupom."numero_coo"; alter table cupom drop if exists vl_st; alter table cupom drop if exists cupomfiscal; alter table cupom drop if exists nf; alter table cupom drop if exists nfnumero; alter table cupom drop if exists pedidonumero; alter table cupom drop if exists cupomfiscalnumero; alter table cupom drop if exists tem_nfce; alter table cupom drop if exists valor_vale; CREATE TABLE IF NOT EXISTS "cupom13" ( "numero" INTEGER, "item" INTEGER, "serie" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Numero de série do ítem' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom13" ("numero"); CREATE TABLE IF NOT EXISTS "cupom14" ( "numero" INTEGER, "item" INTEGER, "qtde_devolvida" FLOAT, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Quantidade devolvida de ítem' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom14" ("numero"); CREATE TABLE IF NOT EXISTS "cupom15" ( "numero" INTEGER, "item" INTEGER, "codigo_vendedor" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Vendedores dos itens' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom15" ("codigo_vendedor"); CREATE TABLE IF NOT EXISTS "cupom16" ( "numero" INTEGER, "cr_nro" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Títulos pagos na receita' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom16" ("numero"); alter table cupom13 add if not exists descricao_alternativa varchar(60); alter table cupom13 add if not exists codigo integer; insert into cupom13 (numero, item, serie, codigo, descricao_alternativa) select numero, item, serie, codigo, descricao from cupom1 where descricao<>null; insert into cupom15 (numero, item, codigo_vendedor) select numero, item, codigo_vendedor from cupom1 where codigo_vendedor<>0; alter table mdfe add if not exists cep_origem varchar(10); alter table mdfe add if not exists cep_destino varchar(10); alter table cupom10 add if not exists numero integer; alter table cupom10 add if not exists enderecoentrega VARCHAR(60); alter table cupom10 add if not exists bairroentrega VARCHAR(30); alter table cupom10 add if not exists cidadeentrega VARCHAR(30); alter table cupom10 add if not exists obsentrega VARCHAR(60); CREATE TABLE IF NOT EXISTS "mdfe" ( "numero" AUTOINC, "nMDF" INTEGER, "dhEmi" DATE, "UFIni" VARCHAR(2), "UFFim" VARCHAR(2), "RNTRC" VARCHAR(20), "CIOT" VARCHAR(20), "veicTracao_cInt" VARCHAR(5), "veicTracao_placa" VARCHAR(10), "veicTracao_tara" INTEGER, "veicTracao_capKG" INTEGER, "veicTracao_capM3" INTEGER, "veicTracao_tpRod" INTEGER, "veicTracao_tpCar" INTEGER, "veicTracao_uf" VARCHAR(2), "veicTracao_Proprietario" INTEGER, "veicTracao_prop_CNPJCPF" VARCHAR(20), "veicTracao_prop_RNTRC" VARCHAR(20), "veicTracao_prop_xNome" VARCHAR(40), "veicTracao_prop_IE" VARCHAR(20), "veicTracao_prop_UF" VARCHAR(2), "veicTracao_prop_tpProp" INTEGER, "tot_qCTe" INTEGER, "tot_vCarga" FLOAT, "tot_cUnid" INTEGER, "tot_qCarga" FLOAT, "infAdic_infCpl" MEMO, "infAdic_infAdFisco" MEMO, "status" VARCHAR(1), "protocolo" VARCHAR(50), "XML_Antes_de_Enviar" VARCHAR(100), "XML_Enviado" VARCHAR(100), "CNPJ_CIOT" VARCHAR(20), "xSeg" VARCHAR(40), "nApol" VARCHAR(30), "CNPJCPF" VARCHAR(20), "nAver" VARCHAR(20), "respSeg" INTEGER, "cMDF" INTEGER, "tot_qNFe" INTEGER, "condutor1_nome" VARCHAR(25), "condutor1_cpf" VARCHAR(20), "condutor2_nome" VARCHAR(25), "condutor2_cpf" VARCHAR(20), "condutor3_nome" VARCHAR(25), "condutor3_cpf" VARCHAR(20), "veicTracao_Propriedade" INTEGER, "percurso" INTEGER, "CNPJ" VARCHAR(20), "aver" VARCHAR(30), "tomador" INTEGER, "tpCarga" INTEGER, "xProd" VARCHAR(40), "cEAN" VARCHAR(15), "NCM" VARCHAR(8), "cep_origem" VARCHAR(10), "cep_destino" VARCHAR(10), PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'MDFe - Manifesto de Documento EletrÙnico - Cabecalho' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); CREATE TABLE IF NOT EXISTS "mdfe1" ( "numero" INTEGER, "chNF" VARCHAR(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Notas do MDFe' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "numero" ON "mdfe1" ("numero"); CREATE TABLE IF NOT EXISTS "mdfe2" ( "numero" INTEGER, "cte_numero" INTEGER, "chCTe" VARCHAR(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Conhecimentos do MDFe' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); CREATE INDEX IF NOT EXISTS "numero" ON "mdfe2" ("numero"); CREATE TABLE IF NOT EXISTS "mdfe4" ( "numero" INTEGER, "uf" VARCHAR(2), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Percurso do MDFE' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); CREATE INDEX IF NOT EXISTS "numero" ON "mdfe4" ("numero"); CREATE TABLE IF NOT EXISTS "prod2" ( "codigo" INTEGER, "qtde" FLOAT, "dt_ultima_compra" DATE, "dt_ultima_venda" DATE, "dt_ultimo_inventario" DATE, "qtde_inventario" FLOAT, "codigo_filial" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Controle do estoque - Arquivo somente com a qtde e historico da ultima movimentacao' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); alter table prod2 add if not exists codigo_filial integer; CREATE TABLE IF NOT EXISTS "filiais" ( "codigo_filial" INTEGER, "descricao" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Nome das filiais' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE TABLE IF NOT EXISTS "integrae" ( "numero" AUTOINC, "nome_arquivo" VARCHAR(60), "tipo" INTEGER, "ativo" BOOLEAN, "enviado" BOOLEAN, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Arquivo de pacotes do integrador - Envio' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE TABLE IF NOT EXISTS "integrai" ( "data" DATE, "hora" TIME, "identificador" VARCHAR(20), "pacote_numero" INTEGER, "filial_origem" INTEGER, "filial_destino" INTEGER, "nome_arquivo" VARCHAR(60), "tipo" INTEGER, "ativo" BOOLEAN, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Pacotes do integrador - Recebidos' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "pacote_numero" ON "integrai" ("pacote_numero","filial_origem"); alter table cr add if not exists filial integer; alter table cp add if not exists filial integer; alter table caixa add if not exists filial integer; alter table despesas add if not exists filial integer; alter table cupom1 add if not exists tem_nfce boolean; alter table cupom1 add if not exists nfce_numero integer; alter table confignf add if not exists ICMS_INTER float; CREATE TABLE IF NOT EXISTS "cliente2" ( "codigo" INTEGER, "descricao" VARCHAR(60), "arquivo" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Imagens do cliente' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "codigo" ON "cliente2" ("codigo"); alter table compra add if not exists Valor_Soma_Produtos float; alter table confignf add if not exists Compra_Atualizar_Preco_Pela_Venda boolean; CREATE TABLE IF NOT EXISTS "etiquetas" ( "codigo" AUTOINC, "descricao" VARCHAR(60), "script" MEMO, PRIMARY KEY ("codigo") COMPRESS NONE DESCRIPTION 'Modelos de etiquetas' LOCALE CODE 0 USER MAJOR VERSION 4 ); alter table ficha add if not exists debito_liquido float; alter table ficha add if not exists credito_liquido float; alter table produtos add if not exists CEST varchar(8); CREATE TABLE IF NOT EXISTS "cest" ( "CEST" VARCHAR(8), "NCM" VARCHAR(8), "CONTEUDO" VARCHAR(200), PRIMARY KEY ("RecordID") COMPRESS NONE TEXT INDEX ("NCM") STOP WORDS 'A AN AND BE FOR HOW IN IS IT OF ON OR THAT THE THIS TO WAS WHAT WHEN WHICH WHY WILL' SPACE CHARS #1+#2+#3+#4+#5+#6+#7+#8+#9+#10+#11+#12+#13 +#14+#15+#16+#17+#18+#19+#20+#21+#22+#23 +#24+#25+#26+#27+#28+#29+#30+#31+#32+'*+'+ ',-./:;<=>\`' INCLUDE CHARS '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_ab'+ 'cdefghijklmnopqrstuvwxyzÄÅÇÉÑÖÜáà âäãåçéè'+ 'êëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑'+ '∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl'+ '‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛' DESCRIPTION 'Tabela do CEST' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "CEST" ON "cest" ("CEST"); CREATE INDEX IF NOT EXISTS "NCM" ON "cest" ("NCM"); alter table cf add if not exists IBPT_Trib_Fed float; alter table cf add if not exists IBPT_Trib_Est float; alter table cf add if not exists IBPT_Trib_Mun float; alter table cf add if not exists IBPT_Trib_Total float; alter table cf add if not exists ICMS_CST_CSOSN varchar(4); alter table cf add if not exists CFOP varchar(4); alter table cf add if not exists PIS_COFINS_CST varchar(4); alter table cf add if not exists PIS_Aliq float; alter table cf add if not exists COFINS_Aliq float; alter table produtos add if not exists CST_CSOSN_ICMS varchar(5); alter table produtos add if not exists CFOP varchar(5); alter table produtos add if not exists UN_Trib varchar(6); alter table produtos add if not exists Qtde_Trib float; alter table confignf add if not exists pGLP FLOAT; alter table confignf add if not exists pGNn FLOAT; alter table confignf add if not exists pGNi FLOAT; CREATE TABLE IF NOT EXISTS "prod4" ( "codigo" INTEGER, "descricao" VARCHAR(40), "arquivo" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Fotos do produto' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "codigo" ON "prod4" ("codigo"); alter table nfe1 add if not exists xPed varchar(20); alter table os2 add if not exists item_absoluto autoinc; alter table os1 add if not exists item_absoluto autoinc; alter table os5 add if not exists item_absoluto autoinc; alter table estoque add if not exists movimento float; alter table produtos add if not exists id_prod float; alter table nfe add if not exists indFinal boolean; alter table nfe add if not exists vol_transp_quantidade varchar(15); alter table nfe add if not exists vol_transp_especie varchar(20); alter table nfe add if not exists vol_transp_marca varchar(20); alter table nfe add if not exists vol_transp_numeracao varchar(20); alter table nfe add if not exists vol_transp_pesoliquido varchar(15); alter table nfe add if not exists vol_transp_pesobruto varchar(15); alter table operacao add if not exists indFinal boolean; alter table compra add if not exists Arquivo_XML varchar(60); alter table compra1 add if not exists VL_Despesas float; alter table nfe drop if exists codigocidade; alter table nfe drop if exists cnpj; alter table nfe drop if exists cep; alter table nfe drop if exists endereco; alter table nfe drop if exists nro; alter table nfe drop if exists complemento; alter table nfe drop if exists bairro; alter table nfe drop if exists codcidade; alter table nfe drop if exists cidade; alter table nfe drop if exists uf; alter table nfe drop if exists telefone; alter table nfe drop if exists ie; alter table nfe drop if exists nome; alter table nfe drop if exists email; alter table nfe drop if exists codigopais; alter table nfe drop if exists pais; alter table nfe drop if exists modelo; alter table nfe drop if exists indpag; alter table nfe drop if exists cuf; alter table nfe drop if exists cmunfg; alter table nfe drop if exists cdv; alter table nfe drop if exists efeito; alter table nfe drop if exists lote; alter table nfe drop if exists NFe_Emitir_Bloqueto; alter table nfe drop if exists NFe_Conta_Bloqueto; alter table nfe drop if exists NFE_Em_Manifesto; alter table nfe drop if exists Gerar_receita; alter table nfe drop if exists lancar_movimento_em_receitas; alter table nfe drop if exists receita_numero; alter table nfe drop if exists cupom; alter table nfe drop if exists idcidade_entrega; alter table nfe drop if exists verProc; alter table anfe drop if exists indpag; alter table anfe drop if exists modelo; alter table anfe drop if exists tpnf; alter table anfe drop if exists finnfe; alter table anfe drop if exists verproc; alter table anfe drop if exists cuf; alter table anfe drop if exists cmunfg; alter table anfe drop if exists tpimp; alter table anfe drop if exists tpemiss; alter table anfe drop if exists cdv; alter table anfe drop if exists tpamb; alter table anfe drop if exists cnpj; alter table anfe drop if exists cep; alter table anfe drop if exists endereco; alter table anfe drop if exists nro; alter table anfe drop if exists complemento; alter table anfe drop if exists bairro; alter table anfe drop if exists cidade; alter table anfe drop if exists uf; alter table anfe drop if exists telefone; alter table anfe drop if exists ie; alter table anfe drop if exists nome; alter table anfe drop if exists enderecoentrega; alter table anfe drop if exists cidadeentrega; alter table anfe drop if exists bairroentrega; alter table anfe drop if exists ufentrega; alter table anfe drop if exists codigopais; alter table anfe drop if exists pais; alter table anfe drop if exists vlmo; alter table anfe drop if exists baseissqn; alter table anfe drop if exists vlissqn; alter table anfe drop if exists obs1; alter table anfe drop if exists obs2; alter table anfe drop if exists obs3; alter table anfe drop if exists obs4; alter table anfe drop if exists obs5; alter table anfe drop if exists obs6; alter table anfe drop if exists lote; alter table anfe drop if exists "nfe-xml"; alter table anfe drop if exists "canc-xml"; alter table anfe drop if exists motivo; alter table anfe drop if exists id; alter table anfe add if not exists chNF varchar(60); alter table anfe drop if exists freteporcontade; alter table anfe drop if exists codigotransp; alter table anfe drop if exists cnpjtransp; alter table anfe drop if exists nometransp; alter table anfe drop if exists ietransp; alter table anfe drop if exists enderecotransp; alter table anfe drop if exists cidadetransp; alter table anfe drop if exists uftransp; alter table anfe drop if exists placa; alter table anfe drop if exists ufplaca; alter table anfe drop if exists rntc; alter table anfe drop if exists transp_email; alter table anfe drop if exists email; alter table anfe drop if exists Gerar_receita; alter table anfe drop if exists nro_entrega; alter table anfe drop if exists complemento_entrega; alter table anfe drop if exists codigo_operacao; alter table anfe drop if exists tpEmis; alter table confignf add if not exists COMPRA_Cadastrar_Automatico boolean; alter table compra1 add if not exists CEST varchar(10); alter table compra1 add if not exists Usar_Margem_do_Cadastro boolean; alter table cp drop if exists foto; alter table cp drop if exists os; alter table cp add if not exists nro autoinc; alter table caixa add if not exists nro autoinc; alter table caixa drop if exists foto; alter table despesas add if not exists nro autoinc; alter table despesas drop if exists foto; alter table cr drop if exists bordero; alter table cr drop if exists foto; alter table cr drop if exists coo_numero; alter table cr drop if exists os; alter table cr drop if exists exportado; alter table cr drop if exists retornado; alter table cr drop if exists NF_numero; alter table cp drop if exists exportado; alter table os4 add if not exists arquivo_documento varchar(100); alter table os4 drop if exists imagem; alter table os4 drop if exists pdf; alter table os4 drop if exists doc; alter table os4 drop if exists xml; alter table os drop if exists termo; alter table os drop if exists solicitante; alter table os drop if exists nome_solicitante; alter table os drop if exists fantasia_solicitante; alter table os drop if exists status_destaque; alter table compra drop if exists foto; alter table compra drop if exists xml; CREATE TABLE IF NOT EXISTS "compra3" ( "numero" INTEGER, "nome_terminal" VARCHAR(20), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Compras marcadas' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "compra3" ("numero"); alter table produtos drop if exists foto; alter table produtos drop if exists icms; alter table produtos drop if exists lmc; alter table produtos drop if exists inteiro; alter table confignf add if not exists obs7 varchar(100); alter table produtos drop if exists arquivo_foto; alter table produtos drop if exists tipo_comissao; alter table produtos drop if exists cadastro_ativo; alter table produtos drop if exists composto; alter table produtos drop if exists baixarestoque; alter table produtos drop if exists tipo; alter table produtos drop if exists exportar; alter table produtos add if not exists vBCSTRet float; alter table produtos add if not exists vICMSSTRet float; alter table produtos add if not exists pST float; alter table nfce1 add if not exists vBCSTRet float; alter table nfce1 add if not exists vICMSSTRet float; alter table nfce1 add if not exists pST float; alter table cupom1 add if not exists vBCSTRet float; alter table cupom1 add if not exists vICMSSTRet float; alter table cupom1 add if not exists pST float; alter table cupom1 drop if exists icms; alter table cupom1 drop if exists baixarestoque; alter table cupom1 drop if exists composto; alter table cupom1 drop if exists inteiro; alter table cupom1 drop if exists kit; alter table cupom1 drop if exists codigokit; alter table cupom1 drop if exists cupom_fiscal_emitido; alter table cupom1 drop if exists coo; alter table cupom1 drop if exists tipo_produto; alter table cupom1 drop if exists lmc; alter table cupom1 drop if exists bico_lmc; alter table anfe drop if exists codigocidade; alter table anfe drop if exists codcidade; alter table nfce drop if exists destinatario_fantasia; alter table nfce drop if exists destinatario_cnpj_cpf; alter table nfce drop if exists destinatario_ie; alter table nfce drop if exists destinatario_endereco; alter table nfce drop if exists destinatario_numero; alter table nfce drop if exists destinatario_complemento; alter table nfce drop if exists destinatario_bairro; alter table nfce drop if exists destinatario_ibge_cidade; alter table nfce drop if exists destinatario_cidade; alter table nfce drop if exists destinatario_uf; alter table nfce drop if exists destinatario_fone; alter table nfce drop if exists destinatario_email; alter table nfce drop if exists obs_linha1; alter table nfce drop if exists obs_linha2; alter table nfce drop if exists obs_linha3; alter table nfce drop if exists obs_linha4; alter table nfce drop if exists obs_linha5; alter table nfce drop if exists obs_linha6; alter table nfce drop if exists obs; alter table nfce drop if exists nfce_motivo_cancelamento; alter table cupom drop if exists loja; alter table cupom drop if exists caixa; alter table cupom drop if exists marca_executar; alter table cupom drop if exists nfce_email_enviado; alter table cupom drop if exists nfce_sms_enviado; alter table cupom drop if exists nfe_email_enviado; alter table cupom drop if exists exportado; alter table cupom drop if exists serie; alter table compra drop if exists modelo; alter table compra drop if exists serie; alter table compra drop if exists cnpj; alter table compra drop if exists ie; alter table compra drop if exists nome; alter table compra drop if exists fantasia; alter table compra drop if exists fone; alter table compra drop if exists cep; alter table compra drop if exists endereco; alter table compra drop if exists nro; alter table compra drop if exists complemento; alter table compra drop if exists bairro; alter table compra drop if exists idcidade; alter table compra drop if exists cidade; alter table compra drop if exists uf; alter table compra drop if exists cc; alter table compra1 drop if exists aliquota_icms_ecf; alter table compra1 drop if exists embalado; alter table compra1 drop if exists embalagem; alter table compra1 drop if exists qtdeembalado; alter table compra1 drop if exists vlembalagem; alter table compra1 drop if exists qtdeembalagens; alter table compra1 drop if exists cfop_contabil; alter table compra1 drop if exists cst_icms_contabil; alter table compra1 drop if exists atualizarestoque; alter table compra1 drop if exists atualizarcadastro; alter table compra1 drop if exists ref1; alter table compra1 drop if exists ref2; alter table compra1 drop if exists ref3; alter table compra1 drop if exists ref4; alter table compra1 drop if exists preco_alterado; alter table compra1 drop if exists Registro_alterado; alter table compra1 add if not exists vBCSTRet float; alter table compra1 add if not exists vICMSSTRet float; alter table compra1 add if not exists pST float; alter table nfe1 add if not exists vBCSTRet float; alter table nfe1 add if not exists vICMSSTRet float; alter table nfe1 add if not exists pST float; alter table nfce1 redefine if exists cfop varchar(4); alter table ficha add if not exists ID_Lcto autoinc; alter table pre drop if exists osnro; alter table pre drop if exists lotacao; alter table pre drop if exists codigo_absoluto_item_na_comanda; alter table pre drop if exists valor_consumacao_camarote; alter table pre drop if exists valor_pre_consumo_camarote; alter table pre drop if exists comanda_com_camarote; alter table pre drop if exists camarote_codigo_produto_consumo; alter table pre drop if exists sexo; alter table pre drop if exists agrupador; alter table pre drop if exists encerramento; alter table pre drop if exists osnro; alter table pre add if not exists Conferencia_Aprovada boolean; alter table pre add if not exists Conferente integer; alter table pre1 add if not exists Qtde_Conferida float; alter table funcion add if not exists user_senha varchar(80); alter table cupom add if not exists Conferencia_Aprovada boolean; alter table cupom add if not exists Conferente integer; alter table nfe add if not exists incluir_ipi_na_bcicms_st boolean; alter table nfe add if not exists incluir_ipi_na_bcicms boolean; alter table cupom add if not exists data_prevenda date; alter table cupom add if not exists hora_prevenda time; alter table cupom add if not exists data_conferencia date; alter table cupom add if not exists hora_conferencia time; alter table pre add if not exists data_conferencia date; alter table pre add if not exists hora_conferencia time; alter table formas add if not exists bandeira_cartao integer; alter table formas add if not exists tipo_financiamento varchar(2); alter table formas add if not exists rede varchar(20); alter table formas add if not exists tipo_operacao varchar(2); alter table cotacao1 add if not exists fornecedor integer; alter table cotacao1 add if not exists preco_cotado float; alter table cotacao add if not exists custo_cotado float; alter table cotacao2 add if not exists Valor_Frete float; alter table cotacao2 add if not exists Valor_Despesas float; alter table cotacao3 add if not exists Qtde_orcada float; alter table cotacao2 add if not exists total_liquido float; alter table cotacao2 add if not exists oc_numero integer; alter table cotacao1 add if not exists Qtde_orcada float; alter table cotacao1 add if not exists oc_numero integer; alter table cotacao1 add if not exists numero_envio integer; CREATE TABLE IF NOT EXISTS "oc" ( "numero" AUTOINC, "identificador" VARCHAR(13), "cotacao" VARCHAR(13), "data" DATE, "hora" TIME, "codigo" INTEGER, "total" FLOAT, "status" VARCHAR(1), PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'Ordem de compra' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE TABLE IF NOT EXISTS "oc1" ( "numero" INTEGER, "codigo" INTEGER, "ref" VARCHAR(20), "descricao" VARCHAR(60), "un" VARCHAR(2), "barra" VARCHAR(20), "marca" VARCHAR(30), "qtde" FLOAT, "valor" FLOAT, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Produtos da Ordem de Compra' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "oc1" ("numero"); alter table cupom add if not exists Turno_Numero integer; alter table formas add if not exists taxa_encargo float; alter table cupom1 add if not exists arredondamento float; alter table cupom1 add if not exists vl_desconto_unit float; alter table cupom1 drop if exists informacao_complementar; CREATE TABLE IF NOT EXISTS "pdv2" ( "numero" INTEGER, "codigo" INTEGER, "qtde" FLOAT, "valor" FLOAT, "data" DATE, "hora" TIME, "operador" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Itens cancelados antes fechar a vena' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "pdv2" ("numero"); alter table integrae add if not exists CNPJ_CPF_do_Destinatario varchar(20); alter table integrae add if not exists data date; alter table integrae add if not exists hora time; alter table integrae add if not exists pacote_numero integer; CREATE TABLE IF NOT EXISTS "integra" ( "codigo" INTEGER, "nome" VARCHAR(60), "cnpj" VARCHAR(20), "data_base" DATE, "certificado_serie" VARCHAR(20), "data_limite" DATE, "filial" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Clientes Integradores do grupo' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nome" ON "integra" ("nome"); alter table cliente add if not exists data_alteracao date; alter table cliente add if not exists hora_alteracao time; alter table sistema add if not exists CR_Numero_sequencial float; alter table funcion add if not exists id varchar(20); alter table compra2 add if not exists id varchar(20); alter table sistema add if not exists CLI_Numero_sequencial integer; alter table nfe1 add if not exists CEST_NCM varchar(10); alter table balanco add if not exists qtde_itens float; alter table balanco add if not exists qtde_produtos float; CREATE INDEX IF NOT EXISTS "estoque" ON "produtos" ("similar","qtde" DESC); alter table os1 add if not exists prod_baixado_do_estoque boolean; alter table sistema add if not exists OS_Numero_sequencial integer; alter table sistema add if not exists CUPOM_Numero_sequencial integer; alter table sistema add if not exists COMPRA_Numero_sequencial integer; alter table sistema add if not exists PROD_Numero_sequencial integer; alter table balanco add if not exists convenio float; alter table sistema add if not exists HOST_TPC_IP varchar(20); alter table confignf add if not exists NFCE_Informar_Responsavel_Tecnico boolean; alter table cupom2 add if not exists tpIntegra integer; alter table cupom2 add if not exists CNPJ varchar(20); alter table cupom2 add if not exists tBand integer; alter table cupom2 add if not exists cAut varchar(20); alter table sistema add if not exists codigo integer; alter table cupom add if not exists marca boolean; alter table produtos add if not exists cBenef varchar(10); alter table nfe1 add if not exists cBenef varchar(10); alter table sistema add if not exists NFCe_Numero_sequencial integer; CREATE TABLE IF NOT EXISTS "dfe" ( "numero" AUTOINC, "dhResp" TIMESTAMP, "ultNSU" VARCHAR(15), "maxNSU" VARCHAR(15), "NSU" VARCHAR(15), "chNFe" VARCHAR(50), "CNPJ" VARCHAR(20), "xNome" VARCHAR(60), "IE" VARCHAR(20), "dhEmi" TIMESTAMP, "vNF" FLOAT, "dhRecbto" TIMESTAMP, "nProt" VARCHAR(20), "manifestada" BOOLEAN, "baixada" BOOLEAN, "marcada" BOOLEAN, "rejeitada" BOOLEAN, "arquivada" BOOLEAN, PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'DistribuiÁ„o de Documentos EletrÙnicos' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 8 ); CREATE INDEX IF NOT EXISTS "chave" ON "dfe" ("chNFe"); CREATE INDEX IF NOT EXISTS "emissao" ON "dfe" ("dhEmi"); alter table sistema add if not exists dfe_Ultimo_NSU varchar(20); alter table confignf add if not exists INTEGRADOR_Usuario_CNPJ varchar(20); alter table confignf add if not exists INTEGRADOR_Modo_de_Integracao integer; alter table confignf add if not exists CNPJ_Principal varchar(20); alter table mdfe add if not exists tpCarga integer; alter table mdfe add if not exists xProd varchar(40); alter table mdfe add if not exists cEAN varchar(15); alter table mdfe add if not exists NCM varchar(8); CREATE TABLE IF NOT EXISTS "cupom8" ( "numero" INTEGER, "Conferencia_Aprovada" BOOLEAN, "Conferente" INTEGER, "data_conferencia" DATE, "hora_conferencia" TIME, "data_prevenda" DATE, "hora_prevenda" TIME, PRIMARY KEY ("RecordID") COMPRESS NONE LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom8" ("numero"); alter table cupom drop if exists Conferencia_Aprovada; alter table cupom drop if exists Conferente; alter table cupom drop if exists data_conferencia; alter table cupom drop if exists hora_conferencia; alter table cupom drop if exists data_prevenda; alter table cupom drop if exists hora_prevenda; DROP INDEX if exists cupom."id1"; alter table cupom drop if exists id1; alter table cupom drop if exists id2; alter table cupom drop if exists id3; alter table cupom drop if exists id4; alter table cupom drop if exists descricao_id1; alter table cupom drop if exists descricao_id2; alter table cupom drop if exists descricao_id3; alter table cupom drop if exists descricao_id4; alter table cupom9 add if not exists id1 varchar(10); alter table cupom9 add if not exists id2 varchar(10); alter table cupom9 add if not exists id3 varchar(10); alter table cupom9 add if not exists id4 varchar(10); alter table cupom9 add if not exists descricao_id1 varchar(60); alter table cupom9 add if not exists descricao_id2 varchar(60); alter table cupom9 add if not exists descricao_id3 varchar(60); alter table cupom9 add if not exists descricao_id4 varchar(60); alter table cupom8 add if not exists Conferencia_Aprovada boolean; alter table cupom8 add if not exists Conferente integer; alter table cupom8 add if not exists data_conferencia date; alter table cupom8 add if not exists hora_conferencia time; alter table cupom8 add if not exists data_prevenda date; alter table cupom8 add if not exists hora_prevenda time; CREATE TABLE IF NOT EXISTS "cupom9" ( "numero" INTEGER, "id1" VARCHAR(30), "id2" VARCHAR(30), "id3" VARCHAR(30), "id4" VARCHAR(60), "descricao_id1" VARCHAR(20), "descricao_id2" VARCHAR(20), "descricao_id3" VARCHAR(20), "descricao_id4" VARCHAR(20), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'InformaÁıes complementares da venda' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom9" ("numero"); CREATE TABLE IF NOT EXISTS "cupom10" ( "numero" INTEGER, "enderecoentrega" VARCHAR(60), "bairroentrega" VARCHAR(30), "cidadeentrega" VARCHAR(30), "obsentrega" VARCHAR(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'EndereÁo de entrega' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); alter table cupom drop if exists enderecoentrega; alter table cupom drop if exists bairroentrega; alter table cupom drop if exists cidadeentrega; alter table cupom drop if exists obsentrega; CREATE INDEX IF NOT EXISTS "numero" ON "cupom10" ("numero"); DROP INDEX if exists cupom."coo"; DROP INDEX if exists cupom."numero_coo"; alter table cupom drop if exists vl_st; alter table cupom drop if exists cupomfiscal; alter table cupom drop if exists os; alter table cupom drop if exists nf; alter table cupom drop if exists osnumero; alter table cupom drop if exists nfnumero; alter table cupom drop if exists pedidonumero; alter table cupom drop if exists cupomfiscalnumero; alter table cupom drop if exists tem_nfce; alter table cupom drop if exists valor_vale; CREATE TABLE IF NOT EXISTS "cupom13" ( "numero" INTEGER, "item" INTEGER, "serie" VARCHAR(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Numero de sÈrie do ÃŒtem' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom13" ("numero"); CREATE TABLE IF NOT EXISTS "cupom14" ( "numero" INTEGER, "item" INTEGER, "qtde_devolvida" FLOAT, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Quantidade devolvida de ÃŒtem' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom14" ("numero"); CREATE TABLE IF NOT EXISTS "cupom15" ( "numero" INTEGER, "item" INTEGER, "codigo_vendedor" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Vendedores dos itens' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom15" ("codigo_vendedor"); CREATE TABLE IF NOT EXISTS "cupom16" ( "numero" INTEGER, "cr_nro" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'TÃŒtulos pagos na receita' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "cupom16" ("numero"); alter table mdfe add if not exists cep_origem varchar(10); alter table mdfe add if not exists cep_destino varchar(10); alter table etiquetas add if not exists ETQ_Avanco integer; alter table etiquetas add if not exists ETQ_BackFeed boolean; alter table etiquetas add if not exists ETQ_DPI integer; alter table etiquetas add if not exists ETQ_MargemEsquerda integer; alter table etiquetas add if not exists ETQ_Modelo integer; alter table etiquetas add if not exists ETQ_Origem integer; alter table etiquetas add if not exists ETQ_PaginaDeCodigo integer; alter table etiquetas add if not exists ETQ_Temperatura integer; alter table etiquetas add if not exists ETQ_Unidade integer; alter table etiquetas add if not exists ETQ_Velocidade integer; alter table etiquetas add if not exists ETQ_PY integer; alter table etiquetas add if not exists ETQ_PX integer; alter table etiquetas add if not exists ETQ_Altura integer; alter table etiquetas add if not exists ETQ_Largura integer; CREATE TABLE IF NOT EXISTS "etiq1" ( "numero" INTEGER, "operacao" INTEGER, "Horizontal" INTEGER, "Vertical" INTEGER, "Orientacao" INTEGER, "fonte" VARCHAR(10), "MultiplicadorH" INTEGER, "MultiplicadorV" INTEGER, "SubFonte" INTEGER, "ImprimirReverso" BOOLEAN, "TipoBarras" INTEGER, "LarguraBarraLarga" INTEGER, "LarguraBarraFina" INTEGER, "AlturaCodBarras" INTEGER, "ExibeCodigo" INTEGER, "Largura" INTEGER, "Altura" INTEGER, "EspessuraVertical" INTEGER, "EspessuraHorizontal" INTEGER, "LarguraModulo" INTEGER, "ErrorLevel" INTEGER, "Tipo" INTEGER, "dado_fonte" INTEGER, "dado_campo" INTEGER, "dado_tipo" INTEGER, "dado_literal" VARCHAR(60), "dado_pinicio" INTEGER, "dado_pfim" INTEGER, "dado_mascara" VARCHAR(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Itens das etiquetas' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "numero" ON "etiq1" ("numero"); CREATE TABLE IF NOT EXISTS "etiq2" ( "codigo" AUTOINC, "dado_fonte" INTEGER, "descricao" VARCHAR(20), "dado" VARCHAR(60), "DataType" INTEGER, PRIMARY KEY ("codigo") COMPRESS NONE DESCRIPTION 'Fonte de dados para etiquetas' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "dado_fonte" ON "etiq2" ("dado_fonte"); alter table etiquetas add if not exists ETQ_Impressao_por_Script boolean; alter table produtos add if not exists codigo_balanca integer; CREATE TABLE IF NOT EXISTS "eventos" ( "numero" AUTOINC, "data" DATE, "hora" TIME, "codigo" INTEGER, "evento" VARCHAR(1), "codigo_evento" INTEGER, "status" INTEGER, PRIMARY KEY ("numero") COMPRESS NONE DESCRIPTION 'Eventos' LOCALE CODE 0 USER MAJOR VERSION 2 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "codigo" ON "eventos" ("codigo"); alter table sistema add if not exists CODIGO_Zeladoria varchar(3); CREATE TABLE IF NOT EXISTS "ceventos" ( "codigo" AUTOINC, "descricao" VARCHAR(40), "cor_frente" VARCHAR(20), "cor_fundo" VARCHAR(20), "acao" INTEGER, "arquivo_wav" VARCHAR(80), "ciclos_do_som" INTEGER, PRIMARY KEY ("codigo") COMPRESS NONE DESCRIPTION 'ConfiguraÁ„o dos eventos de monitoramento' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE TABLE IF NOT EXISTS "revento" ( "codigo" VARCHAR(1), "evento" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Direcionamento do evento recebido do r·dio para a tela' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "evento" ON "revento" ("codigo"); CREATE TABLE IF NOT EXISTS "excecao" ( "codigo" VARCHAR(1), "evento" INTEGER, "cliente" INTEGER, "tipo" INTEGER, "dti" TIMESTAMP, "dtf" TIMESTAMP, "descricao" VARCHAR(80), "domingo" BOOLEAN, "segunda" BOOLEAN, "terca" BOOLEAN, "quarta" BOOLEAN, "quinta" BOOLEAN, "sexta" BOOLEAN, "sabado" BOOLEAN, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'ProgramaÁ„o de excess„o para eventos' LOCALE CODE 0 USER MAJOR VERSION 4 USER MINOR VERSION 1 ); CREATE INDEX IF NOT EXISTS "cliente" ON "excecao" ("cliente"); CREATE INDEX IF NOT EXISTS "codigo" ON "excecao" ("codigo"); alter table cliente add if not exists MGM_Codigo integer; alter table os1 add if not exists obs_pc varchar(60); alter table os8 add if not exists obs_pc varchar(60); alter table confignf add if not exists simples boolean; alter table os add if not exists desctipoos varchar(40); alter table os add if not exists descsituacao varchar(15); alter table os add if not exists descpgto varchar(20); alter table os add if not exists descid1cl varchar(20); alter table os add if not exists descid2cl varchar(20); alter table os add if not exists descid3cl varchar(20); alter table os add if not exists desctipoobjeto varchar(40); alter table os add if not exists nomefunc varchar(30); alter table os add if not exists descid1 varchar(15); alter table os add if not exists descid2 varchar(15); alter table os add if not exists descid3 varchar(15); alter table os add if not exists descid4 varchar(15); alter table os add if not exists descid5 varchar(15); alter table os add if not exists descid6 varchar(15); alter table os add if not exists descid7 varchar(15); update os set funcion=1 where funcion=null; alter table compra add if not exists obs memo; alter table cupom1 add if not exists custo float; alter table cupom1 add if not exists custototal float; alter table cupom1 add if not exists vldesconto float; alter table os1 add if not exists custototal float; alter table configos add if not exists semref boolean; alter table configos add if not exists funcion_responsavel integer; alter table configos add if not exists funcionario_auto boolean; alter table configos add if not exists valores_no_edt boolean; alter table configos add if not exists pdv boolean; alter table configos add if not exists concluidas_TA boolean; update cupom1 set custototal=custo*qtde; update os1 set custototal=custo*qtde; alter table cheque add if not exists status varchar(1); alter table cupom add if not exists chave_compra varchar(100); alter table compra add if not exists obs memo; alter table compra add if not exists devolvida_completa boolean; alter table compra1 add if not exists devolvido boolean; alter table compra1 add if not exists marca boolean; alter table compra1 add if not exists editado boolean; alter table confignf add if not exists altera_venda boolean; alter table confignf add if not exists altera_custo boolean; alter table confignf add if not exists margempadrao boolean; alter table confignf add if not exists margem float; alter table cupom add if not exists osnumero integer; alter table cupom add if not exists os boolean; alter table cupom add if not exists taxa_desc_total float; alter table ficha add if not exists vl_desconto float; alter table cr add if not exists obs memo; CREATE INDEX IF NOT EXISTS "dtnascim" ON "cliente" ("dtnascim"); CREATE TABLE IF NOT EXISTS "osrev" ( "nro" AUTOINC, "codigo" integer, "objeto" integer, "data" date, "descricao" varchar(60), "funcionario" integer, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Revisões de OS' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nro" ON "osrev" ("nro"); CREATE TABLE IF NOT EXISTS "osrev1" ( "nro" integer, "codigo" integer, "qtde" float, "descricao" varchar(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Produtos das revisões' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nro" ON "osrev1" ("nro"); CREATE TABLE IF NOT EXISTS "osrev2" ( "nro" integer, "codigo" integer, "descricao" varchar(30), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Serviços das revisões' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nro" ON "osrev2" ("nro"); CREATE TABLE IF NOT EXISTS "osrev3" ( "nro" integer, "descricao" varchar(60), PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'despesas das revisões' LOCALE CODE 0 USER MAJOR VERSION 4 ); CREATE INDEX IF NOT EXISTS "nro" ON "osrev3" ("nro"); alter table sistema add if not exists OSREV_Numero_sequencial integer; alter table configos add if not exists alerta_revisao integer; alter table configos add if not exists osrev_sempre boolean; alter table configos add if not exists dt_ultima_abert_os date; update sistema set osrev_numero_sequencial=0 where osrev_numero_sequencial=null; DROP INDEX if exists cupom1."ref"; DROP INDEX if exists cupom1."descricao"; DROP INDEX if exists cupom1."serie"; alter table cupom1 drop if exists ref; alter table cupom1 drop if exists descricao; alter table cupom1 drop if exists un; alter table cupom1 drop if exists classe; alter table cupom1 drop if exists linha; alter table cupom1 drop if exists ipi; alter table cupom1 drop if exists destino; alter table cupom1 drop if exists nrvenda; alter table cupom1 drop if exists tipo; alter table cupom1 drop if exists codigocli; alter table cupom1 drop if exists codigo_atendente; alter table cupom1 drop if exists codigo_grupo; alter table cupom1 drop if exists codigo_cliente; alter table cupom1 drop if exists data_venda; alter table cupom1 drop if exists hora_venda; alter table cupom1 drop if exists NFe_emitido; alter table cupom1 drop if exists NFe_nro; alter table cupom1 drop if exists estornado; alter table cupom1 drop if exists valor_produtos_cupom; alter table cupom1 drop if exists valor_arredondamento; alter table cupom1 drop if exists valor_descontos; alter table cupom1 drop if exists similar; alter table cupom1 drop if exists filial_geradora_da_receita; alter table cupom1 drop if exists numero_receita_filial; alter table cupom1 drop if exists tem_nfce; alter table cupom1 drop if exists nfce_numero; alter table cupom1 drop if exists vBCSTRet; alter table cupom1 drop if exists vICMSSTRet; alter table cupom1 drop if exists pST; alter table cupom1 drop if exists arredondamento; alter table cupom1 drop if exists vl_desconto_unit; alter table cupom1 drop if exists marca; alter table cupom1 drop if exists estoqueatual; alter table cupom1 drop if exists balanca; alter table cupom1 drop if exists promocao; alter table cupom1 drop if exists serie; alter table cupom1 drop if exists estoque; alter table cupom1 drop if exists codigo_vendedor; alter table cupom1 drop if exists qtde_devolvida; alter table cupom1 drop if exists venda; alter table cupom1 drop if exists icms; alter table cupom1 drop if exists baixarestoque; alter table cupom1 drop if exists composto; alter table cupom1 drop if exists inteiro; alter table cupom1 drop if exists kit; alter table cupom1 drop if exists codigokit; alter table cupom1 drop if exists cupom_fiscal_emitido; alter table cupom1 drop if exists coo; alter table cupom1 drop if exists tipo_produto; alter table cupom1 drop if exists lmc; alter table cupom1 drop if exists bico_lmc; update os1 set obs_pc=descricao where descricao<>''; alter table pre1 add if not exists descricao_alternativa varchar(60); alter table os add if not exists data_entrega date; alter table os add if not exists hora_entrega time; alter table os add if not exists lembreteobj varchar(70); alter table objeto add if not exists lembrete varchar(70); alter table cupom5 add if not exists compra_origem_nro integer; alter table devolve add if not exists nro_compra integer; alter table configos add if not exists imprime_funcion boolean; alter table pdv1 add if not exists os integer; CREATE INDEX IF NOT EXISTS "ie" ON "cliente" ("ie"); alter table nfe add if not exists Intermed_codigo integer; alter table nfe add if not exists indPres integer; alter table configos add if not exists substituir_descricao_item boolean; alter table os1 add if not exists substituir_descricao_item boolean; alter table os add if not exists ordem_prod integer; alter table osrev add if not exists ordem_prod integer; alter table osrev1 add if not exists ordem integer; alter table nfe add if not exists hEmi time; alter table confignf add if not exists margem_zerada boolean; alter table confignf add if not exists NFCe_pag_igual_prod_os boolean; alter table sistema add if not exists dt_baixou_licenca date; alter table cupom add if not exists nfe boolean; alter table confignf add if not exists obs_os boolean; insert into acesso (codigo, descricao) values(310,'ALTERAÇÃO EM MASSA DE CUSTO/VENDA'); CREATE INDEX IF NOT EXISTS "alteracao" ON "produtos" ("data_ultima_atualizacao" DESC,"hora_ultima_atualizacao" DESC); alter table pre add if not exists osnro integer; alter table confignf add if not exists desconto_so_prodos boolean; alter table operacao add if not exists produtos_cfop_st varchar(3); alter table operacao add if not exists produtos_csosn_st varchar(3); alter table operacao add if not exists produtos_cfop_ANP varchar(3); alter table operacao add if not exists produtos_csosn_ANP varchar(3); alter table operacao add if not exists produtos_cfop_interestadual varchar(3); alter table operacao add if not exists produtos_csosn_interestadual varchar(3); alter table operacao add if not exists produtos_cfop_st_interestadual varchar(3); alter table operacao add if not exists produtos_csosn_st_interestadual varchar(3); alter table operacao add if not exists produtos_cfop_ANP_interestadual varchar(3); alter table operacao add if not exists produtos_csosnANP_interestadual varchar(3); CREATE TABLE IF NOT EXISTS "listadecompras" ( "codigo" INTEGER, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Lista de produtos a comprar' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); alter table confignf add if not exists PAYER_login varchar(60); alter table confignf add if not exists PAYER_Senha varchar(30); alter table formas add if not exists TEF_PAYER_paymentMethod integer; alter table formas add if not exists TEF_PAYER_paymentType integer; alter table formas add if not exists TEF_PAYER_paymentMethodSubType integer; alter table desdobra add if not exists NSU varchar(40); alter table desdobra add if not exists rede varchar(30); alter table desdobra add if not exists cAut float; alter table cupom2 add if not exists NSU varchar(40); alter table cupom2 add if not exists rede varchar(30); alter table cupom2 add if not exists cAut float; alter table cupom2 add if not exists tef_doc varchar(20); CREATE TABLE IF NOT EXISTS "tef" ( "numero" AUTOINC, "documento" varchar(20), "valor" float, "quando" timestamp, "versao" varchar(10), "chave" varchar(40), "codigo_de_controle" varchar(60), "dh" timestamp, "NSU" varchar(40), "Rede_Adquirente" varchar(30), "Pagamento_Tipo" varchar(20), "Pagamento_Cartao" varchar(30), "Codigo_de_Autorizacao" varchar(30), "Documento_numero" varchar(20), "operacao" integer, PRIMARY KEY ("RecordID") COMPRESS NONE DESCRIPTION 'Registro de transação TEF' LOCALE CODE 0 USER MAJOR VERSION 3 USER MINOR VERSION 5 ); CREATE INDEX IF NOT EXISTS "numero" ON "tef" ("numero"); CREATE INDEX IF NOT EXISTS "nsu" ON "tef" ("nsu"); CREATE INDEX IF NOT EXISTS "Codigo_de_Autorizacao" ON "tef" ("Codigo_de_Autorizacao"); alter table produtos add if not exists apagado boolean; alter table configos add if not exists ordena_prod_por_grupo boolean; alter table os1 add if not exists codigo_grupo integer; CREATE INDEX IF NOT EXISTS "codigo_grupo" ON "os1" ("numero","codigo_grupo","ordem"); alter table listadecompras add if not exists data_insercao date; alter table listadecompras add if not exists funcion integer; alter table listadecompras add if not exists terminal varchar(25); alter table cupom add if not exists vl_frete float;