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.
Files changed (495) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +12 -2
  5. data/README.markdown +3 -1
  6. data/Rakefile +20 -1
  7. data/lib/br_nfe/active_model/associations.rb +11 -0
  8. data/lib/br_nfe/active_model/has_many.rb +65 -0
  9. data/lib/br_nfe/active_model/has_one.rb +57 -0
  10. data/lib/br_nfe/active_model_base.rb +38 -1
  11. data/lib/br_nfe/base.rb +9 -0
  12. data/lib/br_nfe/calculos/fatores_de_multiplicacao.rb +67 -0
  13. data/lib/br_nfe/calculos/modulo11.rb +54 -0
  14. data/lib/br_nfe/calculos/modulo11_fator_de2a9.rb +83 -0
  15. data/lib/br_nfe/calculos/modulo11_fator_de2a9_resto_zero.rb +29 -0
  16. data/lib/br_nfe/constants.rb +46 -1
  17. data/lib/br_nfe/endereco.rb +6 -2
  18. data/lib/br_nfe/helper/cpf_cnpj.rb +8 -1
  19. data/lib/br_nfe/person.rb +32 -3
  20. data/lib/br_nfe/product/destinatario.rb +45 -0
  21. data/lib/br_nfe/product/emitente.rb +14 -1
  22. data/lib/br_nfe/product/evento/base.rb +146 -0
  23. data/lib/br_nfe/product/evento/cancelamento.rb +46 -0
  24. data/lib/br_nfe/product/gateway/base.rb +16 -43
  25. data/lib/br_nfe/product/gateway/web_service_am.rb +140 -0
  26. data/lib/br_nfe/product/gateway/web_service_ba.rb +140 -0
  27. data/lib/br_nfe/product/gateway/web_service_ce.rb +162 -0
  28. data/lib/br_nfe/product/gateway/web_service_go.rb +140 -0
  29. data/lib/br_nfe/product/gateway/web_service_mg.rb +140 -0
  30. data/lib/br_nfe/product/gateway/web_service_ms.rb +140 -0
  31. data/lib/br_nfe/product/gateway/web_service_mt.rb +140 -0
  32. data/lib/br_nfe/product/gateway/web_service_pe.rb +140 -0
  33. data/lib/br_nfe/product/gateway/web_service_pr.rb +140 -0
  34. data/lib/br_nfe/product/gateway/web_service_rs.rb +140 -0
  35. data/lib/br_nfe/product/gateway/web_service_sp.rb +140 -0
  36. data/lib/br_nfe/product/gateway/web_service_svan.rb +162 -0
  37. data/lib/br_nfe/product/gateway/web_service_svc_an.rb +131 -0
  38. data/lib/br_nfe/product/gateway/web_service_svc_rs.rb +20 -0
  39. data/lib/br_nfe/product/gateway/web_service_svrs.rb +111 -10
  40. data/lib/br_nfe/product/nf_xml_value.rb +278 -0
  41. data/lib/br_nfe/product/nfe/adicao_importacao.rb +76 -0
  42. data/lib/br_nfe/product/nfe/cobranca/duplicata.rb +44 -0
  43. data/lib/br_nfe/product/nfe/cobranca/fatura.rb +64 -0
  44. data/lib/br_nfe/product/nfe/cobranca/pagamento.rb +99 -0
  45. data/lib/br_nfe/product/nfe/declaracao_importacao.rb +221 -0
  46. data/lib/br_nfe/product/nfe/detalhe_exportacao.rb +89 -0
  47. data/lib/br_nfe/product/nfe/item.rb +678 -0
  48. data/lib/br_nfe/product/nfe/item_tax/cofins.rb +138 -0
  49. data/lib/br_nfe/product/nfe/item_tax/cofins_st.rb +68 -0
  50. data/lib/br_nfe/product/nfe/item_tax/icms.rb +593 -0
  51. data/lib/br_nfe/product/nfe/item_tax/icms_uf_destino.rb +169 -0
  52. data/lib/br_nfe/product/nfe/item_tax/importacao.rb +62 -0
  53. data/lib/br_nfe/product/nfe/item_tax/ipi.rb +179 -0
  54. data/lib/br_nfe/product/nfe/item_tax/issqn.rb +256 -0
  55. data/lib/br_nfe/product/nfe/item_tax/pis.rb +138 -0
  56. data/lib/br_nfe/product/nfe/item_tax/pis_st.rb +68 -0
  57. data/lib/br_nfe/product/nfe/processo_referencia.rb +48 -0
  58. data/lib/br_nfe/product/nfe/transporte/base.rb +264 -0
  59. data/lib/br_nfe/product/nfe/transporte/transportador.rb +15 -0
  60. data/lib/br_nfe/product/nfe/transporte/veiculo.rb +53 -0
  61. data/lib/br_nfe/product/nfe/transporte/volume.rb +89 -0
  62. data/lib/br_nfe/product/nota_fiscal.rb +1173 -0
  63. data/lib/br_nfe/product/operation/base.rb +255 -0
  64. data/lib/br_nfe/product/operation/nfe_autorizacao.rb +118 -0
  65. data/lib/br_nfe/product/operation/nfe_consulta_protocolo.rb +61 -0
  66. data/lib/br_nfe/product/operation/nfe_download_nf.rb +86 -0
  67. data/lib/br_nfe/product/operation/nfe_inutilizacao.rb +168 -0
  68. data/lib/br_nfe/product/operation/nfe_recepcao_evento.rb +70 -0
  69. data/lib/br_nfe/product/operation/nfe_ret_autorizacao.rb +63 -0
  70. data/lib/br_nfe/product/operation/nfe_status_servico.rb +46 -0
  71. data/lib/br_nfe/product/response/base.rb +97 -0
  72. data/lib/br_nfe/product/response/build/base.rb +287 -0
  73. data/lib/br_nfe/product/response/build/nfe_autorizacao.rb +102 -0
  74. data/lib/br_nfe/product/response/build/nfe_consulta_protocolo.rb +133 -0
  75. data/lib/br_nfe/product/response/build/nfe_inutilizacao.rb +53 -0
  76. data/lib/br_nfe/product/response/build/nfe_ret_autorizacao.rb +65 -0
  77. data/lib/br_nfe/product/response/build/nfe_status_servico.rb +43 -0
  78. data/lib/br_nfe/product/response/event.rb +89 -0
  79. data/lib/br_nfe/product/response/nfe_autorizacao.rb +12 -0
  80. data/lib/br_nfe/product/response/nfe_consulta_protocolo.rb +13 -0
  81. data/lib/br_nfe/product/response/nfe_inutilizacao.rb +89 -0
  82. data/lib/br_nfe/product/response/nfe_ret_autorizacao.rb +9 -0
  83. data/lib/br_nfe/product/response/nfe_status_servico.rb +31 -0
  84. data/lib/br_nfe/product/xml/_signed_info_sh1.xml.slim +9 -0
  85. data/lib/br_nfe/product/xml/_tc_cpf_cnpj.xml.slim +7 -0
  86. data/lib/br_nfe/product/xml/signature_sh1.xml.slim +12 -0
  87. data/lib/br_nfe/product/xml/v1_00/evento/infEventoCancelamento.xml.slim +19 -0
  88. data/lib/br_nfe/product/xml/v1_00/root/NfeDownloadNf.xml.slim +5 -0
  89. data/lib/br_nfe/product/xml/v1_00/root/NfeRecepcaoEvento.xml.slim +7 -0
  90. data/lib/br_nfe/product/xml/v2_00/_tc_endereco.xml.slim +19 -0
  91. data/lib/br_nfe/product/xml/v2_00/_tc_infNFe.xml.slim +39 -0
  92. data/lib/br_nfe/product/xml/v2_00/infInut.xml.slim +12 -0
  93. data/lib/br_nfe/product/xml/v2_00/infNFe/NFe.xml.slim +4 -0
  94. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_cobr.xml.slim +19 -0
  95. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_dest.xml.slim +14 -0
  96. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_det.xml.slim +7 -0
  97. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_emit.xml.slim +19 -0
  98. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_entrega.xml.slim +11 -0
  99. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_exporta.xml.slim +2 -0
  100. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_ide.xml.slim +24 -0
  101. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_infAdic.xml.slim +13 -0
  102. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_retirada.xml.slim +11 -0
  103. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_total.xml.slim +50 -0
  104. data/lib/br_nfe/product/xml/v2_00/infNFe/_tc_transp.xml.slim +35 -0
  105. data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_imposto.xml.slim +31 -0
  106. data/lib/br_nfe/product/xml/v2_00/infNFe/det/_tc_prod.xml.slim +37 -0
  107. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim +6 -0
  108. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim +16 -0
  109. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS101.xml.slim +4 -0
  110. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS102.xml.slim +3 -0
  111. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +6 -0
  112. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim +15 -0
  113. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim +14 -0
  114. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +12 -0
  115. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +7 -0
  116. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim +6 -0
  117. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +13 -0
  118. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim +5 -0
  119. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +18 -0
  120. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +21 -0
  121. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim +25 -0
  122. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS.xml.slim +26 -0
  123. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_COFINS_ST.xml.slim +7 -0
  124. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_ICMS.xml.slim +45 -0
  125. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_II.xml.slim +4 -0
  126. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_IPI.xml.slim +30 -0
  127. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS.xml.slim +26 -0
  128. data/lib/br_nfe/product/xml/v2_00/infNFe/det/imposto/_tc_PIS_ST.xml.slim +7 -0
  129. data/lib/br_nfe/product/xml/v2_00/infNFe/det/prod/_tc_di.xml.slim +13 -0
  130. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_retTransp.xml.slim +6 -0
  131. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_transporta.xml.slim +17 -0
  132. data/lib/br_nfe/product/xml/v2_00/infNFe/transp/_tc_vol.xml.slim +15 -0
  133. data/lib/br_nfe/product/xml/v2_00/infNFe.xml.slim +3 -0
  134. data/lib/br_nfe/product/xml/v2_00/root/NfeAutorizacao.xml.slim +5 -0
  135. data/lib/br_nfe/product/xml/v2_00/root/NfeInutilizacao.xml.slim +4 -0
  136. data/lib/br_nfe/product/xml/v2_00/root/NfeRetAutorizacao.xml.slim +3 -0
  137. data/lib/br_nfe/product/xml/v2_00/root/NfeStatusServico.xml.slim +4 -0
  138. data/lib/br_nfe/product/xml/v2_01/root/NfeConsultaProtocolo.xml.slim +4 -0
  139. data/lib/br_nfe/product/xml/v3_10/_tc_infNFe.xml.slim +44 -0
  140. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_dest.xml.slim +25 -0
  141. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_det.xml.slim +14 -0
  142. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_exporta.xml.slim +4 -0
  143. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_ide.xml.slim +26 -0
  144. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_pag.xml.slim +7 -0
  145. data/lib/br_nfe/product/xml/v3_10/infNFe/_tc_total.xml.slim +78 -0
  146. data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_imposto.xml.slim +37 -0
  147. data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_prod.xml.slim +48 -0
  148. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +12 -0
  149. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +17 -0
  150. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS40.xml.slim +7 -0
  151. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +19 -0
  152. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +23 -0
  153. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +26 -0
  154. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +8 -0
  155. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ISSQN.xml.slim +35 -0
  156. data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_det_export.xml.slim +8 -0
  157. data/lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_di.xml.slim +28 -0
  158. data/lib/br_nfe/product/xml/v3_10/root/NfeAutorizacao.xml.slim +6 -0
  159. data/lib/br_nfe/service/base.rb +1 -105
  160. data/lib/br_nfe/service/betha/v1/cancela_nfse.rb +1 -1
  161. data/lib/br_nfe/service/response/default.rb +1 -1
  162. data/lib/br_nfe/service/simpliss/v1/base.rb +2 -0
  163. data/lib/br_nfe/version.rb +2 -2
  164. data/lib/br_nfe.rb +180 -22
  165. data/lib/config/locales/br_nfe/en/product/nfe/cobranca/fatura.yml +6 -0
  166. data/lib/config/locales/br_nfe/en/product/nfe/declaracao_importacao.yml +10 -0
  167. data/lib/config/locales/br_nfe/en/product/nfe/item.yml +20 -0
  168. data/lib/config/locales/br_nfe/en/product/nfe/item_tax/icms_uf_destino.yml +8 -0
  169. data/lib/config/locales/br_nfe/en/product/nfe/transporte/base.yml +9 -0
  170. data/lib/config/locales/br_nfe/en/product/nota_fiscal.yml +21 -0
  171. data/lib/config/locales/br_nfe/en/product/operation/nfe_autorizacao.yml +10 -0
  172. data/lib/config/locales/br_nfe/en/product/operation/nfe_recepcao_evento.yml +6 -0
  173. data/lib/config/locales/br_nfe/pt-BR/product/nfe/cobranca/fatura.yml +6 -0
  174. data/lib/config/locales/br_nfe/pt-BR/product/nfe/declaracao_importacao.yml +10 -0
  175. data/lib/config/locales/br_nfe/pt-BR/product/nfe/item.yml +20 -0
  176. data/lib/config/locales/br_nfe/pt-BR/product/nfe/item_tax/icms_uf_destino.yml +8 -0
  177. data/lib/config/locales/br_nfe/pt-BR/product/nfe/transporte/base.yml +9 -0
  178. data/lib/config/locales/br_nfe/pt-BR/product/nota_fiscal.yml +21 -0
  179. data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_autorizacao.yml +10 -0
  180. data/lib/config/locales/br_nfe/pt-BR/product/operation/nfe_recepcao_evento.yml +6 -0
  181. data/test/br_nfe/association/have_destinatario_test.rb +8 -8
  182. data/test/br_nfe/association/have_emitente_test.rb +6 -6
  183. data/test/br_nfe/base_test.rb +15 -4
  184. data/test/br_nfe/endereco_test.rb +15 -0
  185. data/test/br_nfe/person_test.rb +55 -6
  186. data/test/br_nfe/product/destinatario_test.rb +26 -0
  187. data/test/br_nfe/product/emitente_test.rb +1 -2
  188. data/test/br_nfe/product/evento/base_test.rb +58 -0
  189. data/test/br_nfe/product/evento/cancelamento_test.rb +32 -0
  190. data/test/br_nfe/product/gateway/web_service_am_test.rb +242 -0
  191. data/test/br_nfe/product/gateway/web_service_ba_test.rb +242 -0
  192. data/test/br_nfe/product/gateway/web_service_ce_test.rb +242 -0
  193. data/test/br_nfe/product/gateway/web_service_go_test.rb +242 -0
  194. data/test/br_nfe/product/gateway/web_service_mg_test.rb +242 -0
  195. data/test/br_nfe/product/gateway/web_service_ms_test.rb +242 -0
  196. data/test/br_nfe/product/gateway/web_service_mt_test.rb +408 -0
  197. data/test/br_nfe/product/gateway/web_service_pe_test.rb +408 -0
  198. data/test/br_nfe/product/gateway/web_service_pr_test.rb +408 -0
  199. data/test/br_nfe/product/gateway/web_service_rs_test.rb +407 -0
  200. data/test/br_nfe/product/gateway/web_service_sp_test.rb +408 -0
  201. data/test/br_nfe/product/gateway/web_service_svan_test.rb +242 -0
  202. data/test/br_nfe/product/gateway/web_service_svc_an_test.rb +185 -0
  203. data/test/br_nfe/product/gateway/web_service_svc_rs_test.rb +185 -0
  204. data/test/br_nfe/product/gateway/web_service_svrs_test.rb +208 -2
  205. data/test/br_nfe/product/nfe/adicao_importacao_test.rb +19 -0
  206. data/test/br_nfe/product/nfe/cobranca/duplicata_test.rb +19 -0
  207. data/test/br_nfe/product/nfe/cobranca/fatura_test.rb +32 -0
  208. data/test/br_nfe/product/nfe/cobranca/pagamento_test.rb +105 -0
  209. data/test/br_nfe/product/nfe/declaracao_importacao_test.rb +116 -0
  210. data/test/br_nfe/product/nfe/detalhe_exportacao_test.rb +97 -0
  211. data/test/br_nfe/product/nfe/item_tax/cofins_st_test.rb +22 -0
  212. data/test/br_nfe/product/nfe/item_tax/cofins_test.rb +113 -0
  213. data/test/br_nfe/product/nfe/item_tax/icms_test.rb +1011 -0
  214. data/test/br_nfe/product/nfe/item_tax/icms_uf_destino_test.rb +99 -0
  215. data/test/br_nfe/product/nfe/item_tax/importacao_test.rb +23 -0
  216. data/test/br_nfe/product/nfe/item_tax/ipi_test.rb +160 -0
  217. data/test/br_nfe/product/nfe/item_tax/issqn_test.rb +84 -0
  218. data/test/br_nfe/product/nfe/item_tax/pis_st_test.rb +22 -0
  219. data/test/br_nfe/product/nfe/item_tax/pis_test.rb +113 -0
  220. data/test/br_nfe/product/nfe/item_test.rb +381 -0
  221. data/test/br_nfe/product/nfe/processo_referencia_test.rb +30 -0
  222. data/test/br_nfe/product/nfe/transporte/base_test.rb +182 -0
  223. data/test/br_nfe/product/nfe/transporte/transportador_test.rb +13 -0
  224. data/test/br_nfe/product/nfe/transporte/veiculo_test.rb +13 -0
  225. data/test/br_nfe/product/nfe/transporte/volume_test.rb +42 -0
  226. data/test/br_nfe/product/nota_fiscal_test.rb +662 -0
  227. data/test/br_nfe/product/operation/base_test.rb +538 -0
  228. data/test/br_nfe/product/operation/nfe_autorizacao_test.rb +378 -0
  229. data/test/br_nfe/product/operation/nfe_consulta_protocolo_test.rb +349 -0
  230. data/test/br_nfe/product/operation/nfe_download_nf_test.rb +93 -0
  231. data/test/br_nfe/product/operation/nfe_inutilizacao_test.rb +210 -0
  232. data/test/br_nfe/product/operation/nfe_recepcao_evento_test.rb +84 -0
  233. data/test/br_nfe/product/operation/nfe_ret_autorizacao_test.rb +309 -0
  234. data/test/br_nfe/product/operation/nfe_status_servico_test.rb +122 -0
  235. data/test/br_nfe/product/response/base_test.rb +75 -0
  236. data/test/br_nfe/product/response/build/base_test.rb +34 -0
  237. data/test/br_nfe/product/response/nfe_ret_autorizacao_test.rb +14 -0
  238. data/test/br_nfe/service/association/have_intermediario_test.rb +10 -10
  239. data/test/br_nfe/service/base_test.rb +9 -206
  240. data/test/br_nfe/service/betha/v1/cancela_nfse_test.rb +8 -6
  241. data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +6 -3
  242. data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +6 -3
  243. data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +7 -4
  244. data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +12 -9
  245. data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +6 -3
  246. data/test/br_nfe/service/rps_test.rb +2 -2
  247. data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +6 -3
  248. data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +7 -4
  249. data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +7 -4
  250. data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +8 -5
  251. data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +9 -6
  252. data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +6 -3
  253. data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +6 -3
  254. data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +6 -3
  255. data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +6 -3
  256. data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +8 -5
  257. data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +9 -6
  258. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +6 -3
  259. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +6 -3
  260. data/test/factories/person.rb +1 -1
  261. data/test/factories/product/destinatario.rb +11 -0
  262. data/test/factories/product/emitente.rb +1 -1
  263. data/test/factories/product/evento/base.rb +9 -0
  264. data/test/factories/product/evento/cancelamento.rb +10 -0
  265. data/test/factories/product/gateway/web_service_am.rb +5 -0
  266. data/test/factories/product/gateway/web_service_ba.rb +5 -0
  267. data/test/factories/product/nfe/adicao_importacao.rb +7 -0
  268. data/test/factories/product/nfe/cobranca/duplicata.rb +7 -0
  269. data/test/factories/product/nfe/cobranca/fatura.rb +8 -0
  270. data/test/factories/product/nfe/cobranca/pagamento.rb +9 -0
  271. data/test/factories/product/nfe/declaracao_importacao.rb +10 -0
  272. data/test/factories/product/nfe/detalhe_exportacao.rb +5 -0
  273. data/test/factories/product/nfe/item.rb +24 -0
  274. data/test/factories/product/nfe/item_tax/cofins.rb +5 -0
  275. data/test/factories/product/nfe/item_tax/cofins_st.rb +5 -0
  276. data/test/factories/product/nfe/item_tax/icms.rb +9 -0
  277. data/test/factories/product/nfe/item_tax/icms_uf_destino.rb +11 -0
  278. data/test/factories/product/nfe/item_tax/importacao.rb +8 -0
  279. data/test/factories/product/nfe/item_tax/ipi.rb +6 -0
  280. data/test/factories/product/nfe/item_tax/issqn.rb +9 -0
  281. data/test/factories/product/nfe/item_tax/pis.rb +5 -0
  282. data/test/factories/product/nfe/item_tax/pis_st.rb +5 -0
  283. data/test/factories/product/nfe/processo_referencia.rb +6 -0
  284. data/test/factories/product/nfe/transporte/base.rb +5 -0
  285. data/test/factories/product/nfe/transporte/transportador.rb +7 -0
  286. data/test/factories/product/nfe/transporte/veiculo.rb +7 -0
  287. data/test/factories/product/nfe/transporte/volume.rb +5 -0
  288. data/test/factories/product/nota_fiscal.rb +22 -0
  289. data/test/factories/product/{base.rb → operation/base.rb} +1 -1
  290. data/test/factories/product/operation/nfe_autorizacao.rb +590 -0
  291. data/test/factories/product/operation/nfe_consulta_protocolo.rb +13 -0
  292. data/test/factories/product/operation/nfe_download_nf.rb +15 -0
  293. data/test/factories/product/operation/nfe_inutilizacao.rb +19 -0
  294. data/test/factories/product/operation/nfe_recepcao_evento.rb +14 -0
  295. data/test/factories/product/operation/nfe_ret_autorizacao.rb +13 -0
  296. data/test/factories/product/{consulta_status_servico.rb → operation/nfe_status_servico.rb} +1 -1
  297. data/test/factories/product/response/base.rb +12 -0
  298. data/test/factories/product/response/build/base.rb +6 -0
  299. data/test/factories/product/response/nfe_ret_autorizacao.rb +13 -0
  300. data/test/factories/service/emitente.rb +1 -1
  301. data/test/fixtures/product/operation/nfe_autorizacao/nfe_signed.xml +1 -0
  302. data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_fail.xml +21 -0
  303. data/test/fixtures/product/response/v3.10/nfe_autorizacao/async_success.xml +25 -0
  304. data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/with_proc.xml +1 -0
  305. data/test/fixtures/product/response/v3.10/nfe_autorizacao/nfe/without_proc.xml +1 -0
  306. data/test/fixtures/product/response/v3.10/nfe_autorizacao/original_xml.xml +1 -0
  307. data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_fail.xml +32 -0
  308. data/test/fixtures/product/response/v3.10/nfe_autorizacao/sync_success.xml +33 -0
  309. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_1.xml +1 -0
  310. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_2.xml +1 -0
  311. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_3.xml +1 -0
  312. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/event_cancel.xml +1 -0
  313. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/event_xml/one_event.xml +1 -0
  314. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/fail.xml +22 -0
  315. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/with_proc.xml +1 -0
  316. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/nfe_original/without_proc.xml +1 -0
  317. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_with_cancel.xml +198 -0
  318. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_many_without_cancel.xml +199 -0
  319. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_one.xml +89 -0
  320. data/test/fixtures/product/response/v3.10/nfe_consulta_protocolo/success_without.xml +34 -0
  321. data/test/fixtures/product/response/v3.10/nfe_inutilizacao/fail.xml +29 -0
  322. data/test/fixtures/product/response/v3.10/nfe_inutilizacao/success.xml +30 -0
  323. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/fail.xml +34 -0
  324. data/test/fixtures/product/response/v3.10/nfe_recepcao_evento/cancelamento/success.xml +36 -0
  325. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_fail.xml +22 -0
  326. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail.xml +33 -0
  327. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_fail_and_one_ok.xml +46 -0
  328. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_one_invoice_ok.xml +34 -0
  329. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_fail.xml +46 -0
  330. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/lot_ok_two_invoice_ok.xml +46 -0
  331. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_with_protocol.xml +1 -0
  332. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_2_without_protocol.xml +1 -0
  333. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_with_protocol.xml +1 -0
  334. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/nfe/nf_3_without_protocol.xml +1 -0
  335. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/lot.xml +2 -0
  336. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfe.xml +2 -0
  337. data/test/fixtures/product/response/v3.10/nfe_ret_autorizacao/original_xml/nfeProc.xml +4 -0
  338. data/test/fixtures/product/response/v3.10/nfe_status_servico/fail.xml +23 -0
  339. data/test/fixtures/product/response/v3.10/nfe_status_servico/success.xml +22 -0
  340. data/test/fixtures/product/schemas/CCe_v1.00.xsd +11 -0
  341. data/test/fixtures/product/schemas/EPEC_v1.00.xsd +9 -0
  342. data/test/fixtures/product/schemas/LeiauteCadastroEmissorDFe_v1.01.xsd +234 -0
  343. data/test/fixtures/product/schemas/SuframaInternaliza_v1.00.xsd +9 -0
  344. data/test/fixtures/product/schemas/SuframaVistoria_v1.00.xsd +9 -0
  345. data/test/fixtures/product/schemas/atuCadEmiDFe_v1.01.xsd +9 -0
  346. data/test/fixtures/product/schemas/cabecMsg_v1.02.xsd +29 -0
  347. data/test/fixtures/product/schemas/cadEmiDFe_v1.01.xsd +9 -0
  348. data/test/fixtures/product/schemas/cancNFe_v2.00.xsd +9 -0
  349. data/test/fixtures/product/schemas/confRecebto_v1.00.xsd +9 -0
  350. data/test/fixtures/product/schemas/consCad_v2.00.xsd +9 -0
  351. data/test/fixtures/product/schemas/consDPEC_v1.01.xsd +9 -0
  352. data/test/fixtures/product/schemas/consNFeDest_v1.01.xsd +10 -0
  353. data/test/fixtures/product/schemas/consReciNFe_v2.00.xsd +9 -0
  354. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consReciNFe_v3.10.xsd +8 -8
  355. data/test/fixtures/product/schemas/consSitNFe_v2.01.xsd +10 -0
  356. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consSitNFe_v3.10.xsd +8 -8
  357. data/test/fixtures/product/schemas/consStatServ_v2.00.xsd +9 -0
  358. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/consStatServ_v3.10.xsd +8 -8
  359. data/test/fixtures/product/schemas/distDFeInt_v1.00.xsd +71 -0
  360. data/test/fixtures/product/schemas/downloadNFe_v1.00.xsd +10 -0
  361. data/test/fixtures/product/schemas/e110110_v1.00.xsd +58 -0
  362. data/test/fixtures/product/schemas/e110111_v1.00.xsd +42 -0
  363. data/test/fixtures/product/schemas/e110140_v1.00.xsd +124 -0
  364. data/test/fixtures/product/schemas/e111500_v1.00.xsd +69 -0
  365. data/test/fixtures/product/schemas/e111501_v1.00.xsd +69 -0
  366. data/test/fixtures/product/schemas/e111502_v1.00.xsd +50 -0
  367. data/test/fixtures/product/schemas/e111503_v1.00.xsd +50 -0
  368. data/test/fixtures/product/schemas/e210200_v1.00.xsd +32 -0
  369. data/test/fixtures/product/schemas/e210210_v1.00.xsd +32 -0
  370. data/test/fixtures/product/schemas/e210220_v1.00.xsd +45 -0
  371. data/test/fixtures/product/schemas/e210240_v1.00.xsd +44 -0
  372. data/test/fixtures/product/schemas/e411500_v1.00.xsd +134 -0
  373. data/test/fixtures/product/schemas/e411501_v1.00.xsd +134 -0
  374. data/test/fixtures/product/schemas/e411502_v1.00.xsd +95 -0
  375. data/test/fixtures/product/schemas/e411503_v1.00.xsd +95 -0
  376. data/test/fixtures/product/schemas/e990900_v1.00.xsd +87 -0
  377. data/test/fixtures/product/schemas/e990910_v1.00.xsd +81 -0
  378. data/test/fixtures/product/schemas/envCCe_v1.00.xsd +10 -0
  379. data/test/fixtures/product/schemas/envCancelPProrrogNFe_v1.0.xsd +50 -0
  380. data/test/fixtures/product/schemas/envConfRecebto_v1.00.xsd +9 -0
  381. data/test/fixtures/product/schemas/envDPEC_v1.01.xsd +9 -0
  382. data/test/fixtures/product/schemas/envEPEC_v1.00.xsd +9 -0
  383. data/test/fixtures/product/schemas/envEventoCancNFe_v1.00.xsd +9 -0
  384. data/test/fixtures/product/schemas/envEvento_v1.00.xsd +9 -0
  385. data/test/fixtures/product/schemas/envFiscoNfe_v1.0.xsd +179 -0
  386. data/test/fixtures/product/schemas/envPProrrogNFe_v1.0.xsd +65 -0
  387. data/test/fixtures/product/schemas/envRemIndus_v1.00.xsd +9 -0
  388. data/test/fixtures/product/schemas/envSuframaInternaliza_v1.00.xsd +10 -0
  389. data/test/fixtures/product/schemas/envSuframaVistoria_v1.00.xsd +10 -0
  390. data/test/fixtures/product/schemas/enviNFe_v2.00.xsd +9 -0
  391. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/enviNFe_v3.10.xsd +8 -8
  392. data/test/fixtures/product/schemas/eventoCancNFe_v1.00.xsd +9 -0
  393. data/test/fixtures/product/schemas/eventoEPEC_v0.01.xsd +267 -0
  394. data/test/fixtures/product/schemas/eventoEPEC_v1.00.xsd +267 -0
  395. data/test/fixtures/product/schemas/eventoRemIndus_v1.00.xsd +9 -0
  396. data/test/fixtures/product/schemas/inutNFe_v2.00.xsd +9 -0
  397. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/inutNFe_v3.10.xsd +8 -8
  398. data/test/fixtures/product/schemas/leiauteCCe_v1.00.xsd +418 -0
  399. data/test/fixtures/product/schemas/leiauteCancNFe_v2.00.xsd +143 -0
  400. data/test/fixtures/product/schemas/leiauteConfRecebto_v1.00.xsd +406 -0
  401. data/test/fixtures/product/schemas/leiauteConsNFeDest_v1.01.xsd +483 -0
  402. data/test/fixtures/product/schemas/leiauteConsSitNFe_v2.01.xsd +548 -0
  403. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteConsSitNFe_v3.10.xsd +502 -502
  404. data/test/fixtures/product/schemas/leiauteConsStatServ_v2.00.xsd +98 -0
  405. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteConsStatServ_v3.10.xsd +97 -97
  406. data/test/fixtures/product/schemas/leiauteConsultaCadastro_v1.01.xsd +355 -0
  407. data/test/fixtures/product/schemas/leiauteConsultaCadastro_v2.00.xsd +404 -0
  408. data/test/fixtures/product/schemas/leiauteDPEC_v1.01.xsd +464 -0
  409. data/test/fixtures/product/schemas/leiauteDownloadNFe_v1.00.xsd +149 -0
  410. data/test/fixtures/product/schemas/leiauteEPEC_v1.00.xsd +459 -0
  411. data/test/fixtures/product/schemas/leiauteEventoCancNFe_v1.00.xsd +394 -0
  412. data/test/fixtures/product/schemas/leiauteEvento_v1.00.xsd +373 -0
  413. data/test/fixtures/product/schemas/leiauteInutNFe_v2.00.xsd +193 -0
  414. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteInutNFe_v3.10.xsd +192 -192
  415. data/test/fixtures/product/schemas/leiauteNFe_v2.00.xsd +6661 -0
  416. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/leiauteNFe_v3.10.xsd +6060 -6060
  417. data/test/fixtures/product/schemas/leiauteRemIndus_v1.00.xsd +382 -0
  418. data/test/fixtures/product/schemas/leiauteSRE_v1.00.xsd +372 -0
  419. data/test/fixtures/product/schemas/leiauteSuframaInternaliza_v1.00.xsd +642 -0
  420. data/test/fixtures/product/schemas/leiauteSuframaVistoria_v1.00.xsd +648 -0
  421. data/test/fixtures/product/schemas/nfe_v2.00.xsd +9 -0
  422. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/nfe_v3.10.xsd +8 -8
  423. data/test/fixtures/product/schemas/procCCeNFe_v1.00.xsd +10 -0
  424. data/test/fixtures/product/schemas/procCancNFe_v2.00.xsd +9 -0
  425. data/test/fixtures/product/schemas/procConfRecebtoNFe_v1.00.xsd +9 -0
  426. data/test/fixtures/product/schemas/procEPEC_v1.00.xsd +9 -0
  427. data/test/fixtures/product/schemas/procEventoCancNFe_v1.00.xsd +9 -0
  428. data/test/fixtures/product/schemas/procEventoNFe_v1.00.xsd +9 -0
  429. data/test/fixtures/product/schemas/procEventoNFe_v99.99.xsd +37 -0
  430. data/test/fixtures/product/schemas/procInutNFe_v2.00.xsd +9 -0
  431. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/procInutNFe_v3.10.xsd +8 -8
  432. data/test/fixtures/product/schemas/procNFe_v2.00.xsd +9 -0
  433. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/procNFe_v3.10.xsd +8 -8
  434. data/test/fixtures/product/schemas/procRemIndus_v1.00.xsd +9 -0
  435. data/test/fixtures/product/schemas/resEvento_v1.00.xsd +94 -0
  436. data/test/fixtures/product/schemas/resNFe_v1.00.xsd +110 -0
  437. data/test/fixtures/product/schemas/retAtuCadEmiDFe_v1.01.xsd +9 -0
  438. data/test/fixtures/product/schemas/retCancNFe_v2.00.xsd +9 -0
  439. data/test/fixtures/product/schemas/retConsCad_v2.00.xsd +9 -0
  440. data/test/fixtures/product/schemas/retConsDPEC_v1.01.xsd +9 -0
  441. data/test/fixtures/product/schemas/retConsReciNFe_v2.00.xsd +9 -0
  442. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsReciNFe_v3.10.xsd +8 -8
  443. data/test/fixtures/product/schemas/retConsSitNFe_v2.01.xsd +10 -0
  444. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsSitNFe_v3.10.xsd +8 -8
  445. data/test/fixtures/product/schemas/retConsStatServ_v2.00.xsd +9 -0
  446. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retConsStatServ_v3.10.xsd +8 -8
  447. data/test/fixtures/product/schemas/retDPEC_v1.01.xsd +9 -0
  448. data/test/fixtures/product/schemas/retDistDFeInt_v1.00.xsd +84 -0
  449. data/test/fixtures/product/schemas/retDownloadNFe_v1.00.xsd +9 -0
  450. data/test/fixtures/product/schemas/retEnvCCe_v1.00.xsd +10 -0
  451. data/test/fixtures/product/schemas/retEnvCancelPProrrogNFe_v1.0.xsd +231 -0
  452. data/test/fixtures/product/schemas/retEnvConfRecebto_v1.00.xsd +9 -0
  453. data/test/fixtures/product/schemas/retEnvEPEC_v1.00.xsd +9 -0
  454. data/test/fixtures/product/schemas/retEnvEventoCancNFe_v1.00.xsd +9 -0
  455. data/test/fixtures/product/schemas/retEnvEvento_v1.00.xsd +9 -0
  456. data/test/fixtures/product/schemas/retEnvFiscoNFe_v1.0.xsd +234 -0
  457. data/test/fixtures/product/schemas/retEnvRemIndus_v1.00.xsd +9 -0
  458. data/test/fixtures/product/schemas/retEnvSuframaInternaliza_v1.00.xsd +9 -0
  459. data/test/fixtures/product/schemas/retEnvSuframaVistoria_v1.00.xsd +9 -0
  460. data/test/fixtures/product/schemas/retEnviNFe_v2.00.xsd +9 -0
  461. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retEnviNFe_v3.10.xsd +8 -8
  462. data/test/fixtures/product/schemas/retEventoEPEC_v0.01.xsd +207 -0
  463. data/test/fixtures/product/schemas/retInutNFe_v2.00.xsd +9 -0
  464. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/retInutNFe_v3.10.xsd +8 -8
  465. data/test/fixtures/product/schemas/retPProrrogNFe_v1.0.xsd +233 -0
  466. data/test/fixtures/product/schemas/retconsNFeDest_v1.01.xsd +9 -0
  467. data/test/fixtures/product/schemas/tiposBasico_v1.03.xsd +816 -0
  468. data/test/fixtures/product/schemas/tiposBasico_v1.03_OPENSSL.xsd +816 -0
  469. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/tiposBasico_v3.10.xsd +571 -571
  470. data/test/fixtures/product/schemas/tiposBasico_v3.10_OPENSSL.xsd +877 -0
  471. data/test/fixtures/product/schemas/tiposDistDFe_v1.00.xsd +217 -0
  472. data/{lib/br_nfe/product/xml/v3_10/XSD → test/fixtures/product/schemas}/xmldsig-core-schema_v1.01.xsd +97 -97
  473. data/test/fixtures/product/wsdl/NFeRetAutorizacao.xml +80 -0
  474. data/test/fixtures/product/wsdl/NfeAutorizacao.xml +107 -0
  475. data/test/fixtures/product/wsdl/NfeConsulta2.xml +80 -0
  476. data/test/fixtures/product/wsdl/NfeStatusServico2.xml +70 -0
  477. data/test/fixtures/product/wsdl/nfeinutilizacao2.xml +80 -0
  478. data/test/fixtures/service/wsdl/betha/v1/cancelar_nfse.xml +178 -0
  479. data/test/fixtures/service/wsdl/betha/v1/consultar_lote_rps.xml +339 -0
  480. data/test/fixtures/service/wsdl/betha/v1/consultar_nfse.xml +348 -0
  481. data/test/fixtures/service/wsdl/betha/v1/consultar_nfse_por_rps.xml +365 -0
  482. data/test/fixtures/service/wsdl/betha/v1/consultar_situacao_lote_rps.xml +74 -0
  483. data/test/fixtures/service/wsdl/betha/v1/recepcionar_lote_rps.xml +299 -0
  484. data/test/fixtures/service/wsdl/simpliss/v1/nfseservice.xml +1 -0
  485. data/test/fixtures/service/wsdl/thema/v1/nfse_cancelamento.xml +82 -0
  486. data/test/fixtures/service/wsdl/thema/v1/nfse_consulta.xml +235 -0
  487. data/test/fixtures/service/wsdl/thema/v1/nfse_remessa.xml +185 -0
  488. data/test/test_helper.rb +369 -1
  489. metadata +711 -33
  490. data/lib/br_nfe/product/base.rb +0 -82
  491. data/lib/br_nfe/product/consulta_status_servico.rb +0 -35
  492. data/lib/br_nfe/product/value_nf.rb +0 -9
  493. data/lib/br_nfe/product/xml/v3_10/consulta_status_servico.xml.slim +0 -4
  494. data/test/br_nfe/product/base_test.rb +0 -150
  495. data/test/br_nfe/product/consulta_status_servico_test.rb +0 -59
