br_nfe 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/br_nfe/active_model_base.rb +0 -5
- data/lib/br_nfe/base.rb +116 -7
- data/lib/br_nfe/helper/values_ts/service_v1.rb +15 -11
- data/lib/br_nfe/response/service/build_response.rb +230 -53
- data/lib/br_nfe/response/service/nota_fiscal.rb +9 -0
- data/lib/br_nfe/response/service/paths/base.rb +93 -59
- data/lib/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta.rb +4 -4
- data/lib/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta.rb +8 -8
- data/lib/br_nfe/response/service/paths/v1/tc_nfse.rb +201 -57
- data/lib/br_nfe/service/base.rb +104 -5
- data/lib/br_nfe/service/betha/base.rb +5 -0
- data/lib/br_nfe/service/betha/v1/cancelamento_nfs.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +1 -3
- data/lib/br_nfe/service/betha/v1/gateway.rb +1 -1
- data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +1 -3
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta.rb +5 -1
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta.rb +5 -1
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +5 -1
- data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +5 -0
- data/lib/br_nfe/service/rps.rb +13 -4
- data/lib/br_nfe/service/simpliss/v1/base.rb +79 -0
- data/lib/br_nfe/service/simpliss/v1/cancela_nfse.rb +30 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_lote_rps.rb +38 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_nfs_por_rps.rb +31 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_nfse.rb +30 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps.rb +29 -0
- data/lib/br_nfe/service/simpliss/v1/recepcao_lote_rps.rb +35 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_cancelar_nfse_resposta.rb +22 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_lote_rps_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_situacao_lote_rps_resposta.rb +31 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_enviar_lote_rps_resposta.rb +36 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_login.xml.slim +3 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_tc_dados_servico.xml.slim +18 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_tc_item_servico.xml.slim +3 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_cancelar_nfse_envio.xml.slim +11 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_lote_rps_envio.xml.slim +7 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_envio.xml.slim +22 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_rps_envio.xml.slim +8 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_situacao_lote_rps_envio.xml.slim +7 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_enviar_lote_rps_envio.xml.slim +11 -0
- data/lib/br_nfe/service/thema/v1/base.rb +48 -2
- data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +14 -5
- data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +1 -4
- data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +19 -5
- data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +1 -1
- data/lib/br_nfe/service/thema/v1/response_paths/servico_cancelar_nfse_resposta.rb +17 -0
- data/lib/br_nfe/service/thema/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +19 -0
- data/lib/br_nfe/service/xml/v1/_tc_contato.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_cpf_cnpj.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_dados_construcao_civil.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_dados_prestador.xml.slim +5 -5
- data/lib/br_nfe/service/xml/v1/_tc_dados_servico.xml.slim +6 -6
- data/lib/br_nfe/service/xml/v1/_tc_dados_tomador.xml.slim +4 -4
- data/lib/br_nfe/service/xml/v1/_tc_endereco.xml.slim +7 -7
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_intermediario_servico.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +4 -4
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_orgao_gerador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_prestador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_rps.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_tomador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_inf_pedido_cancelamento.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_inf_rps.xml.slim +13 -13
- data/lib/br_nfe/service/xml/v1/_tc_lote_rps.xml.slim +6 -6
- data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +1 -1
- data/lib/br_nfe/service/xml/v1/_tc_rps.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +16 -17
- data/lib/br_nfe/service/xml/v1/servico_cancelar_nfse_envio.xml.slim +3 -4
- data/lib/br_nfe/service/xml/v1/servico_consultar_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_envio.xml.slim +8 -8
- data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_consultar_situacao_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_enviar_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/version.rb +1 -1
- data/lib/br_nfe/xml/_signed_info_sh1.xml.slim +9 -9
- data/lib/br_nfe/xml/signature_sh1.xml.slim +5 -5
- data/lib/br_nfe.rb +26 -10
- data/test/br_nfe/base_test.rb +5 -5
- data/test/br_nfe/helper/values_ts/service_v1_test.rb +376 -0
- data/test/br_nfe/response/service/build_response_test.rb +1 -173
- data/test/br_nfe/response/service/paths/base_test.rb +61 -64
- data/test/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta_test.rb +3 -3
- data/test/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta_test.rb +4 -4
- data/test/br_nfe/response/service/paths/v1/tc_nfse_test.rb +27 -31
- data/test/br_nfe/service/base_test.rb +206 -11
- data/test/br_nfe/service/betha/base_test.rb +9 -0
- data/test/br_nfe/service/betha/v1/cancelamento_nfs_test.rb +0 -6
- data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +0 -6
- data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +1 -5
- data/test/br_nfe/service/betha/v1/gateway_test.rb +4 -2
- data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta_test.rb +1 -1
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta_test.rb +1 -1
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta_test.rb +1 -1
- data/test/br_nfe/service/rps_test.rb +39 -6
- data/test/br_nfe/service/simpliss/v1/base_test.rb +102 -0
- data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +97 -0
- data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +241 -0
- data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +239 -0
- data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +226 -0
- data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +122 -0
- data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +105 -0
- data/test/br_nfe/service/simpliss/v1/xsd/nfse_3.xsd +735 -0
- data/test/br_nfe/service/simpliss/v1/xsd/xmldsig-core-schema20020212.xsd +318 -0
- data/test/br_nfe/service/thema/v1/base_test.rb +23 -2
- data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +69 -3
- data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +134 -4
- data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +131 -4
- data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +214 -4
- data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +97 -4
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +109 -0
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +72 -4
- data/test/factories/service/rps.rb +17 -16
- data/test/factories/service/{sc/gaspar/recepcao_lote_rps_limitado.rb → simpliss/v1/base.rb} +1 -3
- data/test/factories/service/{sc/gaspar → simpliss/v1}/cancela_nfse.rb +2 -2
- data/test/factories/service/simpliss/v1/consulta_lote_rps.rb +7 -0
- data/test/factories/service/{sc/gaspar → simpliss/v1}/consulta_nfs_por_rps.rb +1 -1
- data/test/factories/service/{sc/gaspar → simpliss/v1}/consulta_nfse.rb +1 -1
- data/test/factories/service/simpliss/v1/consulta_situacao_lote_rps.rb +6 -0
- data/test/factories/service/{sc/gaspar → simpliss/v1}/recepcao_lote_rps.rb +1 -1
- data/test/fixtures/service/response/simpliss/v1/cancela_nfse/fault.xml +21 -0
- data/test/fixtures/service/response/simpliss/v1/cancela_nfse/success.xml +26 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/fault.xml +21 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_complete.xml +134 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_simple.xml +100 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfs_empty.xml +10 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_complete.xml +134 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_simple.xml +100 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_complete.xml +132 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_simple.xml +98 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/error.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/success.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unprocessed.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unreceived.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/error.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/success.xml +12 -0
- data/test/fixtures/service/response/thema/v1/cancela_nfse/fault.xml +33 -0
- data/test/fixtures/service/response/thema/v1/cancela_nfse/success.xml +30 -0
- data/test/fixtures/service/response/thema/v1/consulta_lote_rps/fault.xml +19 -0
- data/test/fixtures/service/response/thema/v1/consulta_lote_rps/nfse_complete.xml +109 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/fault.xml +20 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfs_empty.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_complete.xml +111 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_simple.xml +111 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/fault.xml +23 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/nfse_complete.xml +110 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/error.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/fault.xml +15 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/success.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unprocessed.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unreceived.xml +19 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/error.xml +17 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/success.xml +15 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/error.xml +19 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/success.xml +15 -0
- data/test/fixtures/service/thema/v1/cancelar_nfse_envio.xml +1 -0
- data/test/fixtures/service/thema/v1/cancelar_nfse_envio_signed.xml +2 -0
- data/test/fixtures/service/thema/v1/enviar_lote_rps.xml +1 -0
- data/test/fixtures/service/thema/v1/enviar_lote_rps_signed.xml +2 -0
- data/test/test_helper.rb +5 -0
- metadata +146 -37
- data/lib/br_nfe/service/sc/gaspar/cancela_nfse.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_nfs_por_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_nfse.rb +0 -17
- data/lib/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado.rb +0 -13
- data/test/br_nfe/service/sc/gaspar/cancela_nfse_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_nfs_por_rps_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_nfse_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado_test.rb +0 -22
- data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_test.rb +0 -22
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test_limitado.rb +0 -50
- data/test/factories/service/sc/gaspar/consulta_lote_rps.rb +0 -7
- data/test/factories/service/sc/gaspar/consulta_situacao_lote_rps.rb +0 -6
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Simpliss
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoConsultarLoteRpsResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::Base
|
|
8
|
+
include BrNfe::Service::Response::Paths::V1::TcNfse
|
|
9
|
+
|
|
10
|
+
# def message_alerts_path; [] end
|
|
11
|
+
def response_message_errors_path
|
|
12
|
+
[:consultar_lote_rps_result, :lista_mensagem_retorno, :mensagem_retorno]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Caminho referente ao caminho onde se encontra as notas fiscais
|
|
16
|
+
# poderá encontrar apenas uma ou várias
|
|
17
|
+
def response_invoices_path
|
|
18
|
+
[:consultar_lote_rps_result, :lista_nfse, :comp_nfse]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Simpliss
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoConsultarNfseResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::Base
|
|
8
|
+
include BrNfe::Service::Response::Paths::V1::TcNfse
|
|
9
|
+
|
|
10
|
+
# def message_alerts_path; [] end
|
|
11
|
+
def response_message_errors_path
|
|
12
|
+
[:consultar_nfse_result, :lista_mensagem_retorno, :mensagem_retorno]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Caminho referente ao caminho onde se encontra as notas fiscais
|
|
16
|
+
# poderá encontrar apenas uma ou várias
|
|
17
|
+
def response_invoices_path
|
|
18
|
+
[:consultar_nfse_result, :lista_nfse, :comp_nfse]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Simpliss
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoConsultarNfseRpsResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::Base
|
|
8
|
+
include BrNfe::Service::Response::Paths::V1::TcNfse
|
|
9
|
+
|
|
10
|
+
# def message_alerts_path; [] end
|
|
11
|
+
def response_message_errors_path
|
|
12
|
+
[:consultar_nfse_por_rps_result, :lista_mensagem_retorno, :mensagem_retorno]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Caminho referente ao caminho onde se encontra as notas fiscais
|
|
16
|
+
# poderá encontrar apenas uma ou várias
|
|
17
|
+
def response_invoices_path
|
|
18
|
+
[:consultar_nfse_por_rps_result, :comp_nfse]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_situacao_lote_rps_resposta.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Simpliss
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoConsultarSituacaoLoteRpsResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::Base
|
|
8
|
+
|
|
9
|
+
# Caminho referente ao caminho do número do lote
|
|
10
|
+
def response_lot_number_path
|
|
11
|
+
[:consultar_situacao_lote_rps_result, :numero_lote]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Caminho para encontrar o número do protocolo
|
|
15
|
+
def response_situation_path
|
|
16
|
+
[:consultar_situacao_lote_rps_result, :situacao]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# def response_message_alerts_path; [] end
|
|
20
|
+
def response_message_errors_path
|
|
21
|
+
[:consultar_situacao_lote_rps_result, :lista_mensagem_retorno, :mensagem_retorno]
|
|
22
|
+
end
|
|
23
|
+
# def response_message_code_key; :codigo end
|
|
24
|
+
# def response_message_msg_key; :mensagem end
|
|
25
|
+
# def response_message_solution_key; :correcao end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Simpliss
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoEnviarLoteRpsResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::Base
|
|
8
|
+
|
|
9
|
+
# Caminho referente ao caminho do número do lote
|
|
10
|
+
def response_lot_number_path
|
|
11
|
+
[:recepcionar_lote_rps_result, :numero_lote]
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Caminho para encontrar o número do protocolo
|
|
15
|
+
def response_protocol_path
|
|
16
|
+
[:recepcionar_lote_rps_result, :protocolo]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Caminho para encontrar a data de recebimento do lote/rps/nfe
|
|
20
|
+
def response_received_date_path
|
|
21
|
+
[:recepcionar_lote_rps_result, :data_recebimento]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# def response_message_alerts_path; [] end
|
|
25
|
+
def response_message_errors_path
|
|
26
|
+
[:recepcionar_lote_rps_result, :lista_mensagem_retorno, :mensagem_retorno]
|
|
27
|
+
end
|
|
28
|
+
# def response_message_code_key; :codigo end
|
|
29
|
+
# def response_message_msg_key; :mensagem end
|
|
30
|
+
# def response_message_solution_key; :correcao end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
- rps ||= false
|
|
2
|
+
- raise "Deve ser passado uma vsariavel local chamada rps" unless rps
|
|
3
|
+
|
|
4
|
+
*{tag: "#{namespace_for_tags}Valores"}
|
|
5
|
+
= render_xml '_tc_valores', rps: rps
|
|
6
|
+
|
|
7
|
+
*{tag: "#{namespace_for_tags}ItemListaServico"} = ts_item_lista_servico(rps.item_lista_servico)
|
|
8
|
+
- if rps.cnae_code.present?
|
|
9
|
+
*{tag: "#{namespace_for_tags}CodigoCnae"} = ts_codigo_cnae(rps.cnae_code)
|
|
10
|
+
- if rps.codigo_tributacao_municipio.present?
|
|
11
|
+
*{tag: "#{namespace_for_tags}CodigoTributacaoMunicipio"} = ts_codigo_tributacao(rps.codigo_tributacao_municipio)
|
|
12
|
+
|
|
13
|
+
*{tag: "#{namespace_for_tags}Discriminacao"} = ts_discriminacao(rps.description)
|
|
14
|
+
*{tag: "#{namespace_for_tags}CodigoMunicipio"} = ts_codigo_municipio_ibge(rps.codigo_municipio)
|
|
15
|
+
|
|
16
|
+
- rps.items.each do |item|
|
|
17
|
+
*{tag: "#{namespace_for_tags}ItensServico"}
|
|
18
|
+
= render_xml('_tc_item_servico', item: item)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}CancelarNfseEnvio"} *message_namespaces
|
|
2
|
+
*{tag: "#{namespace_for_tags}Pedido"}
|
|
3
|
+
- xml_pedido_cancel = render_xml '_tc_pedido_cancelamento', id_cancelamento: "C#{id_cancelamento}"
|
|
4
|
+
|
|
5
|
+
= xml_pedido_cancel.html_safe
|
|
6
|
+
|
|
7
|
+
- if signature_type?(:default) && certificate
|
|
8
|
+
= render_xml('signature_sh1', data_xml: xml_pedido_cancel.html_safe, uri: "#C#{id_cancelamento}").html_safe
|
|
9
|
+
|
|
10
|
+
- if username.present? && password.present?
|
|
11
|
+
= render_xml '_login'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}ConsultarLoteRpsEnvio"} *message_namespaces
|
|
2
|
+
*{tag: "#{namespace_for_tags}Prestador"}
|
|
3
|
+
= render_xml '_tc_identificacao_prestador'
|
|
4
|
+
*{tag: "#{namespace_for_tags}Protocolo"} = ts_numero_protocolo(protocolo)
|
|
5
|
+
|
|
6
|
+
- if username.present? && password.present?
|
|
7
|
+
= render_xml '_login'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}ConsultarNfseEnvio"} *message_namespaces
|
|
2
|
+
*{tag: "#{namespace_for_tags}Prestador"}
|
|
3
|
+
= render_xml '_tc_identificacao_prestador'
|
|
4
|
+
|
|
5
|
+
- if nfe_number.present?
|
|
6
|
+
*{tag: "#{namespace_for_tags}NumeroNfse"} = ts_numero_nfse(nfe_number)
|
|
7
|
+
|
|
8
|
+
- if start_date.present? && end_date.present?
|
|
9
|
+
*{tag: "#{namespace_for_tags}PeriodoEmissao"}
|
|
10
|
+
*{tag: "#{namespace_for_tags}DataInicial"} = ts_date(start_date)
|
|
11
|
+
*{tag: "#{namespace_for_tags}DataFinal"} = ts_date(end_date)
|
|
12
|
+
|
|
13
|
+
- if destinatario.present? && destinatario.cpf_cnpj.present?
|
|
14
|
+
*{tag: "#{namespace_for_tags}Tomador"}
|
|
15
|
+
= render_xml '_tc_identificacao_tomador', destinatario: destinatario
|
|
16
|
+
|
|
17
|
+
- if intermediario.present? && intermediario.cpf_cnpj.present?
|
|
18
|
+
*{tag: "#{namespace_for_tags}IntermediarioServico"}
|
|
19
|
+
= render_xml '_tc_identificacao_intermediario_servico', intermediario: intermediario
|
|
20
|
+
|
|
21
|
+
- if username.present? && password.present?
|
|
22
|
+
= render_xml '_login'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}ConsultarNfseRpsEnvio"} *message_namespaces
|
|
2
|
+
*{tag: "#{namespace_for_tags}IdentificacaoRps"}
|
|
3
|
+
= render_xml '_tc_identificacao_rps'
|
|
4
|
+
*{tag: "#{namespace_for_tags}Prestador"}
|
|
5
|
+
= render_xml '_tc_identificacao_prestador'
|
|
6
|
+
|
|
7
|
+
- if username.present? && password.present?
|
|
8
|
+
= render_xml '_login'
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}ConsultarSituacaoLoteRpsEnvio"} *message_namespaces
|
|
2
|
+
*{tag: "#{namespace_for_tags}Prestador"}
|
|
3
|
+
= render_xml '_tc_identificacao_prestador'
|
|
4
|
+
*{tag: "#{namespace_for_tags}Protocolo"} = ts_numero_protocolo(protocolo)
|
|
5
|
+
|
|
6
|
+
- if username.present? && password.present?
|
|
7
|
+
= render_xml '_login'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
*{tag: "#{namespace_identifier}EnviarLoteRpsEnvio"} *message_namespaces
|
|
2
|
+
- xml_lote_rps = render_xml('_tc_lote_rps')
|
|
3
|
+
/ Alguns órgãos emissores não aceitam o atributo ID na tag (Como a betha)
|
|
4
|
+
- attributes_lote_rps = id_attribute? ? {id: "L#{numero_lote_rps}"} : {}
|
|
5
|
+
*{tag: "#{namespace_for_tags}LoteRps"} *attributes_lote_rps
|
|
6
|
+
= xml_lote_rps.html_safe
|
|
7
|
+
|
|
8
|
+
- if signature_type?(:default) && certificate
|
|
9
|
+
= render_xml('signature_sh1', data_xml: xml_lote_rps.html_safe, uri: "#L#{numero_lote_rps}").html_safe
|
|
10
|
+
- if username.present? && password.present?
|
|
11
|
+
= render_xml '_login'
|
|
@@ -4,6 +4,28 @@ module BrNfe
|
|
|
4
4
|
module V1
|
|
5
5
|
class Base < BrNfe::Service::Base
|
|
6
6
|
|
|
7
|
+
def get_wsdl_by_city
|
|
8
|
+
if ibge_code_of_issuer_city == '4205902' # Gaspar-SC
|
|
9
|
+
{
|
|
10
|
+
send: "http://nfse#{'hml' if env == :test}.gaspar.sc.gov.br/nfse/services/NFSEremessa?wsdl",
|
|
11
|
+
consult: "http://nfse#{'hml' if env == :test}.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl",
|
|
12
|
+
cancel: "http://nfse#{'hml' if env == :test}.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl"
|
|
13
|
+
}
|
|
14
|
+
else # Default for tdd
|
|
15
|
+
{
|
|
16
|
+
send: "http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEremessa?wsdl",
|
|
17
|
+
consult: "http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl",
|
|
18
|
+
cancel: "http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl"
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Assinatura através da gem signer
|
|
25
|
+
def signature_type
|
|
26
|
+
:method_sign
|
|
27
|
+
end
|
|
28
|
+
|
|
7
29
|
def canonicalization_method_algorithm
|
|
8
30
|
'http://www.w3.org/TR/2001/REC-xml-c14n-20010315'
|
|
9
31
|
end
|
|
@@ -31,6 +53,14 @@ module BrNfe
|
|
|
31
53
|
raise "Deve ser sobrescrito nas subclasses"
|
|
32
54
|
end
|
|
33
55
|
|
|
56
|
+
def response_encoding
|
|
57
|
+
'ISO-8859-1'
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def nfse_xml_path
|
|
61
|
+
'//*' #Começa o XMl a partir do body e pega a tag ConsultarNfseResposta
|
|
62
|
+
end
|
|
63
|
+
|
|
34
64
|
# Método é sobrescrito para atender o padrão do órgão emissor.
|
|
35
65
|
# Deve ser enviado o XML da requsiução dentro da tag CDATA
|
|
36
66
|
# seguindo a estrutura requerida.
|
|
@@ -38,16 +68,32 @@ module BrNfe
|
|
|
38
68
|
# <b><Tipo de retorno: /b> _String_ XML
|
|
39
69
|
#
|
|
40
70
|
def content_xml
|
|
71
|
+
xml_signed = xml_builder.html_safe
|
|
72
|
+
|
|
41
73
|
dados = "<ns1:#{soap_body_root_tag}>"
|
|
42
74
|
dados += '<ns1:xml>'
|
|
43
|
-
dados += '<![CDATA[
|
|
44
|
-
dados +=
|
|
75
|
+
dados += '<![CDATA['
|
|
76
|
+
dados += '<?xml version="1.0" encoding="ISO-8859-1"?>' unless xml_signed.include?('<?xml')
|
|
77
|
+
dados += xml_signed
|
|
45
78
|
dados += ']]>'
|
|
46
79
|
dados += '</ns1:xml>'
|
|
47
80
|
dados += "</ns1:#{soap_body_root_tag}>"
|
|
48
81
|
dados
|
|
49
82
|
end
|
|
50
83
|
|
|
84
|
+
# Alíquota. Valor percentual.
|
|
85
|
+
# Formato: 0.XXXX
|
|
86
|
+
# Ex: 1% = 0.01
|
|
87
|
+
# 25,5% = 0.255
|
|
88
|
+
# 100% = 1.0
|
|
89
|
+
# Irá receber o valor decimal do percentual da aliquota
|
|
90
|
+
# e irá dividir por 100 conforme indicado na documentação.
|
|
91
|
+
#
|
|
92
|
+
def ts_aliquota value
|
|
93
|
+
value = value.to_f/100
|
|
94
|
+
value_monetary(value, 4)
|
|
95
|
+
end
|
|
96
|
+
|
|
51
97
|
end
|
|
52
98
|
end
|
|
53
99
|
end
|
|
@@ -4,17 +4,26 @@ module BrNfe
|
|
|
4
4
|
module V1
|
|
5
5
|
class CancelaNfse < BrNfe::Service::Thema::V1::Base
|
|
6
6
|
include BrNfe::Service::Concerns::Rules::CancelamentoNfs
|
|
7
|
+
include BrNfe::Service::Thema::V1::ResponsePaths::ServicoCancelarNfseResposta
|
|
7
8
|
|
|
8
|
-
def
|
|
9
|
-
:
|
|
9
|
+
def wsdl
|
|
10
|
+
get_wsdl_by_city[:cancel]
|
|
10
11
|
end
|
|
11
12
|
|
|
12
|
-
def
|
|
13
|
-
|
|
13
|
+
def method_wsdl
|
|
14
|
+
:cancelar_nfse
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
def xml_builder
|
|
17
|
-
render_xml 'servico_cancelar_nfse_envio'
|
|
18
|
+
xml = render_xml 'servico_cancelar_nfse_envio'
|
|
19
|
+
sign_nodes = [
|
|
20
|
+
{
|
|
21
|
+
node_path: "//nf:CancelarNfseEnvio/nf:Pedido/nf:InfPedidoCancelamento",
|
|
22
|
+
node_namespaces: {nf: 'http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd'},
|
|
23
|
+
node_ids: ["C#{id_cancelamento}"]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
sign_xml('<?xml version="1.0" encoding="ISO-8859-1"?>'+xml, sign_nodes)
|
|
18
27
|
end
|
|
19
28
|
|
|
20
29
|
# Não é utilizado o response_root_path pois
|
|
@@ -3,6 +3,11 @@ module BrNfe
|
|
|
3
3
|
module Thema
|
|
4
4
|
module V1
|
|
5
5
|
class ConsultaLoteRps < BrNfe::Service::Thema::V1::Base
|
|
6
|
+
include BrNfe::Service::Response::Paths::V1::ServicoConsultarLoteRpsResposta
|
|
7
|
+
|
|
8
|
+
def wsdl
|
|
9
|
+
get_wsdl_by_city[:consult]
|
|
10
|
+
end
|
|
6
11
|
|
|
7
12
|
attr_accessor :protocolo
|
|
8
13
|
validates :protocolo, presence: true
|
|
@@ -15,10 +20,6 @@ module BrNfe
|
|
|
15
20
|
render_xml 'servico_consultar_lote_rps_envio'
|
|
16
21
|
end
|
|
17
22
|
|
|
18
|
-
def response_path_module
|
|
19
|
-
BrNfe::Service::Response::Paths::V1::ServicoConsultarLoteRpsResposta
|
|
20
|
-
end
|
|
21
|
-
|
|
22
23
|
# Não é utilizado o response_root_path pois
|
|
23
24
|
# esse órgão emissor trata o XML de forma diferente
|
|
24
25
|
# e para instanciar a resposta adequadamente é utilizado o
|
|
@@ -4,13 +4,14 @@ module BrNfe
|
|
|
4
4
|
module V1
|
|
5
5
|
class ConsultaNfsPorRps < BrNfe::Service::Thema::V1::Base
|
|
6
6
|
include BrNfe::Service::Concerns::Rules::ConsultaNfsPorRps
|
|
7
|
+
include BrNfe::Service::Thema::V1::ResponsePaths::ServicoConsultarNfseRpsResposta
|
|
7
8
|
|
|
8
|
-
def
|
|
9
|
-
:
|
|
9
|
+
def wsdl
|
|
10
|
+
get_wsdl_by_city[:consult]
|
|
10
11
|
end
|
|
11
12
|
|
|
12
|
-
def
|
|
13
|
-
|
|
13
|
+
def method_wsdl
|
|
14
|
+
:consultar_nfse_por_rps
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
def xml_builder
|
|
@@ -4,6 +4,11 @@ module BrNfe
|
|
|
4
4
|
module V1
|
|
5
5
|
class ConsultaNfse < BrNfe::Service::Thema::V1::Base
|
|
6
6
|
include BrNfe::Service::Concerns::Rules::ConsultaNfse
|
|
7
|
+
include BrNfe::Service::Response::Paths::V1::ServicoConsultarNfseResposta
|
|
8
|
+
|
|
9
|
+
def wsdl
|
|
10
|
+
get_wsdl_by_city[:consult]
|
|
11
|
+
end
|
|
7
12
|
|
|
8
13
|
def method_wsdl
|
|
9
14
|
:consultar_nfse
|
|
@@ -13,10 +18,6 @@ module BrNfe
|
|
|
13
18
|
render_xml 'servico_consultar_nfse_envio'
|
|
14
19
|
end
|
|
15
20
|
|
|
16
|
-
def response_path_module
|
|
17
|
-
BrNfe::Service::Response::Paths::V1::ServicoConsultarNfseResposta
|
|
18
|
-
end
|
|
19
|
-
|
|
20
21
|
# Não é utilizado o response_root_path pois
|
|
21
22
|
# esse órgão emissor trata o XML de forma diferente
|
|
22
23
|
# e para instanciar a resposta adequadamente é utilizado o
|
|
@@ -3,6 +3,7 @@ module BrNfe
|
|
|
3
3
|
module Thema
|
|
4
4
|
module V1
|
|
5
5
|
class ConsultaSituacaoLoteRps < BrNfe::Service::Thema::V1::ConsultaLoteRps
|
|
6
|
+
include BrNfe::Service::Response::Paths::V1::ServicoConsultarSituacaoLoteRpsResposta
|
|
6
7
|
|
|
7
8
|
def method_wsdl
|
|
8
9
|
:consultar_situacao_lote_rps
|
|
@@ -12,10 +13,6 @@ module BrNfe
|
|
|
12
13
|
render_xml 'servico_consultar_situacao_lote_rps_envio'
|
|
13
14
|
end
|
|
14
15
|
|
|
15
|
-
def response_path_module
|
|
16
|
-
BrNfe::Service::Response::Paths::V1::ServicoConsultarSituacaoLoteRpsResposta
|
|
17
|
-
end
|
|
18
|
-
|
|
19
16
|
# Não é utilizado o response_root_path pois
|
|
20
17
|
# esse órgão emissor trata o XML de forma diferente
|
|
21
18
|
# e para instanciar a resposta adequadamente é utilizado o
|
|
@@ -4,6 +4,11 @@ module BrNfe
|
|
|
4
4
|
module V1
|
|
5
5
|
class RecepcaoLoteRps < BrNfe::Service::Thema::V1::Base
|
|
6
6
|
include BrNfe::Service::Concerns::Rules::RecepcaoLoteRps
|
|
7
|
+
include BrNfe::Service::Response::Paths::V1::ServicoEnviarLoteRpsResposta
|
|
8
|
+
|
|
9
|
+
def wsdl
|
|
10
|
+
get_wsdl_by_city[:send]
|
|
11
|
+
end
|
|
7
12
|
|
|
8
13
|
def certificado_obrigatorio?
|
|
9
14
|
true
|
|
@@ -20,11 +25,20 @@ module BrNfe
|
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
def xml_builder
|
|
23
|
-
render_xml 'servico_enviar_lote_rps_envio'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
xml = render_xml 'servico_enviar_lote_rps_envio'
|
|
29
|
+
sign_nodes = [
|
|
30
|
+
{
|
|
31
|
+
node_path: "//nf:EnviarLoteRpsEnvio/nf:LoteRps/nf:ListaRps/nf:Rps/nf:InfRps",
|
|
32
|
+
node_namespaces: {nf: 'http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd'},
|
|
33
|
+
node_ids: lote_rps.map{|rps| "R#{rps.numero}"}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
node_path: "//nf:EnviarLoteRpsEnvio/nf:LoteRps",
|
|
37
|
+
node_namespaces: {nf: 'http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd'},
|
|
38
|
+
node_ids: ["L#{numero_lote_rps}"]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
sign_xml('<?xml version="1.0" encoding="ISO-8859-1"?>'+xml, sign_nodes)
|
|
28
42
|
end
|
|
29
43
|
|
|
30
44
|
# Não é utilizado o response_root_path pois
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Thema
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoCancelarNfseResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::V1::ServicoCancelarNfseResposta
|
|
8
|
+
|
|
9
|
+
def response_cancelation_date_time_path
|
|
10
|
+
[:cancelar_nfse_resposta, :cancelamento, :confirmacao, :data_hora_cancelamento]
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module BrNfe
|
|
2
|
+
module Service
|
|
3
|
+
module Thema
|
|
4
|
+
module V1
|
|
5
|
+
module ResponsePaths
|
|
6
|
+
module ServicoConsultarNfseRpsResposta
|
|
7
|
+
include BrNfe::Service::Response::Paths::V1::ServicoConsultarNfseRpsResposta
|
|
8
|
+
|
|
9
|
+
# Caminho referente ao caminho onde se encontra as notas fiscais
|
|
10
|
+
# poderá encontrar apenas uma ou várias
|
|
11
|
+
def response_invoices_path
|
|
12
|
+
[:consultar_nfse_rps_resposta, :lista_nfse, :comp_nfse]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
- raise "Deve ser passado uma variável local chamda contact" unless contact
|
|
3
3
|
|
|
4
4
|
- if contact.telefone.present?
|
|
5
|
-
Telefone = ts_telefone(contact.telefone)
|
|
5
|
+
*{tag: "#{namespace_for_tags}Telefone"} = ts_telefone(contact.telefone)
|
|
6
6
|
- if contact.email.present?
|
|
7
|
-
Email = ts_email(contact.email)
|
|
7
|
+
*{tag: "#{namespace_for_tags}Email"} = ts_email(contact.email)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
- cpf_cnpj = BrNfe::Helper::CpfCnpj.new(cpf_cnpj)
|
|
2
2
|
- if cpf_cnpj.cnpj?
|
|
3
|
-
Cnpj = ts_cnpj(cpf_cnpj.sem_formatacao)
|
|
3
|
+
*{tag: "#{namespace_for_tags}Cnpj"} = ts_cnpj(cpf_cnpj.sem_formatacao)
|
|
4
4
|
- elsif cpf_cnpj.cpf?
|
|
5
|
-
Cpf = ts_cpf(cpf_cnpj.sem_formatacao)
|
|
5
|
+
*{tag: "#{namespace_for_tags}Cpf"} = ts_cpf(cpf_cnpj.sem_formatacao)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
CodigoObra = ts_codigo_obra(rps.codigo_obra)
|
|
2
|
-
Art = ts_art(rps.codigo_art)
|
|
1
|
+
*{tag: "#{namespace_for_tags}CodigoObra"} = ts_codigo_obra(rps.codigo_obra)
|
|
2
|
+
*{tag: "#{namespace_for_tags}Art"} = ts_art(rps.codigo_art)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
IdentificacaoPrestador
|
|
1
|
+
*{tag: "#{namespace_for_tags}IdentificacaoPrestador"}
|
|
2
2
|
= render_xml '_tc_identificacao_prestador'
|
|
3
3
|
|
|
4
|
-
RazaoSocial = ts_razao_social(emitente.razao_social)
|
|
4
|
+
*{tag: "#{namespace_for_tags}RazaoSocial"} = ts_razao_social(emitente.razao_social)
|
|
5
5
|
|
|
6
6
|
- if emitente.nome_fantasia.present?
|
|
7
|
-
NomeFantasia = ts_nome_fantasia(emitente.nome_fantasia)
|
|
7
|
+
*{tag: "#{namespace_for_tags}NomeFantasia"} = ts_nome_fantasia(emitente.nome_fantasia)
|
|
8
8
|
|
|
9
9
|
- if emitente.endereco.is_present?
|
|
10
|
-
Endereco
|
|
10
|
+
*{tag: "#{namespace_for_tags}Endereco"}
|
|
11
11
|
= render_xml '_tc_endereco', address: emitente.endereco
|
|
12
12
|
|
|
13
13
|
- if emitente.telefone.present? || emitente.email.present?
|
|
14
|
-
Contato
|
|
14
|
+
*{tag: "#{namespace_for_tags}Contato"}
|
|
15
15
|
= render_xml '_tc_contato', contact: emitente
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
- rps ||= false
|
|
2
2
|
- raise "Deve ser passado uma vsariavel local chamada rps" unless rps
|
|
3
3
|
|
|
4
|
-
Valores
|
|
4
|
+
*{tag: "#{namespace_for_tags}Valores"}
|
|
5
5
|
= render_xml '_tc_valores', rps: rps
|
|
6
6
|
|
|
7
|
-
ItemListaServico = ts_item_lista_servico(rps.item_lista_servico)
|
|
7
|
+
*{tag: "#{namespace_for_tags}ItemListaServico"} = ts_item_lista_servico(rps.item_lista_servico)
|
|
8
8
|
- if rps.cnae_code.present?
|
|
9
|
-
CodigoCnae = ts_codigo_cnae(rps.cnae_code)
|
|
9
|
+
*{tag: "#{namespace_for_tags}CodigoCnae"} = ts_codigo_cnae(rps.cnae_code)
|
|
10
10
|
- if rps.codigo_tributacao_municipio.present?
|
|
11
|
-
CodigoTributacaoMunicipio = ts_codigo_tributacao(rps.codigo_tributacao_municipio)
|
|
11
|
+
*{tag: "#{namespace_for_tags}CodigoTributacaoMunicipio"} = ts_codigo_tributacao(rps.codigo_tributacao_municipio)
|
|
12
12
|
|
|
13
|
-
Discriminacao = ts_discriminacao(rps.description)
|
|
14
|
-
CodigoMunicipio = ts_codigo_municipio_ibge(rps.codigo_municipio)
|
|
13
|
+
*{tag: "#{namespace_for_tags}Discriminacao"} = ts_discriminacao(rps.description)
|
|
14
|
+
*{tag: "#{namespace_for_tags}CodigoMunicipio"} = ts_codigo_municipio_ibge(rps.codigo_municipio)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
- destinatario ||= false
|
|
2
2
|
- raise "Deve ser passado uma vsariavel local chamada destinatario" unless destinatario
|
|
3
|
-
IdentificacaoTomador
|
|
3
|
+
*{tag: "#{namespace_for_tags}IdentificacaoTomador"}
|
|
4
4
|
= render_xml '_tc_identificacao_tomador', destinatario: destinatario
|
|
5
5
|
|
|
6
6
|
- if destinatario.razao_social.present?
|
|
7
|
-
RazaoSocial = ts_razao_social(destinatario.razao_social)
|
|
7
|
+
*{tag: "#{namespace_for_tags}RazaoSocial"} = ts_razao_social(destinatario.razao_social)
|
|
8
8
|
|
|
9
9
|
- if destinatario.endereco.is_present?
|
|
10
|
-
Endereco
|
|
10
|
+
*{tag: "#{namespace_for_tags}Endereco"}
|
|
11
11
|
= render_xml '_tc_endereco', address: destinatario.endereco
|
|
12
12
|
|
|
13
13
|
- if destinatario.telefone.present? || destinatario.email.present?
|
|
14
|
-
Contato
|
|
14
|
+
*{tag: "#{namespace_for_tags}Contato"}
|
|
15
15
|
= render_xml '_tc_contato', contact: destinatario
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
- address ||= false
|
|
2
2
|
- raise "Deve ser passado uma variável local chamda address" unless address
|
|
3
3
|
|
|
4
|
-
Endereco = ts_endereco("#{address.logradouro}")
|
|
5
|
-
Numero = ts_numero_endereco("#{address.numero}")
|
|
4
|
+
*{tag: "#{namespace_for_tags}Endereco"} = ts_endereco("#{address.logradouro}")
|
|
5
|
+
*{tag: "#{namespace_for_tags}Numero"} = ts_numero_endereco("#{address.numero}")
|
|
6
6
|
|
|
7
7
|
- address.complemento.present?
|
|
8
|
-
Complemento = ts_complemento_endereco("#{address.complemento}")
|
|
8
|
+
*{tag: "#{namespace_for_tags}Complemento"} = ts_complemento_endereco("#{address.complemento}")
|
|
9
9
|
|
|
10
|
-
Bairro = ts_bairro("#{address.bairro}")
|
|
11
|
-
CodigoMunicipio = ts_codigo_municipio_ibge(address.codigo_municipio)
|
|
12
|
-
Uf = ts_uf("#{address.uf}")
|
|
13
|
-
Cep = ts_cep(address.cep)
|
|
10
|
+
*{tag: "#{namespace_for_tags}Bairro"} = ts_bairro("#{address.bairro}")
|
|
11
|
+
*{tag: "#{namespace_for_tags}CodigoMunicipio"} = ts_codigo_municipio_ibge(address.codigo_municipio)
|
|
12
|
+
*{tag: "#{namespace_for_tags}Uf"} = ts_uf("#{address.uf}")
|
|
13
|
+
*{tag: "#{namespace_for_tags}Cep"} = ts_cep(address.cep)
|