diff --git a/l10n_br_cte/demo/fiscal_document_demo.xml b/l10n_br_cte/demo/fiscal_document_demo.xml index 4225939b7dde..10a89b48813b 100644 --- a/l10n_br_cte/demo/fiscal_document_demo.xml +++ b/l10n_br_cte/demo/fiscal_document_demo.xml @@ -1,6 +1,9 @@ + + + @@ -12,7 +15,7 @@ 573 1 - 35240708318053000167570010000000311040645898 + 35240781583054000129570010000057311040645894 2 oca @@ -102,23 +105,24 @@ - - + + + - + 574 1 - 35240708318053000167570010000000311040445899 + 35240781583054000129570010000057411040645890 2 oca 3 - 01 + 02 @@ -148,40 +152,40 @@ - + - + 00 Volume 1000.0 - + 01 Peso Bruto 500.0 - + 03 Unidade 2 - - - + + + Frete @@ -193,19 +197,19 @@ - + - + - - + + 575 1 - 35240608318053000167570010000000311040645894 + 35240781583054000129570010000057511040645897 2 oca 3 - 02 + 03 @@ -250,40 +254,40 @@ - + - + 00 Volume 1000.0 - + 01 Peso Bruto 500.0 - + 03 Unidade 2 - - - + + + Frete @@ -295,14 +299,323 @@ - + - + + + + + + + + + + + 576 + 1 + 35240781583054000129570010000057611040645893 + 2 + oca + + 3 + 04 + + + + + + + + + + + + + + + out + + XYZ Product + Other Product Data + 1000 + 1000 + + + + + + + 00 + Volume + 1000.0 + + + + + 01 + Peso Bruto + 500.0 + + + + + 03 + Unidade + 2 + + + + + + Frete + + + 100 + 1 + out + + + + + + + + + + + + + + + + + + + + 577 + 1 + 35240781583054000129570010000057711040645890 + 2 + oca + + 3 + 05 + + + + + + + + + + + + + + + out + + XYZ Product + Other Product Data + 1000 + 1000 + + + + + + + 00 + Volume + 1000.0 + + + + + 01 + Peso Bruto + 500.0 + + + + + 03 + Unidade + 2 + + + + + + Frete + + + 100 + 1 + out + + + + + + + + + + + + + + + + + + + + + + + 573 + 1 + 35240759594315000157570010000057311040445890 + 2 + oca + + 3 + 01 + + + + + + + + + + + + + + + out + + XYZ Product + Other Product Data + 1000 + 1000 + + + + + + + 00 + Volume + 1000.0 + + + + + 01 + Peso Bruto + 500.0 + + + + + 03 + Unidade + 2 + + + + + + Frete + + + 100 + 1 + out + + + + + + + + + + diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040445899.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240759594315000157570010000057311040445890.xml similarity index 97% rename from l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040445899.xml rename to l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240759594315000157570010000057311040445890.xml index 826c0bba9cd5..e1024ff57eda 100644 --- a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040445899.xml +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240759594315000157570010000057311040445890.xml @@ -1,6 +1,6 @@ - + 35 57000111 @@ -8,11 +8,11 @@ Venda 57 1 - 574 + 573 2020-01-01T12:00:00+01:00 1 1 - 9 + 0 2 0 0 diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040645898.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057311040645894.xml similarity index 98% rename from l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040645898.xml rename to l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057311040645894.xml index f3655a190d86..b13349b795e7 100644 --- a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240708318053000167570010000000311040645898.xml +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057311040645894.xml @@ -1,6 +1,6 @@ - + 35 57000111 @@ -12,7 +12,7 @@ 2020-01-01T12:00:00+01:00 1 1 - 8 + 4 2 0 0 diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240608318053000167570010000000311040645894.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057411040645890.xml similarity index 98% rename from l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240608318053000167570010000000311040645894.xml rename to l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057411040645890.xml index 10a49c086467..52c5a48d0477 100644 --- a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240608318053000167570010000000311040645894.xml +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057411040645890.xml @@ -1,6 +1,6 @@ - + 35 57000111 @@ -8,11 +8,11 @@ Venda 57 1 - 575 + 574 2020-01-01T12:00:00+01:00 1 1 - 4 + 0 2 0 0 diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057511040645897.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057511040645897.xml new file mode 100644 index 000000000000..6c2f59d1eb4f --- /dev/null +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057511040645897.xml @@ -0,0 +1,196 @@ + + + + + 35 + 57000111 + 5352 + Venda + 57 + 1 + 575 + 2020-01-01T12:00:00+01:00 + 1 + 1 + 7 + 2 + 0 + 0 + Odoo Brasil OCA v14 + 3550308 + São Paulo + SP + 03 + 0 + 3550308 + São Paulo + SP + 1302603 + Manaus + AM + 1 + 1 + + 3 + + + + Documento emitido por: Marc Demo + + Documento emitido por: Marc Demo + + + + 81583054000129 + 078016350838 + Empresa Lucro Presumido Ltda + Empresa Lucro Presumido + + Avenida Paulista + 1 + Bela Vista + 3550308 + São Paulo + 01311000 + SP + 551199999999 + + 3 + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + Cliente 2 -SP - Simples Nacional + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 84148732000113 + 095693211 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221458888 + + Avenida Javari + s/n + Lote 9.45/15E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente4@cliente4.com.br + + + 46081676000158 + 782175040 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221459999 + 101362102 + + Avenida Javari + s/n + Lote 8.45/30E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente3@cliente3.com.br + + + 47.00 + 47.00 + + Frete + 47.00 + + + + + + 00 + 47.00 + 18.00 + 8.46 + + + + + + 1000.00 + XYZ Product + Other Product Data + + 00 + Volume + 1000.0000 + + + 01 + Peso Bruto + 500.0000 + + + 03 + Unidade + 2.0000 + + 1000.00 + + + + + 47.00 + 1200.00 + Navio Mercante 123 + + Balsa A + + + Balsa B + + Viagem001 + S + IRIN12345 + 0 + + + + + diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057611040645893.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057611040645893.xml new file mode 100644 index 000000000000..5afc0101f345 --- /dev/null +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057611040645893.xml @@ -0,0 +1,185 @@ + + + + + 35 + 57000111 + 5352 + Venda + 57 + 1 + 576 + 2020-01-01T12:00:00+01:00 + 1 + 1 + 3 + 2 + 0 + 0 + Odoo Brasil OCA v14 + 3550308 + São Paulo + SP + 04 + 0 + 3550308 + São Paulo + SP + 1302603 + Manaus + AM + 1 + 1 + + 3 + + + + Documento emitido por: Marc Demo + + Documento emitido por: Marc Demo + + + + 81583054000129 + 078016350838 + Empresa Lucro Presumido Ltda + Empresa Lucro Presumido + + Avenida Paulista + 1 + Bela Vista + 3550308 + São Paulo + 01311000 + SP + 551199999999 + + 3 + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + Cliente 2 -SP - Simples Nacional + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 84148732000113 + 095693211 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221458888 + + Avenida Javari + s/n + Lote 9.45/15E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente4@cliente4.com.br + + + 46081676000158 + 782175040 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221459999 + 101362102 + + Avenida Javari + s/n + Lote 8.45/30E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente3@cliente3.com.br + + + 47.00 + 47.00 + + Frete + 47.00 + + + + + + 00 + 47.00 + 18.00 + 8.46 + + + + + + 1000.00 + XYZ Product + Other Product Data + + 00 + Volume + 1000.0000 + + + 01 + Peso Bruto + 500.0000 + + + 03 + Unidade + 2.0000 + + 1000.00 + + + + + 1 + Fluxo Norte-Sul + + + + + diff --git a/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057711040645890.xml b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057711040645890.xml new file mode 100644 index 000000000000..a40bf7e2b33b --- /dev/null +++ b/l10n_br_cte/tests/cte/v4_00/leiauteCTe/CTe35240781583054000129570010000057711040645890.xml @@ -0,0 +1,186 @@ + + + + + 35 + 57000111 + 5352 + Venda + 57 + 1 + 577 + 2020-01-01T12:00:00+01:00 + 1 + 1 + 0 + 2 + 0 + 0 + Odoo Brasil OCA v14 + 3550308 + São Paulo + SP + 05 + 0 + 3550308 + São Paulo + SP + 1302603 + Manaus + AM + 1 + 1 + + 3 + + + + Documento emitido por: Marc Demo + + Documento emitido por: Marc Demo + + + + 81583054000129 + 078016350838 + Empresa Lucro Presumido Ltda + Empresa Lucro Presumido + + Avenida Paulista + 1 + Bela Vista + 3550308 + São Paulo + 01311000 + SP + 551199999999 + + 3 + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + Cliente 2 -SP - Simples Nacional + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 12046835000161 + 887273429152 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 1177777777 + + Avenida Doutor Chucri Zaidan + 950 + Vila Cordeiro + 3550308 + São Paulo + 04583110 + SP + 1058 + Brasil + + cliente2@cliente2.com.br + + + 84148732000113 + 095693211 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221458888 + + Avenida Javari + s/n + Lote 9.45/15E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente4@cliente4.com.br + + + 46081676000158 + 782175040 + CTE EMITIDO EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL + 9221459999 + 101362102 + + Avenida Javari + s/n + Lote 8.45/30E + Distrito Industrial + 1302603 + Manaus + 69075110 + AM + 1058 + Brasil + + cliente3@cliente3.com.br + + + 47.00 + 47.00 + + Frete + 47.00 + + + + + + 00 + 47.00 + 18.00 + 8.46 + + + + + + 1000.00 + XYZ Product + Other Product Data + + 00 + Volume + 1000.0000 + + + 01 + Peso Bruto + 500.0000 + + + 03 + Unidade + 2.0000 + + 1000.00 + + + + + 1500.000000 + 2024-01-01 + 2024-12-31 + + + + + diff --git a/l10n_br_cte/tests/test_cte_serialize.py b/l10n_br_cte/tests/test_cte_serialize.py index e94b2496bb85..fb424f849c65 100644 --- a/l10n_br_cte/tests/test_cte_serialize.py +++ b/l10n_br_cte/tests/test_cte_serialize.py @@ -51,6 +51,8 @@ def prepare_test_cte(self, cte): self.prepare_modal_aquaviario_data(cte) elif cte.cte_modal == "04": self.prepare_modal_ferroviario_data(cte) + elif cte.cte_modal == "05": + self.prepare_modal_dutoviario_data(cte) cte._document_export() @@ -114,56 +116,78 @@ def prepare_modal_aereo_data(self, cte): ] def prepare_modal_aquaviario_data(self, cte): - pass - # cte.cte40_irin = "1234567899" - # cte.cte40_tpEmb = "01" - # cte.cte40_cEmbar = "123456" - # cte.cte40_xEmbar = "teste" - # cte.cte40_nViag = "123456" - # cte.cte40_cPrtEmb = "BRADR" - # cte.cte40_cPrtDest = "BRAFU" - # cte.cte40_infTermCarreg = [ - # (0, 0, {"loading_harbor": "BRADR"}), - # (0, 0, {"loading_harbor": "BRANT"}), - # ] - # cte.cte40_infTermDescarreg = [ - # (0, 0, {"unloading_harbor": "BRAFU"}), - # (0, 0, {"unloading_harbor": "BRBZC"}), - # ] + # Dados gerais do modal aquaviário + cte.cte40_vAFRMM = ( + 1200.00 + ) # Valor do Adicional de Frete para Renovação da Marinha Mercante + # cte.cte40_vPrest = 3500.00 # Valor total do frete aquaviário + cte.cte40_xNavio = "Navio Mercante 123" # Nome do navio + cte.cte40_nViag = "Viagem001" # Número da viagem + cte.cte40_direc = "S" # Direção de navegação: 1 = Cabotagem, 2 = Longo curso + cte.cte40_irin = "IRIN12345" # Inscrição do Registro Internacional de Navios + cte.cte40_tpNav = "0" # Tipo de navegação: 01 = Interior, 02 = Cabotagem, etc. + + # Informações das balsas transportadas + cte.cte40_balsa = [ + ( + 0, + 0, + { + "cte40_xBalsa": "Balsa A", # Identificador da primeira balsa + }, + ), + ( + 0, + 0, + { + "cte40_xBalsa": "Balsa B", # Identificador da segunda balsa + }, + ), + ] + + def prepare_modal_dutoviario_data(self, cte): + # Dados gerais do modal dutoviário + cte.cte40_dIni = "2024-01-01" # Data de início da operação dutoviária + cte.cte40_dFim = "2024-12-31" # Data de término da operação dutoviária + cte.cte40_vTar = 1500.00 # Valor da tarifa aplicada no transporte def prepare_modal_ferroviario_data(self, cte): - pass - # cte.cte40_dhTrem = datetime.strptime( - # "2020-01-01T11:00:00", "%Y-%m-%dT%H:%M:%S") - # cte.cte40_xPref = "TES" - # cte.cte40_xOri = "TES" - # cte.cte40_xDest = "TES" - # cte.cte40_qVag = 2 - # cte.cte40_vag = [ - # ( - # 0, - # 0, - # { - # "cte40_pesoBC": 500, - # "cte40_pesoR": 1, - # "cte40_tpVag": 123, - # "cte40_serie": 123, - # "cte40_nVag": 123, - # "cte40_nSeq": 123, - # "cte40_TU": 1, - # }, - # ), + # Dados gerais do modal ferroviário + cte.cte40_tpTraf = "1" # Tipo de Tráfego: 1 = Nacional, 2 = Internacional + cte.cte40_fluxo = "Fluxo Norte-Sul" # Fluxo de transporte + cte.cte40_vFrete = 5000.00 # Valor do frete ferroviário + cte.cte40_chCTeFerroOrigem = ( + "CTE123456789" + ) # Chave do CTe Ferroviário de origem + cte.cte40_respFat = ( + "1" + ) # Responsável pelo Faturamento: 1 = Emitente, 2 = Receptor + cte.cte40_ferrEmi = ( + "1" + ) # Emissor do documento: 1 = Ferrovia Emitente, 2 = Outro + # cte.cte40_ferroEnv = [ # ( # 0, # 0, # { - # "cte40_pesoBC": 500, - # "cte40_pesoR": 1, - # "cte40_tpVag": 321, - # "cte40_serie": 321, - # "cte40_nVag": 321, - # "cte40_nSeq": 321, - # "cte40_TU": 1, + # "cte40_CNPJ": "12345678000199", # CNPJ da ferrovia envolvida + # "cte40_cInt": "FERRO001", # Código interno da ferrovia + # "cte40_IE": "ISENTO", # Inscrição Estadual + # "cte40_xNome": "Ferrovia Teste LTDA", # Nome ou razão social + # "cte40_enderFerro": ( + # 0, + # 0, + # { + # "cte40_xLgr": "Rua da Ferrovia", + # "cte40_nro": "123", + # "cte40_xCpl": "Prédio 2", + # "cte40_xBairro": "Centro", + # "cte40_cMun": "1234567", # Código do município IBGE + # "cte40_xMun": "Cidade Ferrovia", + # "cte40_CEP": "12345000", + # "cte40_UF": "SP", # Unidade Federativa + # }, + # ), # }, # ), # ] diff --git a/l10n_br_cte/tests/test_cte_serialize_lc.py b/l10n_br_cte/tests/test_cte_serialize_lc.py index 2857e9bd19dd..7c43edc2ecd9 100644 --- a/l10n_br_cte/tests/test_cte_serialize_lc.py +++ b/l10n_br_cte/tests/test_cte_serialize_lc.py @@ -12,11 +12,23 @@ def setUp(self): cte_list = [ { "record_ref": "l10n_br_cte.demo_cte_lc_modal_rodoviario", - "xml_file": "CTe35240708318053000167570010000000311040645898.xml", + "xml_file": "CTe35240781583054000129570010000057311040645894.xml", }, { "record_ref": "l10n_br_cte.demo_cte_lc_modal_aereo", - "xml_file": "CTe35240608318053000167570010000000311040645894.xml", + "xml_file": "CTe35240781583054000129570010000057411040645890.xml", + }, + { + "record_ref": "l10n_br_cte.demo_cte_lc_modal_aquaviario", + "xml_file": "CTe35240781583054000129570010000057511040645897.xml", + }, + { + "record_ref": "l10n_br_cte.demo_cte_lc_modal_ferroviario", + "xml_file": "CTe35240781583054000129570010000057611040645893.xml", + }, + { + "record_ref": "l10n_br_cte.demo_cte_lc_modal_dutoviario", + "xml_file": "CTe35240781583054000129570010000057711040645890.xml", }, ] diff --git a/l10n_br_cte/tests/test_cte_serialize_sn.py b/l10n_br_cte/tests/test_cte_serialize_sn.py index f067b8f800b1..a65ff2d3db34 100644 --- a/l10n_br_cte/tests/test_cte_serialize_sn.py +++ b/l10n_br_cte/tests/test_cte_serialize_sn.py @@ -12,7 +12,7 @@ def setUp(self): cte_list = [ { "record_ref": "l10n_br_cte.demo_cte_sn_modal_rodoviario", - "xml_file": "CTe35240708318053000167570010000000311040445899.xml", + "xml_file": "CTe35240759594315000157570010000057311040445890.xml", }, ]