br_nfe 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -2
- data/README.markdown +3 -1
- data/Rakefile +20 -1
- data/lib/br_nfe/active_model/associations.rb +11 -0
- data/lib/br_nfe/active_model/has_many.rb +65 -0
- data/lib/br_nfe/active_model/has_one.rb +57 -0
- data/lib/br_nfe/active_model_base.rb +38 -1
- data/lib/br_nfe/base.rb +9 -0
- data/lib/br_nfe/calculos/fatores_de_multiplicacao.rb +67 -0
- data/lib/br_nfe/calculos/modulo11.rb +54 -0
- data/lib/br_nfe/calculos/modulo11_fator_de2a9.rb +83 -0
- data/lib/br_nfe/calculos/modulo11_fator_de2a9_resto_zero.rb +29 -0
- data/lib/br_nfe/constants.rb +46 -1
- data/lib/br_nfe/endereco.rb +6 -2
- data/lib/br_nfe/helper/cpf_cnpj.rb +8 -1
- data/lib/br_nfe/person.rb +32 -3
- data/lib/br_nfe/product/destinatario.rb +45 -0
- data/lib/br_nfe/product/emitente.rb +14 -1
- data/lib/br_nfe/product/evento/base.rb +146 -0
- data/lib/br_nfe/product/evento/cancelamento.rb +46 -0
- data/lib/br_nfe/product/gateway/base.rb +16 -43
- data/lib/br_nfe/product/gateway/web_service_am.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_ba.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_ce.rb +162 -0
- data/lib/br_nfe/product/gateway/web_service_go.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_mg.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_ms.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_mt.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_pe.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_pr.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_rs.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_sp.rb +140 -0
- data/lib/br_nfe/product/gateway/web_service_svan.rb +162 -0
- data/lib/br_nfe/product/gateway/web_service_svc_an.rb +131 -0
- data/lib/br_nfe/product/gateway/web_service_svc_rs.rb +20 -0
- data/lib/br_nfe/product/gateway/web_service_svrs.rb +111 -10
- data/lib/br_nfe/product/nf_xml_value.rb +278 -0
- data/lib/br_nfe/product/nfe/adicao_importacao.rb +76 -0
- data/lib/br_nfe/product/nfe/cobranca/duplicata.rb +44 -0
- data/lib/br_nfe/product/nfe/cobranca/fatura.rb +64 -0
- data/lib/br_nfe/product/nfe/cobranca/pagamento.rb +99 -0
- data/lib/br_nfe/product/nfe/declaracao_importacao.rb +221 -0
- data/lib/br_nfe/product/nfe/detalhe_exportacao.rb +89 -0
- data/lib/br_nfe/product/nfe/item.rb +678 -0
- data/lib/br_nfe/product/nfe/item_tax/cofins.rb +138 -0
- data/lib/br_nfe/product/nfe/item_tax/cofins_st.rb +68 -0
- data/lib/br_nfe/product/nfe/item_tax/icms.rb +593 -0
- data/lib/br_nfe/product/nfe/item_tax/icms_uf_destino.rb +169 -0
- data/lib/br_nfe/product/nfe/item_tax/importacao.rb +62 -0
- data/lib/br_nfe/product/nfe/item_tax/ipi.rb +179 -0
- data/lib/br_nfe/product/nfe/item_tax/issqn.rb +256 -0
- data/lib/br_nfe/product/nfe/item_tax/pis.rb +138 -0
- data/lib/br_nfe/product/nfe/item_tax/pis_st.rb +68 -0
- data/lib/br_nfe/product/nfe/processo_referencia.rb +48 -0
- data/lib/br_nfe/product/nfe/transporte/base.rb +264 -0
- data/lib/br_nfe/product/nfe/transporte/transportador.rb +15 -0
- data/lib/br_nfe/product/nfe/transporte/veiculo.rb +53 -0
- data/lib/br_nfe/product/nfe/transporte/volume.rb +89 -0
- data/lib/br_nfe/product/nota_fiscal.rb +1173 -0
- data/lib/br_nfe/product/operation/base.rb +255 -0
- data/lib/br_nfe/product/operation/nfe_autorizacao.rb +118 -0
- data/lib/br_nfe/product/operation/nfe_consulta_protocolo.rb +61 -0
- data/lib/br_nfe/product/operation/nfe_download_nf.rb +86 -0
- data/lib/br_nfe/product/operation/nfe_inutilizacao.rb +168 -0
- data/lib/br_nfe/product/operation/nfe_recepcao_evento.rb +70 -0
- data/lib/br_nfe/product/operation/nfe_ret_autorizacao.rb +63 -0
- data/lib/br_nfe/product/operation/nfe_status_servico.rb +46 -0
- data/lib/br_nfe/product/response/base.rb +97 -0
- data/lib/br_nfe/product/response/build/base.rb +287 -0
- data/lib/br_nfe/product/response/build/nfe_autorizacao.rb +102 -0
- data/lib/br_nfe/product/response/build/nfe_consulta_protocolo.rb +133 -0
- data/lib/br_nfe/product/response/build/nfe_inutilizacao.rb +53 -0
- data/lib/br_nfe/product/response/build/nfe_ret_autorizacao.rb +65 -0
- data/lib/br_nfe/product/response/build/nfe_status_servico.rb +43 -0
- data/lib/br_nfe/product/response/event.rb +89 -0
- data/lib/br_nfe/product/response/nfe_autorizacao.rb +12 -0
- data/lib/br_nfe/product/response/nfe_consulta_protocolo.rb +13 -0
- data/lib/br_nfe/product/response/nfe_inutilizacao.rb +89 -0
- data/lib/br_nfe/product/response/nfe_ret_autorizacao.rb +9 -0
- data/lib/br_nfe/product/response/nfe_status_servico.rb +31 -0
- data/lib/br_nfe/product/xml/_signed_info_sh1.xml.slim +9 -0
- data/lib/br_nfe/product/xml/_tc_cpf_cnpj.xml.slim +7 -0
- data/lib/br_nfe/product/xml/signature_sh1.xml.slim +12 -0
- data/lib/br_nfe/product/xml/v1_00/evento/infEventoCancelamento.xml.slim +19 -0
- data/lib/br_nfe/product/xml/v1_00/root/NfeDownloadNf.xml.slim +5 -0
- data/lib/br_nfe/product/xml/v1_00/root/NfeRecepcaoEvento.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v2_00/_tc_endereco.xml.slim +19 -0
- data/lib/br_nfe/product/xml/v2_00/_tc_infNFe.xml.slim +39 -0
- data/lib/br_nfe/product/xml/v2_00/infInut.xml.slim +12 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/NFe.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_cobr.xml.slim +19 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_dest.xml.slim +14 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_det.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_emit.xml.slim +19 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_entrega.xml.slim +11 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_exporta.xml.slim +2 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_ide.xml.slim +24 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_infAdic.xml.slim +13 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_retirada.xml.slim +11 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_total.xml.slim +50 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_transp.xml.slim +35 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_imposto.xml.slim +31 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_prod.xml.slim +37 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim +6 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim +16 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS101.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS102.xml.slim +3 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +6 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim +15 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim +14 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +12 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim +6 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +13 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim +5 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +18 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +21 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim +25 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS.xml.slim +26 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS_ST.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_ICMS.xml.slim +45 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_II.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_IPI.xml.slim +30 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS.xml.slim +26 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS_ST.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/det/prod/_tc_di.xml.slim +13 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_retTransp.xml.slim +6 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_transporta.xml.slim +17 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_vol.xml.slim +15 -0
- data/lib/br_nfe/product/xml/v2_00/infNFe.xml.slim +3 -0
- data/lib/br_nfe/product/xml/v2_00/root/NfeAutorizacao.xml.slim +5 -0
- data/lib/br_nfe/product/xml/v2_00/root/NfeInutilizacao.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v2_00/root/NfeRetAutorizacao.xml.slim +3 -0
- data/lib/br_nfe/product/xml/v2_00/root/NfeStatusServico.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v2_01/root/NfeConsultaProtocolo.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v3_10/_tc_infNFe.xml.slim +44 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_dest.xml.slim +25 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_det.xml.slim +14 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_exporta.xml.slim +4 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_ide.xml.slim +26 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_pag.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_total.xml.slim +78 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_imposto.xml.slim +37 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_prod.xml.slim +48 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +12 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +17 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +7 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +19 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +23 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +26 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +8 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ISSQN.xml.slim +35 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_det_export.xml.slim +8 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_di.xml.slim +28 -0
- data/lib/br_nfe/product/xml/v3_10/root/NfeAutorizacao.xml.slim +6 -0
- data/lib/br_nfe/service/base.rb +1 -105
- data/lib/br_nfe/service/betha/v1/cancela_nfse.rb +1 -1
- data/lib/br_nfe/service/response/default.rb +1 -1
- data/lib/br_nfe/service/simpliss/v1/base.rb +2 -0
- data/lib/br_nfe/version.rb +2 -2
- data/lib/br_nfe.rb +180 -22
- data/lib/config/locales/br_nfe/en/product/nfe/cobranca/fatura.yml +6 -0
- data/lib/config/locales/br_nfe/en/product/nfe/declaracao_importacao.yml +10 -0
- data/lib/config/locales/br_nfe/en/product/nfe/item.yml +20 -0
- data/lib/config/locales/br_nfe/en/product/nfe/item_tax/icms_uf_destino.yml +8 -0
- data/lib/config/locales/br_nfe/en/product/nfe/transporte/base.yml +9 -0
- data/lib/config/locales/br_nfe/en/product/nota_fiscal.yml +21 -0
- data/lib/config/locales/br_nfe/en/product/operation/nfe_autorizacao.yml +10 -0
- data/lib/config/locales/br_nfe/en/product/operation/nfe_recepcao_evento.yml +6 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nfe/cobranca/fatura.yml +6 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nfe/declaracao_importacao.yml +10 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nfe/item.yml +20 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nfe/item_tax/icms_uf_destino.yml +8 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nfe/transporte/base.yml +9 -0
- data/lib/config/locales/br_nfe/pt-BR/product/nota_fiscal.yml +21 -0
- data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_autorizacao.yml +10 -0
- data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_recepcao_evento.yml +6 -0
- data/test/br_nfe/association/have_destinatario_test.rb +8 -8
- data/test/br_nfe/association/have_emitente_test.rb +6 -6
- data/test/br_nfe/base_test.rb +15 -4
- data/test/br_nfe/endereco_test.rb +15 -0
- data/test/br_nfe/person_test.rb +55 -6
- data/test/br_nfe/product/destinatario_test.rb +26 -0
- data/test/br_nfe/product/emitente_test.rb +1 -2
- data/test/br_nfe/product/evento/base_test.rb +58 -0
- data/test/br_nfe/product/evento/cancelamento_test.rb +32 -0
- data/test/br_nfe/product/gateway/web_service_am_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_ba_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_ce_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_go_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_mg_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_ms_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_mt_test.rb +408 -0
- data/test/br_nfe/product/gateway/web_service_pe_test.rb +408 -0
- data/test/br_nfe/product/gateway/web_service_pr_test.rb +408 -0
- data/test/br_nfe/product/gateway/web_service_rs_test.rb +407 -0
- data/test/br_nfe/product/gateway/web_service_sp_test.rb +408 -0
- data/test/br_nfe/product/gateway/web_service_svan_test.rb +242 -0
- data/test/br_nfe/product/gateway/web_service_svc_an_test.rb +185 -0
- data/test/br_nfe/product/gateway/web_service_svc_rs_test.rb +185 -0
- data/test/br_nfe/product/gateway/web_service_svrs_test.rb +208 -2
- data/test/br_nfe/product/nfe/adicao_importacao_test.rb +19 -0
- data/test/br_nfe/product/nfe/cobranca/duplicata_test.rb +19 -0
- data/test/br_nfe/product/nfe/cobranca/fatura_test.rb +32 -0
- data/test/br_nfe/product/nfe/cobranca/pagamento_test.rb +105 -0
- data/test/br_nfe/product/nfe/declaracao_importacao_test.rb +116 -0
- data/test/br_nfe/product/nfe/detalhe_exportacao_test.rb +97 -0
- data/test/br_nfe/product/nfe/item_tax/cofins_st_test.rb +22 -0
- data/test/br_nfe/product/nfe/item_tax/cofins_test.rb +113 -0
- data/test/br_nfe/product/nfe/item_tax/icms_test.rb +1011 -0
- data/test/br_nfe/product/nfe/item_tax/icms_uf_destino_test.rb +99 -0
- data/test/br_nfe/product/nfe/item_tax/importacao_test.rb +23 -0
- data/test/br_nfe/product/nfe/item_tax/ipi_test.rb +160 -0
- data/test/br_nfe/product/nfe/item_tax/issqn_test.rb +84 -0
- data/test/br_nfe/product/nfe/item_tax/pis_st_test.rb +22 -0
- data/test/br_nfe/product/nfe/item_tax/pis_test.rb +113 -0
- data/test/br_nfe/product/nfe/item_test.rb +381 -0
- data/test/br_nfe/product/nfe/processo_referencia_test.rb +30 -0
- data/test/br_nfe/product/nfe/transporte/base_test.rb +182 -0
- data/test/br_nfe/product/nfe/transporte/transportador_test.rb +13 -0
- data/test/br_nfe/product/nfe/transporte/veiculo_test.rb +13 -0
- data/test/br_nfe/product/nfe/transporte/volume_test.rb +42 -0
- data/test/br_nfe/product/nota_fiscal_test.rb +662 -0
- data/test/br_nfe/product/operation/base_test.rb +538 -0
- data/test/br_nfe/product/operation/nfe_autorizacao_test.rb +378 -0
- data/test/br_nfe/product/operation/nfe_consulta_protocolo_test.rb +349 -0
- data/test/br_nfe/product/operation/nfe_download_nf_test.rb +93 -0
- data/test/br_nfe/product/operation/nfe_inutilizacao_test.rb +210 -0
- data/test/br_nfe/product/operation/nfe_recepcao_evento_test.rb +84 -0
- data/test/br_nfe/product/operation/nfe_ret_autorizacao_test.rb +309 -0
- data/test/br_nfe/product/operation/nfe_status_servico_test.rb +122 -0
- data/test/br_nfe/product/response/base_test.rb +75 -0
- data/test/br_nfe/product/response/build/base_test.rb +34 -0
- data/test/br_nfe/product/response/nfe_ret_autorizacao_test.rb +14 -0
- data/test/br_nfe/service/association/have_intermediario_test.rb +10 -10
- data/test/br_nfe/service/base_test.rb +9 -206
- data/test/br_nfe/service/betha/v1/cancela_nfse_test.rb +8 -6
- data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +6 -3
- data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +6 -3
- data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +7 -4
- data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +12 -9
- data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +6 -3
- data/test/br_nfe/service/rps_test.rb +2 -2
- data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +6 -3
- data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +7 -4
- data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +7 -4
- data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +8 -5
- data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +9 -6
- data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +6 -3
- data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +6 -3
- data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +6 -3
- data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +6 -3
- data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +8 -5
- data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +9 -6
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +6 -3
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +6 -3
- data/test/factories/person.rb +1 -1
- data/test/factories/product/destinatario.rb +11 -0
- data/test/factories/product/emitente.rb +1 -1
- data/test/factories/product/evento/base.rb +9 -0
- data/test/factories/product/evento/cancelamento.rb +10 -0
- data/test/factories/product/gateway/web_service_am.rb +5 -0
- data/test/factories/product/gateway/web_service_ba.rb +5 -0
- data/test/factories/product/nfe/adicao_importacao.rb +7 -0
- data/test/factories/product/nfe/cobranca/duplicata.rb +7 -0
- data/test/factories/product/nfe/cobranca/fatura.rb +8 -0
- data/test/factories/product/nfe/cobranca/pagamento.rb +9 -0
- data/test/factories/product/nfe/declaracao_importacao.rb +10 -0
- data/test/factories/product/nfe/detalhe_exportacao.rb +5 -0
- data/test/factories/product/nfe/item.rb +24 -0
- data/test/factories/product/nfe/item_tax/cofins.rb +5 -0
- data/test/factories/product/nfe/item_tax/cofins_st.rb +5 -0
- data/test/factories/product/nfe/item_tax/icms.rb +9 -0
- data/test/factories/product/nfe/item_tax/icms_uf_destino.rb +11 -0
- data/test/factories/product/nfe/item_tax/importacao.rb +8 -0
- data/test/factories/product/nfe/item_tax/ipi.rb +6 -0
- data/test/factories/product/nfe/item_tax/issqn.rb +9 -0
- data/test/factories/product/nfe/item_tax/pis.rb +5 -0
- data/test/factories/product/nfe/item_tax/pis_st.rb +5 -0
- data/test/factories/product/nfe/processo_referencia.rb +6 -0
- data/test/factories/product/nfe/transporte/base.rb +5 -0
- data/test/factories/product/nfe/transporte/transportador.rb +7 -0
- data/test/factories/product/nfe/transporte/veiculo.rb +7 -0
- data/test/factories/product/nfe/transporte/volume.rb +5 -0
- data/test/factories/product/nota_fiscal.rb +22 -0
- data/test/factories/product/{base.rb → operation/base.rb} +1 -1
- data/test/factories/product/operation/nfe_autorizacao.rb +590 -0
- data/test/factories/product/operation/nfe_consulta_protocolo.rb +13 -0
- data/test/factories/product/operation/nfe_download_nf.rb +15 -0
- data/test/factories/product/operation/nfe_inutilizacao.rb +19 -0
- data/test/factories/product/operation/nfe_recepcao_evento.rb +14 -0
- data/test/factories/product/operation/nfe_ret_autorizacao.rb +13 -0
- data/test/factories/product/{consulta_status_servico.rb → operation/nfe_status_servico.rb} +1 -1
- data/test/factories/product/response/base.rb +12 -0
- data/test/factories/product/response/build/base.rb +6 -0
- data/test/factories/product/response/nfe_ret_autorizacao.rb +13 -0
- data/test/factories/service/emitente.rb +1 -1
- data/test/fixtures/product/operation/nfe_autorizacao/nfe_signed.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_fail.xml +21 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_success.xml +25 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/with_proc.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/without_proc.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/original_xml.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_fail.xml +32 -0
- data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_success.xml +33 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_3.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_cancel.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/one_event.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/fail.xml +22 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/with_proc.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/without_proc.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_with_cancel.xml +198 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_without_cancel.xml +199 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_one.xml +89 -0
- data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_without.xml +34 -0
- data/test/fixtures/product/response/v3.10/nfe_inutilizacao/fail.xml +29 -0
- data/test/fixtures/product/response/v3.10/nfe_inutilizacao/success.xml +30 -0
- data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/fail.xml +34 -0
- data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/success.xml +36 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_fail.xml +22 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail.xml +33 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail_and_one_ok.xml +46 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_ok.xml +34 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_fail.xml +46 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_ok.xml +46 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_with_protocol.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_without_protocol.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_with_protocol.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_without_protocol.xml +1 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/lot.xml +2 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfe.xml +2 -0
- data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfeProc.xml +4 -0
- data/test/fixtures/product/response/v3.10/nfe_status_servico/fail.xml +23 -0
- data/test/fixtures/product/response/v3.10/nfe_status_servico/success.xml +22 -0
- data/test/fixtures/product/schemas/CCe_v1.00.xsd +11 -0
- data/test/fixtures/product/schemas/EPEC_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/LeiauteCadastroEmissorDFe_v1.01.xsd +234 -0
- data/test/fixtures/product/schemas/SuframaInternaliza_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/SuframaVistoria_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/atuCadEmiDFe_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/cabecMsg_v1.02.xsd +29 -0
- data/test/fixtures/product/schemas/cadEmiDFe_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/cancNFe_v2.00.xsd +9 -0
- data/test/fixtures/product/schemas/confRecebto_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/consCad_v2.00.xsd +9 -0
- data/test/fixtures/product/schemas/consDPEC_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/consNFeDest_v1.01.xsd +10 -0
- data/test/fixtures/product/schemas/consReciNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consReciNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/consSitNFe_v2.01.xsd +10 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consSitNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/consStatServ_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consStatServ_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/distDFeInt_v1.00.xsd +71 -0
- data/test/fixtures/product/schemas/downloadNFe_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/e110110_v1.00.xsd +58 -0
- data/test/fixtures/product/schemas/e110111_v1.00.xsd +42 -0
- data/test/fixtures/product/schemas/e110140_v1.00.xsd +124 -0
- data/test/fixtures/product/schemas/e111500_v1.00.xsd +69 -0
- data/test/fixtures/product/schemas/e111501_v1.00.xsd +69 -0
- data/test/fixtures/product/schemas/e111502_v1.00.xsd +50 -0
- data/test/fixtures/product/schemas/e111503_v1.00.xsd +50 -0
- data/test/fixtures/product/schemas/e210200_v1.00.xsd +32 -0
- data/test/fixtures/product/schemas/e210210_v1.00.xsd +32 -0
- data/test/fixtures/product/schemas/e210220_v1.00.xsd +45 -0
- data/test/fixtures/product/schemas/e210240_v1.00.xsd +44 -0
- data/test/fixtures/product/schemas/e411500_v1.00.xsd +134 -0
- data/test/fixtures/product/schemas/e411501_v1.00.xsd +134 -0
- data/test/fixtures/product/schemas/e411502_v1.00.xsd +95 -0
- data/test/fixtures/product/schemas/e411503_v1.00.xsd +95 -0
- data/test/fixtures/product/schemas/e990900_v1.00.xsd +87 -0
- data/test/fixtures/product/schemas/e990910_v1.00.xsd +81 -0
- data/test/fixtures/product/schemas/envCCe_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/envCancelPProrrogNFe_v1.0.xsd +50 -0
- data/test/fixtures/product/schemas/envConfRecebto_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/envDPEC_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/envEPEC_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/envEventoCancNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/envEvento_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/envFiscoNfe_v1.0.xsd +179 -0
- data/test/fixtures/product/schemas/envPProrrogNFe_v1.0.xsd +65 -0
- data/test/fixtures/product/schemas/envRemIndus_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/envSuframaInternaliza_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/envSuframaVistoria_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/enviNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/enviNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/eventoCancNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/eventoEPEC_v0.01.xsd +267 -0
- data/test/fixtures/product/schemas/eventoEPEC_v1.00.xsd +267 -0
- data/test/fixtures/product/schemas/eventoRemIndus_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/inutNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/inutNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/leiauteCCe_v1.00.xsd +418 -0
- data/test/fixtures/product/schemas/leiauteCancNFe_v2.00.xsd +143 -0
- data/test/fixtures/product/schemas/leiauteConfRecebto_v1.00.xsd +406 -0
- data/test/fixtures/product/schemas/leiauteConsNFeDest_v1.01.xsd +483 -0
- data/test/fixtures/product/schemas/leiauteConsSitNFe_v2.01.xsd +548 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteConsSitNFe_v3.10.xsd +502 -502
- data/test/fixtures/product/schemas/leiauteConsStatServ_v2.00.xsd +98 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteConsStatServ_v3.10.xsd +97 -97
- data/test/fixtures/product/schemas/leiauteConsultaCadastro_v1.01.xsd +355 -0
- data/test/fixtures/product/schemas/leiauteConsultaCadastro_v2.00.xsd +404 -0
- data/test/fixtures/product/schemas/leiauteDPEC_v1.01.xsd +464 -0
- data/test/fixtures/product/schemas/leiauteDownloadNFe_v1.00.xsd +149 -0
- data/test/fixtures/product/schemas/leiauteEPEC_v1.00.xsd +459 -0
- data/test/fixtures/product/schemas/leiauteEventoCancNFe_v1.00.xsd +394 -0
- data/test/fixtures/product/schemas/leiauteEvento_v1.00.xsd +373 -0
- data/test/fixtures/product/schemas/leiauteInutNFe_v2.00.xsd +193 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteInutNFe_v3.10.xsd +192 -192
- data/test/fixtures/product/schemas/leiauteNFe_v2.00.xsd +6661 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteNFe_v3.10.xsd +6060 -6060
- data/test/fixtures/product/schemas/leiauteRemIndus_v1.00.xsd +382 -0
- data/test/fixtures/product/schemas/leiauteSRE_v1.00.xsd +372 -0
- data/test/fixtures/product/schemas/leiauteSuframaInternaliza_v1.00.xsd +642 -0
- data/test/fixtures/product/schemas/leiauteSuframaVistoria_v1.00.xsd +648 -0
- data/test/fixtures/product/schemas/nfe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/nfe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/procCCeNFe_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/procCancNFe_v2.00.xsd +9 -0
- data/test/fixtures/product/schemas/procConfRecebtoNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/procEPEC_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/procEventoCancNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/procEventoNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/procEventoNFe_v99.99.xsd +37 -0
- data/test/fixtures/product/schemas/procInutNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/procInutNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/procNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/procNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/procRemIndus_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/resEvento_v1.00.xsd +94 -0
- data/test/fixtures/product/schemas/resNFe_v1.00.xsd +110 -0
- data/test/fixtures/product/schemas/retAtuCadEmiDFe_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/retCancNFe_v2.00.xsd +9 -0
- data/test/fixtures/product/schemas/retConsCad_v2.00.xsd +9 -0
- data/test/fixtures/product/schemas/retConsDPEC_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/retConsReciNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsReciNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/retConsSitNFe_v2.01.xsd +10 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsSitNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/retConsStatServ_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsStatServ_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/retDPEC_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/retDistDFeInt_v1.00.xsd +84 -0
- data/test/fixtures/product/schemas/retDownloadNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvCCe_v1.00.xsd +10 -0
- data/test/fixtures/product/schemas/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
- data/test/fixtures/product/schemas/retEnvConfRecebto_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvEPEC_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvEventoCancNFe_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvEvento_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvFiscoNFe_v1.0.xsd +234 -0
- data/test/fixtures/product/schemas/retEnvRemIndus_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvSuframaInternaliza_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnvSuframaVistoria_v1.00.xsd +9 -0
- data/test/fixtures/product/schemas/retEnviNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retEnviNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/retEventoEPEC_v0.01.xsd +207 -0
- data/test/fixtures/product/schemas/retInutNFe_v2.00.xsd +9 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retInutNFe_v3.10.xsd +8 -8
- data/test/fixtures/product/schemas/retPProrrogNFe_v1.0.xsd +233 -0
- data/test/fixtures/product/schemas/retconsNFeDest_v1.01.xsd +9 -0
- data/test/fixtures/product/schemas/tiposBasico_v1.03.xsd +816 -0
- data/test/fixtures/product/schemas/tiposBasico_v1.03_OPENSSL.xsd +816 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/tiposBasico_v3.10.xsd +571 -571
- data/test/fixtures/product/schemas/tiposBasico_v3.10_OPENSSL.xsd +877 -0
- data/test/fixtures/product/schemas/tiposDistDFe_v1.00.xsd +217 -0
- data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/xmldsig-core-schema_v1.01.xsd +97 -97
- data/test/fixtures/product/wsdl/NFeRetAutorizacao.xml +80 -0
- data/test/fixtures/product/wsdl/NfeAutorizacao.xml +107 -0
- data/test/fixtures/product/wsdl/NfeConsulta2.xml +80 -0
- data/test/fixtures/product/wsdl/NfeStatusServico2.xml +70 -0
- data/test/fixtures/product/wsdl/nfeinutilizacao2.xml +80 -0
- data/test/fixtures/service/wsdl/betha/v1/cancelar_nfse.xml +178 -0
- data/test/fixtures/service/wsdl/betha/v1/consultar_lote_rps.xml +339 -0
- data/test/fixtures/service/wsdl/betha/v1/consultar_nfse.xml +348 -0
- data/test/fixtures/service/wsdl/betha/v1/consultar_nfse_por_rps.xml +365 -0
- data/test/fixtures/service/wsdl/betha/v1/consultar_situacao_lote_rps.xml +74 -0
- data/test/fixtures/service/wsdl/betha/v1/recepcionar_lote_rps.xml +299 -0
- data/test/fixtures/service/wsdl/simpliss/v1/nfseservice.xml +1 -0
- data/test/fixtures/service/wsdl/thema/v1/nfse_cancelamento.xml +82 -0
- data/test/fixtures/service/wsdl/thema/v1/nfse_consulta.xml +235 -0
- data/test/fixtures/service/wsdl/thema/v1/nfse_remessa.xml +185 -0
- data/test/test_helper.rb +369 -1
- metadata +711 -33
- data/lib/br_nfe/product/base.rb +0 -82
- data/lib/br_nfe/product/consulta_status_servico.rb +0 -35
- data/lib/br_nfe/product/value_nf.rb +0 -9
- data/lib/br_nfe/product/xml/v3_10/consulta_status_servico.xml.slim +0 -4
- data/test/br_nfe/product/base_test.rb +0 -150
- data/test/br_nfe/product/consulta_status_servico_test.rb +0 -59
data/lib/br_nfe/service/base.rb
CHANGED
@@ -32,10 +32,6 @@ module BrNfe
|
|
32
32
|
[]
|
33
33
|
end
|
34
34
|
|
35
|
-
def id_attribute?
|
36
|
-
true
|
37
|
-
end
|
38
|
-
|
39
35
|
def request
|
40
36
|
@original_response = client_wsdl.call(method_wsdl, xml: soap_xml)
|
41
37
|
set_response
|
@@ -53,108 +49,8 @@ module BrNfe
|
|
53
49
|
BrNfe.emitente_service_class
|
54
50
|
end
|
55
51
|
|
56
|
-
def response_class
|
57
|
-
BrNfe::Service::Response::Default
|
58
|
-
end
|
59
|
-
|
60
52
|
def set_response
|
61
|
-
|
62
|
-
savon_response: @original_response, # Rsposta da requisição SOAP
|
63
|
-
keys_root_path: response_root_path, # Caminho inicial da resposta / Chave pai principal
|
64
|
-
nfe_xml_path: nfse_xml_path, # Caminho para encontrar a NF dentro do XML
|
65
|
-
body_xml_path: body_xml_path,
|
66
|
-
xml_encode: response_encoding, # Codificação do xml de resposta
|
67
|
-
lot_number_path: response_lot_number_path,
|
68
|
-
protocol_path: response_protocol_path,
|
69
|
-
received_date_path: response_received_date_path,
|
70
|
-
situation_path: response_situation_path,
|
71
|
-
situation_key_values: response_situation_key_values,
|
72
|
-
cancelation_date_time_path: response_cancelation_date_time_path,
|
73
|
-
message_errors_path: response_message_errors_path,
|
74
|
-
message_code_key: response_message_code_key,
|
75
|
-
message_msg_key: response_message_msg_key,
|
76
|
-
message_solution_key: response_message_solution_key,
|
77
|
-
invoices_path: response_invoices_path,
|
78
|
-
invoice_numero_nf_path: response_invoice_numero_nf_path,
|
79
|
-
invoice_codigo_verificacao_path: response_invoice_codigo_verificacao_path,
|
80
|
-
invoice_data_emissao_path: response_invoice_data_emissao_path,
|
81
|
-
invoice_url_nf_path: response_invoice_url_nf_path,
|
82
|
-
invoice_rps_numero_path: response_invoice_rps_numero_path,
|
83
|
-
invoice_rps_serie_path: response_invoice_rps_serie_path,
|
84
|
-
invoice_rps_tipo_path: response_invoice_rps_tipo_path,
|
85
|
-
invoice_rps_situacao_path: response_invoice_rps_situacao_path,
|
86
|
-
invoice_rps_substituido_numero_path: response_invoice_rps_substituido_numero_path,
|
87
|
-
invoice_rps_substituido_serie_path: response_invoice_rps_substituido_serie_path,
|
88
|
-
invoice_rps_substituido_tipo_path: response_invoice_rps_substituido_tipo_path,
|
89
|
-
invoice_data_emissao_rps_path: response_invoice_data_emissao_rps_path,
|
90
|
-
invoice_competencia_path: response_invoice_competencia_path,
|
91
|
-
invoice_natureza_operacao_path: response_invoice_natureza_operacao_path,
|
92
|
-
invoice_regime_especial_tributacao_path: response_invoice_regime_especial_tributacao_path,
|
93
|
-
invoice_optante_simples_nacional_path: response_invoice_optante_simples_nacional_path,
|
94
|
-
invoice_incentivador_cultural_path: response_invoice_incentivador_cultural_path,
|
95
|
-
invoice_outras_informacoes_path: response_invoice_outras_informacoes_path,
|
96
|
-
invoice_item_lista_servico_path: response_invoice_item_lista_servico_path,
|
97
|
-
invoice_cnae_code_path: response_invoice_cnae_code_path,
|
98
|
-
invoice_description_path: response_invoice_description_path,
|
99
|
-
invoice_codigo_municipio_path: response_invoice_codigo_municipio_path,
|
100
|
-
invoice_valor_total_servicos_path: response_invoice_valor_total_servicos_path,
|
101
|
-
invoice_deducoes_path: response_invoice_deducoes_path,
|
102
|
-
invoice_valor_pis_path: response_invoice_valor_pis_path,
|
103
|
-
invoice_valor_cofins_path: response_invoice_valor_cofins_path,
|
104
|
-
invoice_valor_inss_path: response_invoice_valor_inss_path,
|
105
|
-
invoice_valor_ir_path: response_invoice_valor_ir_path,
|
106
|
-
invoice_valor_csll_path: response_invoice_valor_csll_path,
|
107
|
-
invoice_iss_retido_path: response_invoice_iss_retido_path,
|
108
|
-
invoice_outras_retencoes_path: response_invoice_outras_retencoes_path,
|
109
|
-
invoice_total_iss_path: response_invoice_total_iss_path,
|
110
|
-
invoice_base_calculo_path: response_invoice_base_calculo_path,
|
111
|
-
invoice_iss_aliquota_path: response_invoice_iss_aliquota_path,
|
112
|
-
invoice_valor_liquido_path: response_invoice_valor_liquido_path,
|
113
|
-
invoice_desconto_condicionado_path: response_invoice_desconto_condicionado_path,
|
114
|
-
invoice_desconto_incondicionado_path: response_invoice_desconto_incondicionado_path,
|
115
|
-
invoice_responsavel_retencao_path: response_invoice_responsavel_retencao_path,
|
116
|
-
invoice_numero_processo_path: response_invoice_numero_processo_path,
|
117
|
-
invoice_municipio_incidencia_path: response_invoice_municipio_incidencia_path,
|
118
|
-
invoice_orgao_gerador_municipio_path: response_invoice_orgao_gerador_municipio_path,
|
119
|
-
invoice_orgao_gerador_uf_path: response_invoice_orgao_gerador_uf_path,
|
120
|
-
invoice_cancelamento_codigo_path: response_invoice_cancelamento_codigo_path,
|
121
|
-
invoice_cancelamento_numero_nf_path: response_invoice_cancelamento_numero_nf_path,
|
122
|
-
invoice_cancelamento_cnpj_path: response_invoice_cancelamento_cnpj_path,
|
123
|
-
invoice_cancelamento_municipio_path: response_invoice_cancelamento_municipio_path,
|
124
|
-
invoice_cancelamento_data_hora_path: response_invoice_cancelamento_data_hora_path,
|
125
|
-
invoice_cancelamento_inscricao_municipal_path: response_invoice_cancelamento_inscricao_municipal_path,
|
126
|
-
invoice_nfe_substituidora_path: response_invoice_nfe_substituidora_path,
|
127
|
-
invoice_codigo_obra_path: response_invoice_codigo_obra_path,
|
128
|
-
invoice_codigo_art_path: response_invoice_codigo_art_path,
|
129
|
-
invoice_emitente_cnpj_path: response_invoice_emitente_cnpj_path,
|
130
|
-
invoice_emitente_inscricao_municipal_path: response_invoice_emitente_inscricao_municipal_path,
|
131
|
-
invoice_emitente_razao_social_path: response_invoice_emitente_razao_social_path,
|
132
|
-
invoice_emitente_nome_fantasia_path: response_invoice_emitente_nome_fantasia_path,
|
133
|
-
invoice_emitente_telefone_path: response_invoice_emitente_telefone_path,
|
134
|
-
invoice_emitente_email_path: response_invoice_emitente_email_path,
|
135
|
-
invoice_emitente_endereco_logradouro_path: response_invoice_emitente_endereco_logradouro_path,
|
136
|
-
invoice_emitente_endereco_numero_path: response_invoice_emitente_endereco_numero_path,
|
137
|
-
invoice_emitente_endereco_complemento_path: response_invoice_emitente_endereco_complemento_path,
|
138
|
-
invoice_emitente_endereco_bairro_path: response_invoice_emitente_endereco_bairro_path,
|
139
|
-
invoice_emitente_endereco_codigo_municipio_path: response_invoice_emitente_endereco_codigo_municipio_path,
|
140
|
-
invoice_emitente_endereco_uf_path: response_invoice_emitente_endereco_uf_path,
|
141
|
-
invoice_emitente_endereco_cep_path: response_invoice_emitente_endereco_cep_path,
|
142
|
-
invoice_destinatario_cpf_path: response_invoice_destinatario_cpf_path,
|
143
|
-
invoice_destinatario_cnpj_path: response_invoice_destinatario_cnpj_path,
|
144
|
-
invoice_destinatario_inscricao_municipal_path: response_invoice_destinatario_inscricao_municipal_path,
|
145
|
-
invoice_destinatario_inscricao_estadual_path: response_invoice_destinatario_inscricao_estadual_path,
|
146
|
-
invoice_destinatario_inscricao_suframa_path: response_invoice_destinatario_inscricao_suframa_path,
|
147
|
-
invoice_destinatario_razao_social_path: response_invoice_destinatario_razao_social_path,
|
148
|
-
invoice_destinatario_telefone_path: response_invoice_destinatario_telefone_path,
|
149
|
-
invoice_destinatario_email_path: response_invoice_destinatario_email_path,
|
150
|
-
invoice_destinatario_endereco_logradouro_path: response_invoice_destinatario_endereco_logradouro_path,
|
151
|
-
invoice_destinatario_endereco_numero_path: response_invoice_destinatario_endereco_numero_path,
|
152
|
-
invoice_destinatario_endereco_complemento_path: response_invoice_destinatario_endereco_complemento_path,
|
153
|
-
invoice_destinatario_endereco_bairro_path: response_invoice_destinatario_endereco_bairro_path,
|
154
|
-
invoice_destinatario_endereco_codigo_municipio_path: response_invoice_destinatario_endereco_codigo_municipio_path,
|
155
|
-
invoice_destinatario_endereco_uf_path: response_invoice_destinatario_endereco_uf_path,
|
156
|
-
invoice_destinatario_endereco_cep_path: response_invoice_destinatario_endereco_cep_path,
|
157
|
-
).response
|
53
|
+
raise "O método #set_response deve ser implementado para a classe #{self}"
|
158
54
|
end
|
159
55
|
|
160
56
|
end
|
@@ -10,7 +10,7 @@ module BrNfe
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def wsdl
|
13
|
-
"http://e-gov.betha.com.br/e-nota-contribuinte-#{'test-' if env == :test}ws/
|
13
|
+
"http://e-gov.betha.com.br/e-nota-contribuinte-#{'test-' if env == :test}ws/cancelarNfse?wsdl"
|
14
14
|
end
|
15
15
|
|
16
16
|
def method_wsdl
|
@@ -9,6 +9,8 @@ module BrNfe
|
|
9
9
|
'http://wshomologacao.simplissweb.com.br/nfseservice.svc?wsdl'
|
10
10
|
elsif ibge_code_of_issuer_city == '4202008' # Balneário Camboriú
|
11
11
|
'http://wsbalneariocamboriu.simplissweb.com.br/nfseservice.svc?wsdl'
|
12
|
+
else # Se não encontrar a cidade pega por padrão o WS de homologação
|
13
|
+
'http://wshomologacao.simplissweb.com.br/nfseservice.svc?wsdl'
|
12
14
|
end
|
13
15
|
end
|
14
16
|
|
data/lib/br_nfe/version.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module BrNfe
|
2
2
|
module Version
|
3
3
|
MAJOR = 2 #inclui alterações de API e pode quebrar compatibilidade com versões anteriores
|
4
|
-
MINOR =
|
5
|
-
PATCH =
|
4
|
+
MINOR = 2 #inclui novas funcionalidades, sem quebrar APIs existentes
|
5
|
+
PATCH = 0 #corrige bugs ou traz melhorias em implementações já existentes
|
6
6
|
CURRENT = "#{MAJOR}.#{MINOR}.#{PATCH}"
|
7
7
|
end
|
8
8
|
end
|
data/lib/br_nfe.rb
CHANGED
@@ -5,6 +5,9 @@ require 'active_support/core_ext/class'
|
|
5
5
|
require 'active_support/core_ext/enumerable'
|
6
6
|
require 'active_support/core_ext/object'
|
7
7
|
require 'active_support/core_ext/string'
|
8
|
+
require 'active_support/core_ext/module'
|
9
|
+
|
10
|
+
require "br_nfe/active_model/associations"
|
8
11
|
|
9
12
|
require "br_nfe/helper/string_methods"
|
10
13
|
|
@@ -42,6 +45,8 @@ module BrNfe
|
|
42
45
|
File.expand_path '../..', __FILE__
|
43
46
|
end
|
44
47
|
|
48
|
+
I18n.load_path += Dir[BrNfe.root+'/lib/config/locales/br_nfe/**/*.{rb,yml}']
|
49
|
+
|
45
50
|
Time::DATE_FORMATS[:br_nfe] = "%Y-%m-%dT%H:%M:%S"
|
46
51
|
DateTime::DATE_FORMATS[:br_nfe] = "%Y-%m-%dT%H:%M:%S"
|
47
52
|
Date::DATE_FORMATS[:br_nfe] = "%Y-%m-%d"
|
@@ -50,6 +55,14 @@ module BrNfe
|
|
50
55
|
[true, :true, 'true', 't', :t, 1, '1', :TRUE, 'TRUE', 'T']
|
51
56
|
end
|
52
57
|
|
58
|
+
module Calculos
|
59
|
+
extend ActiveSupport::Autoload
|
60
|
+
autoload :FatoresDeMultiplicacao
|
61
|
+
autoload :Modulo11
|
62
|
+
autoload :Modulo11FatorDe2a9
|
63
|
+
autoload :Modulo11FatorDe2a9RestoZero
|
64
|
+
end
|
65
|
+
|
53
66
|
extend ActiveSupport::Autoload
|
54
67
|
autoload :Constants
|
55
68
|
autoload :ActiveModelBase
|
@@ -153,15 +166,101 @@ module BrNfe
|
|
153
166
|
|
154
167
|
module Product
|
155
168
|
extend ActiveSupport::Autoload
|
169
|
+
|
170
|
+
module Nfe
|
171
|
+
extend ActiveSupport::Autoload
|
172
|
+
autoload :DetalheExportacao
|
173
|
+
autoload :DeclaracaoImportacao
|
174
|
+
autoload :AdicaoImportacao
|
175
|
+
autoload :Item
|
176
|
+
autoload :ProcessoReferencia
|
177
|
+
module Cobranca
|
178
|
+
extend ActiveSupport::Autoload
|
179
|
+
autoload :Fatura
|
180
|
+
autoload :Duplicata
|
181
|
+
autoload :Pagamento
|
182
|
+
end
|
183
|
+
module Transporte
|
184
|
+
extend ActiveSupport::Autoload
|
185
|
+
autoload :Base
|
186
|
+
autoload :Veiculo
|
187
|
+
autoload :Volume
|
188
|
+
autoload :Transportador
|
189
|
+
end
|
190
|
+
module ItemTax
|
191
|
+
extend ActiveSupport::Autoload
|
192
|
+
autoload :Icms
|
193
|
+
autoload :Ipi
|
194
|
+
autoload :Importacao
|
195
|
+
autoload :Pis
|
196
|
+
autoload :PisSt
|
197
|
+
autoload :Cofins
|
198
|
+
autoload :CofinsSt
|
199
|
+
autoload :Issqn
|
200
|
+
autoload :IcmsUfDestino
|
201
|
+
end
|
202
|
+
end
|
156
203
|
module Gateway
|
157
204
|
extend ActiveSupport::Autoload
|
158
205
|
autoload :Base
|
206
|
+
autoload :WebServiceAM
|
207
|
+
autoload :WebServiceBA
|
208
|
+
autoload :WebServiceCE
|
209
|
+
autoload :WebServiceGO
|
210
|
+
autoload :WebServiceMG
|
211
|
+
autoload :WebServiceMS
|
212
|
+
autoload :WebServiceMT
|
213
|
+
autoload :WebServicePE
|
214
|
+
autoload :WebServicePR
|
215
|
+
autoload :WebServiceRS
|
216
|
+
autoload :WebServiceSP
|
217
|
+
autoload :WebServiceSVAN
|
218
|
+
autoload :WebServiceSvcAN
|
219
|
+
autoload :WebServiceSvcRS
|
159
220
|
autoload :WebServiceSVRS
|
160
221
|
end
|
222
|
+
|
223
|
+
module Evento
|
224
|
+
extend ActiveSupport::Autoload
|
225
|
+
autoload :Base
|
226
|
+
autoload :Cancelamento
|
227
|
+
end
|
228
|
+
autoload :NfXmlValue
|
161
229
|
autoload :Emitente
|
162
|
-
autoload :
|
163
|
-
autoload :
|
164
|
-
|
230
|
+
autoload :Destinatario
|
231
|
+
autoload :NotaFiscal
|
232
|
+
|
233
|
+
module Operation
|
234
|
+
extend ActiveSupport::Autoload
|
235
|
+
autoload :Base
|
236
|
+
autoload :NfeAutorizacao
|
237
|
+
autoload :NfeRetAutorizacao
|
238
|
+
autoload :NfeConsultaProtocolo
|
239
|
+
autoload :NfeDownloadNf
|
240
|
+
autoload :NfeInutilizacao
|
241
|
+
autoload :NfeRecepcaoEvento
|
242
|
+
autoload :NfeStatusServico
|
243
|
+
end
|
244
|
+
|
245
|
+
module Response
|
246
|
+
extend ActiveSupport::Autoload
|
247
|
+
autoload :Base
|
248
|
+
autoload :NfeAutorizacao
|
249
|
+
autoload :NfeRetAutorizacao
|
250
|
+
autoload :NfeConsultaProtocolo
|
251
|
+
autoload :NfeInutilizacao
|
252
|
+
autoload :NfeStatusServico
|
253
|
+
autoload :Event
|
254
|
+
module Build
|
255
|
+
extend ActiveSupport::Autoload
|
256
|
+
autoload :Base
|
257
|
+
autoload :NfeAutorizacao
|
258
|
+
autoload :NfeRetAutorizacao
|
259
|
+
autoload :NfeConsultaProtocolo
|
260
|
+
autoload :NfeInutilizacao
|
261
|
+
autoload :NfeStatusServico
|
262
|
+
end
|
263
|
+
end
|
165
264
|
end
|
166
265
|
|
167
266
|
|
@@ -175,34 +274,93 @@ module BrNfe
|
|
175
274
|
mattr_accessor :endereco_class
|
176
275
|
@@endereco_class = BrNfe::Endereco
|
177
276
|
|
178
|
-
# Define as classes que serão usadas para instanciar o objeto
|
179
|
-
# Emitente para as notas de Serviço e Produto
|
180
|
-
mattr_accessor :emitente_service_class
|
181
|
-
mattr_accessor :emitente_product_class
|
182
|
-
@@emitente_service_class = BrNfe::Service::Emitente
|
183
|
-
@@emitente_product_class = BrNfe::Product::Emitente
|
184
|
-
|
185
|
-
mattr_accessor :destinatario_service_class
|
186
|
-
@@destinatario_service_class = BrNfe::Service::Destinatario
|
187
|
-
|
188
|
-
mattr_accessor :intermediario_service_class
|
189
|
-
@@intermediario_service_class = BrNfe::Service::Intermediario
|
190
|
-
|
191
277
|
mattr_accessor :condicao_pagamento_class
|
192
278
|
@@condicao_pagamento_class = BrNfe::CondicaoPagamento
|
193
279
|
|
194
|
-
mattr_accessor :rps_class
|
195
|
-
@@rps_class = BrNfe::Service::Rps
|
196
|
-
|
197
|
-
mattr_accessor :service_item_class
|
198
|
-
@@service_item_class = BrNfe::Service::Item
|
199
|
-
|
200
280
|
mattr_accessor :client_wsdl_log
|
201
281
|
@@client_wsdl_log = false
|
202
282
|
|
203
283
|
mattr_accessor :client_wsdl_pretty_print_xml
|
204
284
|
@@client_wsdl_pretty_print_xml = false
|
205
285
|
|
286
|
+
#################################################################################
|
287
|
+
################### DEFINIÇÃO DE CLASSES PADRÕES PARA NFS-e #####################
|
288
|
+
mattr_accessor :emitente_service_class
|
289
|
+
@@emitente_service_class = BrNfe::Service::Emitente
|
290
|
+
mattr_accessor :destinatario_service_class
|
291
|
+
@@destinatario_service_class = BrNfe::Service::Destinatario
|
292
|
+
mattr_accessor :intermediario_service_class
|
293
|
+
@@intermediario_service_class = BrNfe::Service::Intermediario
|
294
|
+
mattr_accessor :rps_class
|
295
|
+
@@rps_class = BrNfe::Service::Rps
|
296
|
+
mattr_accessor :service_item_class
|
297
|
+
@@service_item_class = BrNfe::Service::Item
|
298
|
+
|
299
|
+
#################################################################################
|
300
|
+
################### DEFINIÇÃO DE CLASSES PADRÕES PARA NF-E ######################
|
301
|
+
mattr_accessor :destinatario_product_class
|
302
|
+
@@destinatario_product_class = BrNfe::Product::Destinatario
|
303
|
+
mattr_accessor :emitente_product_class
|
304
|
+
@@emitente_product_class = BrNfe::Product::Emitente
|
305
|
+
mattr_accessor :nota_fiscal_product_class
|
306
|
+
@@nota_fiscal_product_class = BrNfe::Product::NotaFiscal
|
307
|
+
mattr_accessor :declaracao_importacao_product_class
|
308
|
+
@@declaracao_importacao_product_class = BrNfe::Product::Nfe::DeclaracaoImportacao
|
309
|
+
mattr_accessor :adicao_importacao_product_class
|
310
|
+
@@adicao_importacao_product_class = BrNfe::Product::Nfe::AdicaoImportacao
|
311
|
+
mattr_accessor :detalhe_exportacao_product_class
|
312
|
+
@@detalhe_exportacao_product_class = BrNfe::Product::Nfe::DetalheExportacao
|
313
|
+
mattr_accessor :item_product_class
|
314
|
+
@@item_product_class = BrNfe::Product::Nfe::Item
|
315
|
+
mattr_accessor :processo_referencia_product_class
|
316
|
+
@@processo_referencia_product_class = BrNfe::Product::Nfe::ProcessoReferencia
|
317
|
+
|
318
|
+
############################# EVENTOS ##############################
|
319
|
+
mattr_accessor :cancelamento_product_class
|
320
|
+
@@cancelamento_product_class = BrNfe::Product::Evento::Cancelamento
|
321
|
+
|
322
|
+
######################### IMPOSTOS DO ITEM #########################
|
323
|
+
mattr_accessor :icms_item_tax_product_class
|
324
|
+
@@icms_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Icms
|
325
|
+
mattr_accessor :cofins_item_tax_product_class
|
326
|
+
@@cofins_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Cofins
|
327
|
+
mattr_accessor :cofins_st_item_tax_product_class
|
328
|
+
@@cofins_st_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::CofinsSt
|
329
|
+
mattr_accessor :icms_uf_destino_item_tax_product_class
|
330
|
+
@@icms_uf_destino_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::IcmsUfDestino
|
331
|
+
mattr_accessor :importacao_item_tax_product_class
|
332
|
+
@@importacao_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Importacao
|
333
|
+
mattr_accessor :ipi_item_tax_product_class
|
334
|
+
@@ipi_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Ipi
|
335
|
+
mattr_accessor :issqn_item_tax_product_class
|
336
|
+
@@issqn_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Issqn
|
337
|
+
mattr_accessor :pis_item_tax_product_class
|
338
|
+
@@pis_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::Pis
|
339
|
+
mattr_accessor :pis_st_item_tax_product_class
|
340
|
+
@@pis_st_item_tax_product_class = BrNfe::Product::Nfe::ItemTax::PisSt
|
341
|
+
|
342
|
+
############################# COBRANÇA #############################
|
343
|
+
mattr_accessor :duplicata_product_class
|
344
|
+
@@duplicata_product_class = BrNfe::Product::Nfe::Cobranca::Duplicata
|
345
|
+
mattr_accessor :fatura_product_class
|
346
|
+
@@fatura_product_class = BrNfe::Product::Nfe::Cobranca::Fatura
|
347
|
+
mattr_accessor :pagamento_product_class
|
348
|
+
@@pagamento_product_class = BrNfe::Product::Nfe::Cobranca::Pagamento
|
349
|
+
|
350
|
+
############################ TRANSPORTE ############################
|
351
|
+
mattr_accessor :transporte_product_class
|
352
|
+
@@transporte_product_class = BrNfe::Product::Nfe::Transporte::Base
|
353
|
+
|
354
|
+
mattr_accessor :veiculo_product_class
|
355
|
+
@@veiculo_product_class = BrNfe::Product::Nfe::Transporte::Veiculo
|
356
|
+
|
357
|
+
mattr_accessor :volume_transporte_product_class
|
358
|
+
@@volume_transporte_product_class = BrNfe::Product::Nfe::Transporte::Volume
|
359
|
+
|
360
|
+
mattr_accessor :transportador_product_class
|
361
|
+
@@transportador_product_class = BrNfe::Product::Nfe::Transporte::Transportador
|
362
|
+
|
363
|
+
|
206
364
|
def self.setup
|
207
365
|
yield self
|
208
366
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
en:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/declaracao_importacao:
|
6
|
+
invalid_adicao: 'Adition %{index}: %{error_message}'
|
7
|
+
attributes:
|
8
|
+
adicoes:
|
9
|
+
too_long: 'exceeded the maximum limit of %{count} additions'
|
10
|
+
too_short: 'must have at least %{count}'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
en:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/item:
|
6
|
+
invalid_declaracao_importacao: 'Import declaration %{index}: %{error_message}'
|
7
|
+
invalid_detalhe_exportacao: 'Export detail %{index}: %{error_message}'
|
8
|
+
invalid_icms: 'ICMS > %{error_message}'
|
9
|
+
invalid_ipi: 'IPI > %{error_message}'
|
10
|
+
invalid_pis: 'PIS > %{error_message}'
|
11
|
+
invalid_cofins: 'COFINS > %{error_message}'
|
12
|
+
invalid_pis_st: 'PIS ST > %{error_message}'
|
13
|
+
invalid_cofins_st: 'COFINS ST > %{error_message}'
|
14
|
+
invalid_importacao: 'Import tax > %{error_message}'
|
15
|
+
invalid_issqn: 'ISSQN > %{error_message}'
|
16
|
+
invalid_icms_uf_destino: 'ICMS Sharing > %{error_message}'
|
17
|
+
attributes:
|
18
|
+
declaracoes_importacao:
|
19
|
+
too_long: 'exceeded the maximum limit of %{count} declarations'
|
20
|
+
too_short: 'must have at least %{count}'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
en:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/transporte/base:
|
6
|
+
invalid_veiculo: 'Vehicle: %{error_message}'
|
7
|
+
invalid_reboque: 'Reboque %{index}: %{error_message}'
|
8
|
+
invalid_volume: 'Volume %{index}: %{error_message}'
|
9
|
+
invalid_transportador: 'Shipping company: %{error_message}'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
en:
|
2
|
+
activemodel:
|
3
|
+
attributes::
|
4
|
+
br_nfe/product/nota_fiscal:
|
5
|
+
endereco_retirada_cpf_cnpj: CPF/CNPJ withdrawal address
|
6
|
+
autorizados_download_xml: CPF/CNPJ authorized to download the XML of NF-e
|
7
|
+
errors:
|
8
|
+
models:
|
9
|
+
br_nfe/product/nota_fiscal:
|
10
|
+
invalid_emitente: 'Issuer > %{error_message}'
|
11
|
+
invalid_destinatario: 'Addressee > %{error_message}'
|
12
|
+
invalid_transporte: 'Transport: %{error_message}'
|
13
|
+
invalid_fatura: 'Billing Invoice: %{error_message}'
|
14
|
+
invalid_pagamento: 'Payment %{index}: %{error_message}'
|
15
|
+
invalid_endereco_retirada: 'Withdrawal address: %{error_message}'
|
16
|
+
invalid_endereco_entrega: 'Delivery address: %{error_message}'
|
17
|
+
invalid_item: 'Item %{index} > %{error_message}'
|
18
|
+
invalid_processo: 'Process %{index} > %{error_message}'
|
19
|
+
attributes:
|
20
|
+
autorizados_download_xml:
|
21
|
+
too_long: "exceeded the maximum limit of %{count} CPF/CNPJ's"
|
@@ -0,0 +1,10 @@
|
|
1
|
+
en:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/operation/nfe_autorizacao:
|
6
|
+
invalid_invoice: 'Invoice %{index}: %{error_message}'
|
7
|
+
attributes:
|
8
|
+
notas_fiscais:
|
9
|
+
too_long: 'exceeded the maximum limit of %{count} invoices'
|
10
|
+
too_short: 'must have minimum %{count}'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/declaracao_importacao:
|
6
|
+
invalid_adicao: 'Adição %{index}: %{error_message}'
|
7
|
+
attributes:
|
8
|
+
adicoes:
|
9
|
+
too_long: 'excedeu o limite máximo de %{count} adições'
|
10
|
+
too_short: 'deve ter no mímino %{count}'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/item:
|
6
|
+
invalid_declaracao_importacao: 'Declaração importação %{index}: %{error_message}'
|
7
|
+
invalid_detalhe_exportacao: 'Detalhe de exportação %{index}: %{error_message}'
|
8
|
+
invalid_icms: 'ICMS > %{error_message}'
|
9
|
+
invalid_ipi: 'IPI > %{error_message}'
|
10
|
+
invalid_pis: 'PIS > %{error_message}'
|
11
|
+
invalid_cofins: 'COFINS > %{error_message}'
|
12
|
+
invalid_pis_st: 'PIS ST > %{error_message}'
|
13
|
+
invalid_cofins_st: 'COFINS ST > %{error_message}'
|
14
|
+
invalid_importacao: 'Imposto de importação > %{error_message}'
|
15
|
+
invalid_issqn: 'ISSQN > %{error_message}'
|
16
|
+
invalid_icms_uf_destino: 'Partilha de ICMS > %{error_message}'
|
17
|
+
attributes:
|
18
|
+
declaracoes_importacao:
|
19
|
+
too_long: 'excedeu o limite máximo de %{count} declarações'
|
20
|
+
too_short: 'deve ter no mímino %{count}'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/nfe/transporte/base:
|
6
|
+
invalid_reboque: 'Reboque %{index}: %{error_message}'
|
7
|
+
invalid_volume: 'Volume %{index}: %{error_message}'
|
8
|
+
invalid_transportador: 'Transportadora: %{error_message}'
|
9
|
+
invalid_veiculo: 'Veículo: %{error_message}'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
attributes::
|
4
|
+
br_nfe/product/nota_fiscal:
|
5
|
+
endereco_retirada_cpf_cnpj: CPF/CNPJ do endereço de retirada
|
6
|
+
autorizados_download_xml: CPF/CNPJ autorizados a baixar o XML da NF-e
|
7
|
+
errors:
|
8
|
+
models:
|
9
|
+
br_nfe/product/nota_fiscal:
|
10
|
+
invalid_emitente: 'Emitente > %{error_message}'
|
11
|
+
invalid_destinatario: 'Destinatário > %{error_message}'
|
12
|
+
invalid_transporte: 'Transporte: %{error_message}'
|
13
|
+
invalid_fatura: 'Fatura: %{error_message}'
|
14
|
+
invalid_pagamento: 'Pagamento %{index}: %{error_message}'
|
15
|
+
invalid_endereco_retirada: 'Endereço de retirada: %{error_message}'
|
16
|
+
invalid_endereco_entrega: 'Endereço de entrega: %{error_message}'
|
17
|
+
invalid_item: 'Item %{index} > %{error_message}'
|
18
|
+
invalid_processo: 'Processo %{index} > %{error_message}'
|
19
|
+
attributes:
|
20
|
+
autorizados_download_xml:
|
21
|
+
too_long: 'excedeu o limite máximo de %{count} CPF/CNPJ'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pt-BR:
|
2
|
+
activemodel:
|
3
|
+
errors:
|
4
|
+
models:
|
5
|
+
br_nfe/product/operation/nfe_autorizacao:
|
6
|
+
invalid_invoice: 'Nota fiscal %{index}: %{error_message}'
|
7
|
+
attributes:
|
8
|
+
notas_fiscais:
|
9
|
+
too_long: 'excedeu o limite máximo de %{count} notas fiscais'
|
10
|
+
too_short: 'deve ter mínimo %{count}'
|
@@ -26,8 +26,8 @@ describe HaveDestinatarioTest do
|
|
26
26
|
|
27
27
|
it 'deve_manter_o_objeto_destinatario_se_ja_tiver' do
|
28
28
|
subject.destinatario.must_equal destinatario
|
29
|
-
destinatario.cpf_cnpj = '
|
30
|
-
subject.destinatario.cpf_cnpj.must_equal '
|
29
|
+
destinatario.cpf_cnpj = '1234567890'
|
30
|
+
subject.destinatario.cpf_cnpj.must_equal '01234567890'
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'Se_setar_o_destinatario_com_outra_class_deve_ignorar' do
|
@@ -36,21 +36,21 @@ describe HaveDestinatarioTest do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'posso_setar_o_destinatario_com_um_hash_com_os_parametros_do_destinatario' do
|
39
|
-
destinatario.assign_attributes(cpf_cnpj: '
|
40
|
-
subject.destinatario = {cpf_cnpj: '
|
41
|
-
subject.destinatario.cpf_cnpj.must_equal '
|
39
|
+
destinatario.assign_attributes(cpf_cnpj: '12345678901', telefone: '123465', email: 'mail@mail.com')
|
40
|
+
subject.destinatario = {cpf_cnpj: '12345678901', telefone: '654389', email: 'mail2'}
|
41
|
+
subject.destinatario.cpf_cnpj.must_equal '12345678901'
|
42
42
|
subject.destinatario.telefone.must_equal '654389'
|
43
43
|
subject.destinatario.email.must_equal 'mail2'
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'posso_setar_o_destinatario_com_um_bloco' do
|
47
|
-
destinatario.assign_attributes(cpf_cnpj: '
|
47
|
+
destinatario.assign_attributes(cpf_cnpj: '12345678901', telefone: '11111', email: 'mail1')
|
48
48
|
subject.destinatario do |address|
|
49
|
-
address.cpf_cnpj = '
|
49
|
+
address.cpf_cnpj = '99999999999'
|
50
50
|
address.telefone = '11111'
|
51
51
|
address.email = 'mail1'
|
52
52
|
end
|
53
|
-
subject.destinatario.cpf_cnpj.must_equal '
|
53
|
+
subject.destinatario.cpf_cnpj.must_equal '99999999999'
|
54
54
|
subject.destinatario.telefone.must_equal '11111'
|
55
55
|
subject.destinatario.email.must_equal 'mail1'
|
56
56
|
end
|