@@ -0,0 +1,642 @@
1
+ <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.portalfiscal.inf.br/nfe" targetNamespace="http://www.portalfiscal.inf.br/nfe" elementFormDefault="qualified" attributeFormDefault="unqualified">
2
+ <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v1.01.xsd"/>
3
+ <xs:include schemaLocation="tiposBasico_v1.03.xsd"/>
4
+ <xs:complexType name="TEvento">
5
+ <xs:annotation>
6
+ <xs:documentation>Tipo Evento</xs:documentation>
7
+ </xs:annotation>
8
+ <xs:sequence>
9
+ <xs:element name="infEvento">
10
+ <xs:complexType>
11
+ <xs:sequence>
12
+ <xs:element name="cOrgao" type="TCOrgaoIBGE">
13
+ <xs:annotation>
14
+ <xs:documentation>Código do órgão de recepção do Evento. Utilizar a Tabela do IBGE extendida, utilizar 90 para identificar o Ambiente Nacional</xs:documentation>
15
+ </xs:annotation>
16
+ </xs:element>
17
+ <xs:element name="tpAmb" type="TAmb">
18
+ <xs:annotation>
19
+ <xs:documentation>Identificação do Ambiente:
20
+ 1 - Produção
21
+ 2 - Homologação</xs:documentation>
22
+ </xs:annotation>
23
+ </xs:element>
24
+ <xs:choice>
25
+ <xs:annotation>
26
+ <xs:documentation>Identificação do autor do evento</xs:documentation>
27
+ </xs:annotation>
28
+ <xs:element name="CNPJ" type="TCnpjOpc">
29
+ <xs:annotation>
30
+ <xs:documentation>CNPJ</xs:documentation>
31
+ </xs:annotation>
32
+ </xs:element>
33
+ <xs:element name="CPF" type="TCpf">
34
+ <xs:annotation>
35
+ <xs:documentation>CPF</xs:documentation>
36
+ </xs:annotation>
37
+ </xs:element>
38
+ </xs:choice>
39
+ <xs:element name="chNFe" type="TChNFe">
40
+ <xs:annotation>
41
+ <xs:documentation>Chave de Acesso da NF-e vinculada ao evento</xs:documentation>
42
+ </xs:annotation>
43
+ </xs:element>
44
+ <xs:element name="dhEvento" type="TDateTimeUTC">
45
+ <xs:annotation>
46
+ <xs:documentation>Data de emissão no formato UTC. AAAA-MM-DDThh:mm:ssTZD</xs:documentation>
47
+ </xs:annotation>
48
+ </xs:element>
49
+ <xs:element name="tpEvento">
50
+ <xs:annotation>
51
+ <xs:documentation>Tipo do Evento</xs:documentation>
52
+ </xs:annotation>
53
+ <xs:simpleType>
54
+ <xs:restriction base="xs:string">
55
+ <xs:whiteSpace value="preserve"/>
56
+ <xs:pattern value="[0-9]{6}"/>
57
+ <xs:enumeration value="990910"/>
58
+ </xs:restriction>
59
+ </xs:simpleType>
60
+ </xs:element>
61
+ <xs:element name="nSeqEvento">
62
+ <xs:annotation>
63
+ <xs:documentation>Seqüencial do evento para o mesmo tipo de evento. Para maioria dos eventos será 1, nos casos em que possa existir mais de um evento, como é o caso da carta de correção, o autor do evento deve numerar de forma seqüencial.</xs:documentation>
64
+ </xs:annotation>
65
+ <xs:simpleType>
66
+ <xs:restriction base="xs:string">
67
+ <xs:whiteSpace value="preserve"/>
68
+ <xs:pattern value="[1-9]|[1][0-9]{0,1}|20"/>
69
+ </xs:restriction>
70
+ </xs:simpleType>
71
+ </xs:element>
72
+ <xs:element name="verEvento">
73
+ <xs:annotation>
74
+ <xs:documentation>Versão do Tipo do Evento</xs:documentation>
75
+ </xs:annotation>
76
+ <xs:simpleType>
77
+ <xs:restriction base="xs:string">
78
+ <xs:whiteSpace value="preserve"/>
79
+ <xs:enumeration value="1.00"/>
80
+ </xs:restriction>
81
+ </xs:simpleType>
82
+ </xs:element>
83
+ <xs:element name="detEvento">
84
+ <xs:annotation>
85
+ <xs:documentation>Schema XML de validação do evento do Confirmação de Internalização da Mercadoria na SUFRAMA 990910</xs:documentation>
86
+ </xs:annotation>
87
+ <xs:complexType>
88
+ <xs:sequence>
89
+ <xs:element name="descEvento">
90
+ <xs:annotation>
91
+ <xs:documentation>Descrição do Evento - “Confirmação de Internalização da Mercadoria na SUFRAMA”</xs:documentation>
92
+ </xs:annotation>
93
+ <xs:simpleType>
94
+ <xs:restriction base="xs:string">
95
+ <xs:whiteSpace value="preserve"/>
96
+ <xs:enumeration value="Confirmacao de Internalizacao da Mercadoria na SUFRAMA"/>
97
+ </xs:restriction>
98
+ </xs:simpleType>
99
+ </xs:element>
100
+ <xs:element name="PINe">
101
+ <xs:annotation>
102
+ <xs:documentation>Número do PIN-e - Protocolo de Internalização de Mercadoria Nacional eletronico</xs:documentation>
103
+ </xs:annotation>
104
+ <xs:simpleType>
105
+ <xs:restriction base="xs:string">
106
+ <xs:whiteSpace value="preserve"/>
107
+ <xs:pattern value="[0-9]{1,9}"/>
108
+ </xs:restriction>
109
+ </xs:simpleType>
110
+ </xs:element>
111
+ <xs:element name="dVistoria" type="TDateTimeUTC">
112
+ <xs:annotation>
113
+ <xs:documentation>Data de ocorrência da vistoria, formato UTC (AAAA-MM-DDThh:mm:ssTZD, onde TZD = +hh:mm ou -hh:mm)</xs:documentation>
114
+ </xs:annotation>
115
+ </xs:element>
116
+ <xs:element name="locVistoria">
117
+ <xs:annotation>
118
+ <xs:documentation>Localidade onde ocorreu a vistoria</xs:documentation>
119
+ </xs:annotation>
120
+ <xs:simpleType>
121
+ <xs:restriction base="TString">
122
+ <xs:minLength value="5"/>
123
+ <xs:maxLength value="60"/>
124
+ </xs:restriction>
125
+ </xs:simpleType>
126
+ </xs:element>
127
+ <xs:element name="postoVistoria">
128
+ <xs:annotation>
129
+ <xs:documentation>Nome Posto do ponto onde ocorreu a vistoria</xs:documentation>
130
+ </xs:annotation>
131
+ <xs:simpleType>
132
+ <xs:restriction base="TString">
133
+ <xs:minLength value="5"/>
134
+ <xs:maxLength value="60"/>
135
+ </xs:restriction>
136
+ </xs:simpleType>
137
+ </xs:element>
138
+ <xs:element name="xHistorico">
139
+ <xs:annotation>
140
+ <xs:documentation>Histórico da ocorrência, se existir.</xs:documentation>
141
+ </xs:annotation>
142
+ <xs:simpleType>
143
+ <xs:restriction base="TString">
144
+ <xs:minLength value="1"/>
145
+ <xs:maxLength value="1024"/>
146
+ </xs:restriction>
147
+ </xs:simpleType>
148
+ </xs:element>
149
+ </xs:sequence>
150
+ <xs:attribute name="versao" use="required">
151
+ <xs:simpleType>
152
+ <xs:restriction base="xs:string">
153
+ <xs:whiteSpace value="preserve"/>
154
+ <xs:enumeration value="1.00"/>
155
+ </xs:restriction>
156
+ </xs:simpleType>
157
+ </xs:attribute>
158
+ </xs:complexType>
159
+ </xs:element>
160
+ </xs:sequence>
161
+ <xs:attribute name="Id" use="required">
162
+ <xs:annotation>
163
+ <xs:documentation>Identificador da TAG a ser assinada, a regra de formação do Id é:
164
+ “ID” + tpEvento + chave da NF-e + nSeqEvento</xs:documentation>
165
+ </xs:annotation>
166
+ <xs:simpleType>
167
+ <xs:restriction base="xs:ID">
168
+ <xs:pattern value="ID[0-9]{52}"/>
169
+ </xs:restriction>
170
+ </xs:simpleType>
171
+ </xs:attribute>
172
+ </xs:complexType>
173
+ </xs:element>
174
+ <xs:element ref="ds:Signature"/>
175
+ </xs:sequence>
176
+ <xs:attribute name="versao" type="TVerEvento" use="required"/>
177
+ </xs:complexType>
178
+ <xs:element name="descEvento">
179
+ <xs:simpleType>
180
+ <xs:restriction base="xs:string">
181
+ <xs:whiteSpace value="preserve"/>
182
+ <xs:enumeration value="Registro Passagem NFe"/>
183
+ </xs:restriction>
184
+ </xs:simpleType>
185
+ </xs:element>
186
+ <xs:element name="cOrgaoAutor" type="TCOrgaoIBGE"/>
187
+ <xs:element name="cPostoUF">
188
+ <xs:simpleType>
189
+ <xs:restriction base="xs:string">
190
+ <xs:whiteSpace value="preserve"/>
191
+ <xs:pattern value="[0-9]{4}"/>
192
+ </xs:restriction>
193
+ </xs:simpleType>
194
+ </xs:element>
195
+ <xs:element name="xPostoUF">
196
+ <xs:simpleType>
197
+ <xs:restriction base="TString">
198
+ <xs:minLength value="2"/>
199
+ <xs:maxLength value="60"/>
200
+ </xs:restriction>
201
+ </xs:simpleType>
202
+ </xs:element>
203
+ <xs:element name="latGPS">
204
+ <xs:simpleType>
205
+ <xs:restriction base="TString">
206
+ <xs:pattern value="[0-9]\.[0-9]{6}|[1-8][0-9]\.[0-9]{6}|90\.[0-9]{6}|-[0-9]\.[0-9]{6}|-[1-8][0-9]\.[0-9]{6}|-90\.[0-9]{6}"/>
207
+ </xs:restriction>
208
+ </xs:simpleType>
209
+ </xs:element>
210
+ <xs:element name="longGPS">
211
+ <xs:simpleType>
212
+ <xs:restriction base="TString">
213
+ <xs:pattern value="[0-9]\.[0-9]{6}|[1-9][0-9]\.[0-9]{6}|1[0-7][0-9]\.[0-9]{6}|180\.[0-9]{6}|-[0-9]\.[0-9]{6}|-[1-9][0-9]\.[0-9]{6}|-1[0-7][0-9]\.[0-9]{6}|-180\.[0-9]{6}"/>
214
+ </xs:restriction>
215
+ </xs:simpleType>
216
+ </xs:element>
217
+ <xs:element name="CPFOper" type="TCpf"/>
218
+ <xs:element name="xNomeOper">
219
+ <xs:simpleType>
220
+ <xs:restriction base="TString">
221
+ <xs:minLength value="2"/>
222
+ <xs:maxLength value="60"/>
223
+ </xs:restriction>
224
+ </xs:simpleType>
225
+ </xs:element>
226
+ <xs:element name="indOffline">
227
+ <xs:simpleType>
228
+ <xs:restriction base="xs:string">
229
+ <xs:whiteSpace value="preserve"/>
230
+ <xs:enumeration value="1"/>
231
+ </xs:restriction>
232
+ </xs:simpleType>
233
+ </xs:element>
234
+ <xs:element name="dhPas" type="TDateTimeUTC"/>
235
+ <xs:element name="sentidoVia">
236
+ <xs:simpleType>
237
+ <xs:restriction base="xs:string">
238
+ <xs:whiteSpace value="preserve"/>
239
+ <xs:enumeration value="E"/>
240
+ <xs:enumeration value="S"/>
241
+ <xs:enumeration value="I"/>
242
+ </xs:restriction>
243
+ </xs:simpleType>
244
+ </xs:element>
245
+ <xs:element name="indRet">
246
+ <xs:simpleType>
247
+ <xs:restriction base="xs:string">
248
+ <xs:whiteSpace value="preserve"/>
249
+ <xs:enumeration value="R"/>
250
+ </xs:restriction>
251
+ </xs:simpleType>
252
+ </xs:element>
253
+ <xs:element name="UFDest" type="TUf"/>
254
+ <xs:element name="xObs">
255
+ <xs:simpleType>
256
+ <xs:restriction base="TString">
257
+ <xs:minLength value="1"/>
258
+ <xs:maxLength value="255"/>
259
+ </xs:restriction>
260
+ </xs:simpleType>
261
+ </xs:element>
262
+ <xs:element name="chMDFe">
263
+ <xs:simpleType>
264
+ <xs:restriction base="xs:string">
265
+ <xs:whiteSpace value="preserve"/>
266
+ <xs:pattern value="[0-9]{44}"/>
267
+ </xs:restriction>
268
+ </xs:simpleType>
269
+ </xs:element>
270
+ <xs:element name="chCTe">
271
+ <xs:simpleType>
272
+ <xs:restriction base="xs:string">
273
+ <xs:whiteSpace value="preserve"/>
274
+ <xs:pattern value="[0-9]{44}"/>
275
+ </xs:restriction>
276
+ </xs:simpleType>
277
+ </xs:element>
278
+ <xs:element name="modalRodov">
279
+ <xs:complexType>
280
+ <xs:sequence>
281
+ <xs:element ref="placaVeic" minOccurs="0"/>
282
+ <xs:element ref="UFVeic" minOccurs="0"/>
283
+ <xs:element ref="placaCarreta" minOccurs="0"/>
284
+ <xs:element ref="UFCarreta" minOccurs="0"/>
285
+ <xs:element ref="placaCarreta2" minOccurs="0"/>
286
+ <xs:element ref="UFCarreta2" minOccurs="0"/>
287
+ </xs:sequence>
288
+ </xs:complexType>
289
+ </xs:element>
290
+ <xs:element name="placaVeic" type="TPlaca"/>
291
+ <xs:element name="UFVeic" type="TUf"/>
292
+ <xs:element name="placaCarreta" type="TPlaca"/>
293
+ <xs:element name="UFCarreta" type="TUf"/>
294
+ <xs:element name="placaCarreta2" type="TPlaca"/>
295
+ <xs:element name="UFCarreta2" type="TUf"/>
296
+ <xs:element name="modalOutro">
297
+ <xs:complexType>
298
+ <xs:sequence>
299
+ <xs:element ref="tpModal"/>
300
+ <xs:element ref="xIdent" minOccurs="0"/>
301
+ </xs:sequence>
302
+ </xs:complexType>
303
+ </xs:element>
304
+ <xs:element name="tpModal">
305
+ <xs:simpleType>
306
+ <xs:restriction base="xs:string">
307
+ <xs:whiteSpace value="preserve"/>
308
+ <xs:enumeration value="F"/>
309
+ <xs:enumeration value="D"/>
310
+ <xs:enumeration value="AE"/>
311
+ <xs:enumeration value="AQ"/>
312
+ <xs:enumeration value="O"/>
313
+ </xs:restriction>
314
+ </xs:simpleType>
315
+ </xs:element>
316
+ <xs:element name="xIdent">
317
+ <xs:simpleType>
318
+ <xs:restriction base="TString">
319
+ <xs:minLength value="1"/>
320
+ <xs:maxLength value="255"/>
321
+ </xs:restriction>
322
+ </xs:simpleType>
323
+ </xs:element>
324
+ <xs:element name="ctg">
325
+ <xs:complexType>
326
+ <xs:sequence>
327
+ <xs:element ref="nFormSeg" minOccurs="0"/>
328
+ <xs:element ref="UFDest"/>
329
+ <xs:element ref="tpEmis"/>
330
+ <xs:choice>
331
+ <xs:element ref="CNPJDest"/>
332
+ <xs:element ref="CPFDest"/>
333
+ </xs:choice>
334
+ <xs:element ref="vTotalNFe"/>
335
+ <xs:element ref="indICMS"/>
336
+ <xs:element ref="indICMSST"/>
337
+ <xs:element ref="diaEmi"/>
338
+ </xs:sequence>
339
+ </xs:complexType>
340
+ </xs:element>
341
+ <xs:element name="nFormSeg">
342
+ <xs:simpleType>
343
+ <xs:restriction base="TString">
344
+ <xs:minLength value="1"/>
345
+ <xs:maxLength value="11"/>
346
+ </xs:restriction>
347
+ </xs:simpleType>
348
+ </xs:element>
349
+ <xs:element name="tpEmis">
350
+ <xs:simpleType>
351
+ <xs:restriction base="xs:string">
352
+ <xs:whiteSpace value="preserve"/>
353
+ <xs:enumeration value="2"/>
354
+ <xs:enumeration value="5"/>
355
+ </xs:restriction>
356
+ </xs:simpleType>
357
+ </xs:element>
358
+ <xs:element name="CNPJDest" type="TCnpj"/>
359
+ <xs:element name="CPFDest" type="TCpf"/>
360
+ <xs:element name="vTotalNFe" type="TDec_1302"/>
361
+ <xs:element name="indICMS">
362
+ <xs:simpleType>
363
+ <xs:restriction base="xs:string">
364
+ <xs:whiteSpace value="preserve"/>
365
+ <xs:enumeration value="1"/>
366
+ <xs:enumeration value="2"/>
367
+ </xs:restriction>
368
+ </xs:simpleType>
369
+ </xs:element>
370
+ <xs:element name="indICMSST">
371
+ <xs:simpleType>
372
+ <xs:restriction base="xs:string">
373
+ <xs:whiteSpace value="preserve"/>
374
+ <xs:enumeration value="1"/>
375
+ <xs:enumeration value="2"/>
376
+ </xs:restriction>
377
+ </xs:simpleType>
378
+ </xs:element>
379
+ <xs:element name="diaEmi">
380
+ <xs:simpleType>
381
+ <xs:restriction base="xs:string">
382
+ <xs:whiteSpace value="preserve"/>
383
+ <xs:pattern value="[1-9]|[1][0-9]|[2][0-9]|[3][0-1]?"/>
384
+ </xs:restriction>
385
+ </xs:simpleType>
386
+ </xs:element>
387
+ <xs:simpleType name="TVerEvento">
388
+ <xs:annotation>
389
+ <xs:documentation>Tipo Versão do Evento</xs:documentation>
390
+ </xs:annotation>
391
+ <xs:restriction base="xs:string">
392
+ <xs:whiteSpace value="preserve"/>
393
+ <xs:pattern value="1\.00"/>
394
+ </xs:restriction>
395
+ </xs:simpleType>
396
+ <xs:complexType name="TretEvento">
397
+ <xs:annotation>
398
+ <xs:documentation>Tipo retorno do Evento</xs:documentation>
399
+ </xs:annotation>
400
+ <xs:sequence>
401
+ <xs:element name="infEvento">
402
+ <xs:complexType>
403
+ <xs:sequence>
404
+ <xs:element name="tpAmb" type="TAmb">
405
+ <xs:annotation>
406
+ <xs:documentation>Identificação do Ambiente:
407
+ 1 - Produção
408
+ 2 - Homologação</xs:documentation>
409
+ </xs:annotation>
410
+ </xs:element>
411
+ <xs:element name="verAplic" type="TVerAplic">
412
+ <xs:annotation>
413
+ <xs:documentation>Versão do Aplicativo que recebeu o Evento</xs:documentation>
414
+ </xs:annotation>
415
+ </xs:element>
416
+ <xs:element name="cOrgao" type="TCOrgaoIBGE">
417
+ <xs:annotation>
418
+ <xs:documentation>Código do órgão de recepção do Evento. Utilizar a Tabela do IBGE extendida, utilizar 90 para identificar o Ambiente Nacional</xs:documentation>
419
+ </xs:annotation>
420
+ </xs:element>
421
+ <xs:element name="cStat" type="TStat">
422
+ <xs:annotation>
423
+ <xs:documentation>Código do status da registro do Evento</xs:documentation>
424
+ </xs:annotation>
425
+ </xs:element>
426
+ <xs:element name="xMotivo" type="TMotivo">
427
+ <xs:annotation>
428
+ <xs:documentation>Descrição literal do status do registro do Evento</xs:documentation>
429
+ </xs:annotation>
430
+ </xs:element>
431
+ <xs:element name="chNFe" type="TChNFe" minOccurs="0">
432
+ <xs:annotation>
433
+ <xs:documentation>Chave de Acesso NF-e vinculada</xs:documentation>
434
+ </xs:annotation>
435
+ </xs:element>
436
+ <xs:element name="tpEvento" minOccurs="0">
437
+ <xs:annotation>
438
+ <xs:documentation>Tipo do Evento vinculado</xs:documentation>
439
+ </xs:annotation>
440
+ <xs:simpleType>
441
+ <xs:restriction base="xs:string">
442
+ <xs:whiteSpace value="preserve"/>
443
+ <xs:pattern value="[0-9]{6}"/>
444
+ </xs:restriction>
445
+ </xs:simpleType>
446
+ </xs:element>
447
+ <xs:element name="xEvento" minOccurs="0">
448
+ <xs:annotation>
449
+ <xs:documentation>Descrição do Evento</xs:documentation>
450
+ </xs:annotation>
451
+ <xs:simpleType>
452
+ <xs:restriction base="TString">
453
+ <xs:minLength value="5"/>
454
+ <xs:maxLength value="60"/>
455
+ </xs:restriction>
456
+ </xs:simpleType>
457
+ </xs:element>
458
+ <xs:element name="nSeqEvento" minOccurs="0">
459
+ <xs:annotation>
460
+ <xs:documentation>Seqüencial do evento</xs:documentation>
461
+ </xs:annotation>
462
+ <xs:simpleType>
463
+ <xs:restriction base="xs:string">
464
+ <xs:whiteSpace value="preserve"/>
465
+ <xs:pattern value="[1-9][0-9]{0,1}"/>
466
+ </xs:restriction>
467
+ </xs:simpleType>
468
+ </xs:element>
469
+ <xs:choice minOccurs="0">
470
+ <xs:annotation>
471
+ <xs:documentation>Identificação do destinatário da NF-e</xs:documentation>
472
+ </xs:annotation>
473
+ <xs:element name="CNPJDest" type="TCnpjOpc">
474
+ <xs:annotation>
475
+ <xs:documentation>CNPJ Destinatário</xs:documentation>
476
+ </xs:annotation>
477
+ </xs:element>
478
+ <xs:element name="CPFDest" type="TCpf">
479
+ <xs:annotation>
480
+ <xs:documentation>CPF Destiantário</xs:documentation>
481
+ </xs:annotation>
482
+ </xs:element>
483
+ </xs:choice>
484
+ <xs:element name="emailDest" minOccurs="0">
485
+ <xs:annotation>
486
+ <xs:documentation>email do destinatário</xs:documentation>
487
+ </xs:annotation>
488
+ <xs:simpleType>
489
+ <xs:restriction base="TString">
490
+ <xs:minLength value="1"/>
491
+ <xs:maxLength value="60"/>
492
+ </xs:restriction>
493
+ </xs:simpleType>
494
+ </xs:element>
495
+ <xs:element name="dhRegEvento">
496
+ <xs:annotation>
497
+ <xs:documentation>Data e Hora de do recebimento do evento ou do registro do evento formato UTC AAAA-MM-DDThh:mm:ssTZD.</xs:documentation>
498
+ </xs:annotation>
499
+ <xs:simpleType>
500
+ <xs:restriction base="xs:string">
501
+ <xs:whiteSpace value="preserve"/>
502
+ <xs:pattern value="(((20(([02468][048])|([13579][26]))-02-29))|(20[0-9][0-9])-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))T(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d-0[1-4]:00"/>
503
+ </xs:restriction>
504
+ </xs:simpleType>
505
+ </xs:element>
506
+ <xs:element name="nProt" type="TProt" minOccurs="0">
507
+ <xs:annotation>
508
+ <xs:documentation>Número do protocolo de registro do evento</xs:documentation>
509
+ </xs:annotation>
510
+ </xs:element>
511
+ </xs:sequence>
512
+ <xs:attribute name="Id" use="optional">
513
+ <xs:simpleType>
514
+ <xs:restriction base="xs:ID">
515
+ <xs:pattern value="ID[0-9]{15}"/>
516
+ </xs:restriction>
517
+ </xs:simpleType>
518
+ </xs:attribute>
519
+ </xs:complexType>
520
+ </xs:element>
521
+ <xs:element ref="ds:Signature" minOccurs="0"/>
522
+ </xs:sequence>
523
+ <xs:attribute name="versao" type="TVerEvento" use="required"/>
524
+ </xs:complexType>
525
+ <xs:complexType name="TEnvEvento">
526
+ <xs:annotation>
527
+ <xs:documentation> Tipo Lote de Envio</xs:documentation>
528
+ </xs:annotation>
529
+ <xs:sequence>
530
+ <xs:element name="idLote">
531
+ <xs:simpleType>
532
+ <xs:restriction base="xs:string">
533
+ <xs:whiteSpace value="preserve"/>
534
+ <xs:pattern value="[0-9]{1,15}"/>
535
+ </xs:restriction>
536
+ </xs:simpleType>
537
+ </xs:element>
538
+ <xs:element name="evento" type="TEvento" maxOccurs="20"/>
539
+ </xs:sequence>
540
+ <xs:attribute name="versao" type="TVerEnvEvento" use="required"/>
541
+ </xs:complexType>
542
+ <xs:simpleType name="TVerEnvEvento">
543
+ <xs:annotation>
544
+ <xs:documentation>Tipo Versão do EnvEvento</xs:documentation>
545
+ </xs:annotation>
546
+ <xs:restriction base="xs:string">
547
+ <xs:whiteSpace value="preserve"/>
548
+ <xs:pattern value="1\.00"/>
549
+ </xs:restriction>
550
+ </xs:simpleType>
551
+ <xs:complexType name="TRetEnvEvento">
552
+ <xs:annotation>
553
+ <xs:documentation> Tipo Retorno de Lote de Envio</xs:documentation>
554
+ </xs:annotation>
555
+ <xs:sequence>
556
+ <xs:element name="idLote">
557
+ <xs:simpleType>
558
+ <xs:restriction base="xs:string">
559
+ <xs:whiteSpace value="preserve"/>
560
+ <xs:pattern value="[0-9]{1,15}"/>
561
+ </xs:restriction>
562
+ </xs:simpleType>
563
+ </xs:element>
564
+ <xs:element name="tpAmb" type="TAmb">
565
+ <xs:annotation>
566
+ <xs:documentation>Identificação do Ambiente:
567
+ 1 - Produção
568
+ 2 - Homologação</xs:documentation>
569
+ </xs:annotation>
570
+ </xs:element>
571
+ <xs:element name="verAplic" type="TVerAplic">
572
+ <xs:annotation>
573
+ <xs:documentation>Versão do Aplicativo que recebeu o Evento</xs:documentation>
574
+ </xs:annotation>
575
+ </xs:element>
576
+ <xs:element name="cOrgao" type="TCOrgaoIBGE">
577
+ <xs:annotation>
578
+ <xs:documentation>Código do òrgao que registrou o Evento</xs:documentation>
579
+ </xs:annotation>
580
+ </xs:element>
581
+ <xs:element name="cStat" type="TStat">
582
+ <xs:annotation>
583
+ <xs:documentation>Código do status da registro do Evento</xs:documentation>
584
+ </xs:annotation>
585
+ </xs:element>
586
+ <xs:element name="xMotivo" type="TMotivo">
587
+ <xs:annotation>
588
+ <xs:documentation>Descrição literal do status do registro do Evento</xs:documentation>
589
+ </xs:annotation>
590
+ </xs:element>
591
+ <xs:element name="retEvento" type="TretEvento" minOccurs="0" maxOccurs="20"/>
592
+ </xs:sequence>
593
+ <xs:attribute name="versao" type="TVerEnvEvento" use="required"/>
594
+ </xs:complexType>
595
+ <xs:complexType name="TProcEvento">
596
+ <xs:annotation>
597
+ <xs:documentation>Tipo procEvento</xs:documentation>
598
+ </xs:annotation>
599
+ <xs:sequence>
600
+ <xs:element name="evento" type="TEvento"/>
601
+ <xs:element name="retEvento" type="TretEvento"/>
602
+ </xs:sequence>
603
+ <xs:attribute name="versao" type="TVerEvento" use="required"/>
604
+ </xs:complexType>
605
+ <xs:simpleType name="TCOrgaoIBGE">
606
+ <xs:annotation>
607
+ <xs:documentation>Tipo Código de orgão (UF da tabela do IBGE + 90 RFB)</xs:documentation>
608
+ </xs:annotation>
609
+ <xs:restriction base="xs:string">
610
+ <xs:whiteSpace value="preserve"/>
611
+ <xs:enumeration value="11"/>
612
+ <xs:enumeration value="12"/>
613
+ <xs:enumeration value="13"/>
614
+ <xs:enumeration value="14"/>
615
+ <xs:enumeration value="15"/>
616
+ <xs:enumeration value="16"/>
617
+ <xs:enumeration value="17"/>
618
+ <xs:enumeration value="21"/>
619
+ <xs:enumeration value="22"/>
620
+ <xs:enumeration value="23"/>
621
+ <xs:enumeration value="24"/>
622
+ <xs:enumeration value="25"/>
623
+ <xs:enumeration value="26"/>
624
+ <xs:enumeration value="27"/>
625
+ <xs:enumeration value="28"/>
626
+ <xs:enumeration value="29"/>
627
+ <xs:enumeration value="31"/>
628
+ <xs:enumeration value="32"/>
629
+ <xs:enumeration value="33"/>
630
+ <xs:enumeration value="35"/>
631
+ <xs:enumeration value="41"/>
632
+ <xs:enumeration value="42"/>
633
+ <xs:enumeration value="43"/>
634
+ <xs:enumeration value="50"/>
635
+ <xs:enumeration value="51"/>
636
+ <xs:enumeration value="52"/>
637
+ <xs:enumeration value="53"/>
638
+ <xs:enumeration value="90"/>
639
+ <xs:enumeration value="91"/>
640
+ </xs:restriction>
641
+ </xs:simpleType>
642
+ </xs:schema>