br_nfe 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.travis.yml +8 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +27 -3
  6. data/LICENSE +1 -1
  7. data/README.markdown +10 -12
  8. data/Rakefile +13 -0
  9. data/br_nfe.gemspec +18 -21
  10. data/lib/br_nfe/active_model_base.rb +7 -1
  11. data/lib/br_nfe/base.rb +175 -37
  12. data/lib/br_nfe/endereco.rb +7 -1
  13. data/lib/br_nfe/helper/have_rps.rb +1 -1
  14. data/lib/br_nfe/helper/values_ts/service_v1.rb +313 -0
  15. data/lib/br_nfe/response/service/build_response.rb +286 -0
  16. data/lib/br_nfe/response/service/default.rb +185 -0
  17. data/lib/br_nfe/{servico/response → response/service}/nota_fiscal.rb +11 -10
  18. data/lib/br_nfe/response/service/paths/base.rb +93 -0
  19. data/lib/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta.rb +22 -0
  20. data/lib/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta.rb +25 -0
  21. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta.rb +25 -0
  22. data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta.rb +25 -0
  23. data/lib/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta.rb +31 -0
  24. data/lib/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta.rb +36 -0
  25. data/lib/br_nfe/response/service/paths/v1/tc_nfse.rb +127 -0
  26. data/lib/br_nfe/service/base.rb +59 -0
  27. data/lib/br_nfe/service/betha/base.rb +8 -0
  28. data/lib/br_nfe/service/betha/v1/cancelamento_nfs.rb +39 -0
  29. data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +34 -0
  30. data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +32 -0
  31. data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +32 -0
  32. data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +30 -0
  33. data/lib/br_nfe/service/betha/v1/gateway.rb +21 -0
  34. data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +37 -0
  35. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta.rb +19 -0
  36. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta.rb +17 -0
  37. data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +17 -0
  38. data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +20 -0
  39. data/lib/br_nfe/service/concerns/rules/consulta_nfs_por_rps.rb +18 -0
  40. data/lib/br_nfe/service/concerns/rules/consulta_nfse.rb +29 -0
  41. data/lib/br_nfe/service/concerns/rules/recepcao_lote_rps.rb +50 -0
  42. data/lib/br_nfe/{servico → service}/intermediario.rb +1 -1
  43. data/lib/br_nfe/service/item.rb +70 -0
  44. data/lib/br_nfe/service/rps.rb +231 -0
  45. data/lib/br_nfe/service/sc/florianopolis/base.rb +25 -0
  46. data/lib/br_nfe/service/sc/florianopolis/cancellation.rb +30 -0
  47. data/lib/br_nfe/service/sc/florianopolis/emission_rps.rb +19 -0
  48. data/lib/br_nfe/service/sc/florianopolis/xml/_address.xml.slim +21 -0
  49. data/lib/br_nfe/service/sc/florianopolis/xml/_contact.xml.slim +3 -0
  50. data/lib/br_nfe/service/sc/florianopolis/xml/_service_item.xml.slim +9 -0
  51. data/lib/br_nfe/service/sc/florianopolis/xml/cancellation.xml.slim +6 -0
  52. data/lib/br_nfe/service/sc/florianopolis/xml/inf_requisicao.xml.slim +55 -0
  53. data/lib/br_nfe/service/sc/gaspar/cancela_nfse.rb +13 -0
  54. data/lib/br_nfe/service/sc/gaspar/consulta_lote_rps.rb +13 -0
  55. data/lib/br_nfe/service/sc/gaspar/consulta_nfs_por_rps.rb +13 -0
  56. data/lib/br_nfe/service/sc/gaspar/consulta_nfse.rb +17 -0
  57. data/lib/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps.rb +13 -0
  58. data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps.rb +13 -0
  59. data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado.rb +13 -0
  60. data/lib/br_nfe/service/thema/v1/base.rb +55 -0
  61. data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +48 -0
  62. data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +49 -0
  63. data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +48 -0
  64. data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +47 -0
  65. data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +46 -0
  66. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +51 -0
  67. data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +30 -0
  68. data/lib/br_nfe/service/xml/v1/_tc_contato.xml.slim +7 -0
  69. data/lib/br_nfe/service/xml/v1/_tc_cpf_cnpj.xml.slim +5 -0
  70. data/lib/br_nfe/service/xml/v1/_tc_dados_construcao_civil.xml.slim +2 -0
  71. data/lib/br_nfe/service/xml/v1/_tc_dados_prestador.xml.slim +15 -0
  72. data/lib/br_nfe/service/xml/v1/_tc_dados_servico.xml.slim +14 -0
  73. data/lib/br_nfe/service/xml/v1/_tc_dados_tomador.xml.slim +15 -0
  74. data/lib/br_nfe/service/xml/v1/_tc_endereco.xml.slim +13 -0
  75. data/lib/br_nfe/service/xml/v1/_tc_identificacao_intermediario_servico.xml.slim +7 -0
  76. data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +7 -0
  77. data/lib/br_nfe/service/xml/v1/_tc_identificacao_orgao_gerador.xml.slim +8 -0
  78. data/lib/br_nfe/service/xml/v1/_tc_identificacao_prestador.xml.slim +3 -0
  79. data/lib/br_nfe/service/xml/v1/_tc_identificacao_rps.xml.slim +16 -0
  80. data/lib/br_nfe/service/xml/v1/_tc_identificacao_tomador.xml.slim +4 -0
  81. data/lib/br_nfe/service/xml/v1/_tc_inf_pedido_cancelamento.xml.slim +4 -0
  82. data/lib/br_nfe/service/xml/v1/_tc_inf_rps.xml.slim +47 -0
  83. data/lib/br_nfe/service/xml/v1/_tc_lote_rps.xml.slim +9 -0
  84. data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +4 -0
  85. data/lib/br_nfe/service/xml/v1/_tc_rps.xml.slim +8 -0
  86. data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +48 -0
  87. data/lib/br_nfe/service/xml/v1/servico_cancelar_nfse_envio.xml.slim +9 -0
  88. data/lib/br_nfe/service/xml/v1/servico_consultar_lote_rps_envio.xml.slim +4 -0
  89. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_envio.xml.slim +19 -0
  90. data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_rps_envio.xml.slim +5 -0
  91. data/lib/br_nfe/service/xml/v1/servico_consultar_situacao_lote_rps_envio.xml.slim +4 -0
  92. data/lib/br_nfe/service/xml/v1/servico_enviar_lote_rps_envio.xml.slim +9 -0
  93. data/lib/br_nfe/version.rb +2 -2
  94. data/lib/br_nfe/xml/_signed_info_sh1.xml.slim +9 -0
  95. data/lib/br_nfe/xml/signature_sh1.xml.slim +12 -0
  96. data/lib/br_nfe/xml/soap_env.xml.slim +3 -0
  97. data/lib/br_nfe.rb +72 -20
  98. data/test/br_nfe/base_test.rb +257 -108
  99. data/test/br_nfe/helper/have_intermediario_test.rb +2 -2
  100. data/test/br_nfe/helper/have_rps_test.rb +4 -4
  101. data/test/br_nfe/response/service/build_response_test.rb +377 -0
  102. data/test/br_nfe/response/service/default_test.rb +218 -0
  103. data/test/br_nfe/{servico/response → response/service}/nota_fiscal_test.rb +2 -2
  104. data/test/br_nfe/response/service/paths/base_test.rb +199 -0
  105. data/test/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta_test.rb +25 -0
  106. data/test/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta_test.rb +30 -0
  107. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta_test.rb +30 -0
  108. data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta_test.rb +30 -0
  109. data/test/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta_test.rb +30 -0
  110. data/test/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta_test.rb +34 -0
  111. data/test/br_nfe/response/service/paths/v1/tc_nfse_test.rb +122 -0
  112. data/test/br_nfe/service/base_test.rb +138 -0
  113. data/test/br_nfe/service/betha/base_test.rb +9 -0
  114. data/test/br_nfe/service/betha/v1/cancelamento_nfs_test.rb +60 -0
  115. data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +55 -0
  116. data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +55 -0
  117. data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +53 -0
  118. data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +49 -0
  119. data/test/br_nfe/service/betha/v1/gateway_test.rb +35 -0
  120. data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +84 -0
  121. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta_test.rb +16 -0
  122. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta_test.rb +16 -0
  123. data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta_test.rb +16 -0
  124. data/test/br_nfe/service/betha/v1/xsd/TiposNFe_v01.xsd +583 -0
  125. data/test/br_nfe/service/betha/v1/xsd/nfse_v01.xsd +652 -0
  126. data/test/br_nfe/service/betha/v1/xsd/servico_cancelar_nfse_envio_v01.xsd +17 -0
  127. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_lote_rps_envio_v01.xsd +16 -0
  128. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_envio_v01.xsd +28 -0
  129. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_nfse_rps_envio_v01.xsd +16 -0
  130. data/test/br_nfe/service/betha/v1/xsd/servico_consultar_situacao_lote_rps_envio_v01.xsd +16 -0
  131. data/test/br_nfe/service/betha/v1/xsd/servico_enviar_lote_rps_envio_v01.xsd +17 -0
  132. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema.xsd +308 -0
  133. data/test/br_nfe/service/betha/v1/xsd/xmldsig-core-schema_v01.xsd +95 -0
  134. data/test/br_nfe/service/concerns/rules/cancelamento_nfs_test.rb +15 -0
  135. data/test/br_nfe/service/concerns/rules/consulta_nfs_por_rps_test.rb +36 -0
  136. data/test/br_nfe/service/concerns/rules/consulta_nfse_test.rb +42 -0
  137. data/test/br_nfe/{servico/base_test.rb → service/concerns/rules/recepcao_lote_rps_test.rb} +12 -4
  138. data/test/br_nfe/{servico → service}/intermediario_test.rb +1 -1
  139. data/test/br_nfe/service/item_test.rb +34 -0
  140. data/test/br_nfe/{servico → service}/rps_test.rb +191 -43
  141. data/test/br_nfe/service/sc/florianopolis/XSD/TiposNFSe_v2.0.xsd +863 -0
  142. data/test/br_nfe/service/sc/florianopolis/XSD/xmldsig-core-schema.xsd +309 -0
  143. data/test/br_nfe/service/sc/florianopolis/base_test.rb +20 -0
  144. data/test/br_nfe/service/sc/florianopolis/cancellation_test.rb +36 -0
  145. data/test/br_nfe/service/sc/florianopolis/emission_rps_test.rb +145 -0
  146. data/test/br_nfe/service/sc/gaspar/cancela_nfse_test.rb +21 -0
  147. data/test/br_nfe/service/sc/gaspar/consulta_nfs_por_rps_test.rb +21 -0
  148. data/test/br_nfe/service/sc/gaspar/consulta_nfse_test.rb +21 -0
  149. data/test/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps_test.rb +21 -0
  150. data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado_test.rb +22 -0
  151. data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_test.rb +22 -0
  152. data/test/br_nfe/service/thema/v1/base_test.rb +65 -0
  153. data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +56 -0
  154. data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +47 -0
  155. data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +50 -0
  156. data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +50 -0
  157. data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +47 -0
  158. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +62 -0
  159. data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test_limitado.rb +50 -0
  160. data/test/br_nfe/service/thema/v1/xsd/nfse.xsd +656 -0
  161. data/test/br_nfe/service/thema/v1/xsd/xmldsig-core-schema20020212.xsd +318 -0
  162. data/test/br_nfe/service/xsd/v1/nfse.xsd +779 -0
  163. data/test/br_nfe/service/xsd/v1/xmldsig-core-schema20020212.xsd +316 -0
  164. data/test/cert.pfx +0 -0
  165. data/test/factories/base.rb +2 -0
  166. data/test/factories/destinatario.rb +3 -3
  167. data/test/factories/response/service/build_response.rb +5 -0
  168. data/test/factories/response/service/default.rb +10 -0
  169. data/test/factories/{servico/response → response/service}/nota_fiscal.rb +9 -9
  170. data/test/factories/service/base.rb +6 -0
  171. data/test/factories/service/betha/base.rb +4 -0
  172. data/test/factories/service/betha/v1/cancelamento_nfs.rb +9 -0
  173. data/test/factories/{servico → service}/betha/v1/consulta_lote_rps.rb +2 -2
  174. data/test/factories/{servico → service}/betha/v1/consulta_nfs_por_rps.rb +1 -1
  175. data/test/factories/service/betha/v1/consulta_nfse.rb +8 -0
  176. data/test/factories/{servico → service}/betha/v1/consulta_situacao_lote_rps.rb +2 -2
  177. data/test/factories/{servico → service}/betha/v1/gateway.rb +1 -1
  178. data/test/factories/service/betha/v1/recepcao_lote_rps.rb +8 -0
  179. data/test/factories/{servico → service}/intermediario.rb +2 -2
  180. data/test/factories/service/item.rb +12 -0
  181. data/test/factories/service/rps.rb +50 -0
  182. data/test/factories/service/sc/florianopolis/base.rb +5 -0
  183. data/test/factories/service/sc/florianopolis/cancellation.rb +7 -0
  184. data/test/factories/service/sc/florianopolis/emission_rps.rb +7 -0
  185. data/test/factories/service/sc/gaspar/cancela_nfse.rb +9 -0
  186. data/test/factories/service/sc/gaspar/consulta_lote_rps.rb +7 -0
  187. data/test/factories/service/sc/gaspar/consulta_nfs_por_rps.rb +6 -0
  188. data/test/factories/service/sc/gaspar/consulta_nfse.rb +8 -0
  189. data/test/factories/service/sc/gaspar/consulta_situacao_lote_rps.rb +6 -0
  190. data/test/factories/service/sc/gaspar/recepcao_lote_rps.rb +9 -0
  191. data/test/factories/service/sc/gaspar/recepcao_lote_rps_limitado.rb +9 -0
  192. data/test/factories/service/thema/v1/base.rb +7 -0
  193. data/test/factories/service/thema/v1/cancela_nfse.rb +9 -0
  194. data/test/factories/service/thema/v1/consulta_lote_rps.rb +7 -0
  195. data/test/factories/service/thema/v1/consulta_nfs_por_rps.rb +6 -0
  196. data/test/factories/service/thema/v1/consulta_nfse.rb +8 -0
  197. data/test/factories/service/thema/v1/consulta_situacao_lote_rps.rb +6 -0
  198. data/test/factories/service/thema/v1/recepcao_lote_rps.rb +9 -0
  199. data/test/factories/service/thema/v1/recepcao_lote_rps_limitado.rb +8 -0
  200. data/test/test_helper.rb +42 -0
  201. metadata +338 -121
  202. data/lib/br_nfe/servico/base.rb +0 -35
  203. data/lib/br_nfe/servico/betha/base.rb +0 -85
  204. data/lib/br_nfe/servico/betha/build_response.rb +0 -141
  205. data/lib/br_nfe/servico/betha/v1/build_response.rb +0 -121
  206. data/lib/br_nfe/servico/betha/v1/cancelamento_nfs.rb +0 -52
  207. data/lib/br_nfe/servico/betha/v1/consulta_lote_rps.rb +0 -33
  208. data/lib/br_nfe/servico/betha/v1/consulta_nfs_por_rps.rb +0 -37
  209. data/lib/br_nfe/servico/betha/v1/consulta_nfse.rb +0 -51
  210. data/lib/br_nfe/servico/betha/v1/consulta_situacao_lote_rps.rb +0 -18
  211. data/lib/br_nfe/servico/betha/v1/gateway.rb +0 -125
  212. data/lib/br_nfe/servico/betha/v1/recepcao_lote_rps.rb +0 -97
  213. data/lib/br_nfe/servico/betha/v2/build_response.rb +0 -159
  214. data/lib/br_nfe/servico/betha/v2/cancelamento_nfs.rb +0 -30
  215. data/lib/br_nfe/servico/betha/v2/consulta_lote_rps.rb +0 -30
  216. data/lib/br_nfe/servico/betha/v2/consulta_nfse_por_rps.rb +0 -27
  217. data/lib/br_nfe/servico/betha/v2/envio_lote_rps_sincrono.rb +0 -30
  218. data/lib/br_nfe/servico/betha/v2/gateway.rb +0 -230
  219. data/lib/br_nfe/servico/betha/v2/gera_nfse.rb +0 -30
  220. data/lib/br_nfe/servico/betha/v2/recepcao_lote_rps.rb +0 -52
  221. data/lib/br_nfe/servico/betha/v2/substituicao_nfse.rb +0 -43
  222. data/lib/br_nfe/servico/response/default.rb +0 -34
  223. data/lib/br_nfe/servico/rps.rb +0 -108
  224. data/test/br_nfe/servico/betha/base_test.rb +0 -135
  225. data/test/br_nfe/servico/betha/v1/build_response_test.rb +0 -557
  226. data/test/br_nfe/servico/betha/v1/cancelamento_nfs_test.rb +0 -72
  227. data/test/br_nfe/servico/betha/v1/consulta_lote_rps_test.rb +0 -46
  228. data/test/br_nfe/servico/betha/v1/consulta_nfs_por_rps_test.rb +0 -68
  229. data/test/br_nfe/servico/betha/v1/consulta_nfse_test.rb +0 -74
  230. data/test/br_nfe/servico/betha/v1/consulta_situacao_lote_rps_test.rb +0 -27
  231. data/test/br_nfe/servico/betha/v1/gateway_test.rb +0 -151
  232. data/test/br_nfe/servico/betha/v1/recepcao_lote_rps_test.rb +0 -249
  233. data/test/br_nfe/servico/betha/v2/cancelamento_nfs_test.rb +0 -44
  234. data/test/br_nfe/servico/betha/v2/consulta_lote_rps_test.rb +0 -38
  235. data/test/br_nfe/servico/betha/v2/consulta_nfse_por_rps_test.rb +0 -36
  236. data/test/br_nfe/servico/betha/v2/envio_lote_rps_sincrono_test.rb +0 -51
  237. data/test/br_nfe/servico/betha/v2/gateway_test.rb +0 -372
  238. data/test/br_nfe/servico/betha/v2/gera_nfse_test.rb +0 -62
  239. data/test/br_nfe/servico/betha/v2/recepcao_lote_rps_test.rb +0 -108
  240. data/test/br_nfe/servico/betha/v2/substituicao_nfse_test.rb +0 -84
  241. data/test/br_nfe/servico/response/default_test.rb +0 -54
  242. data/test/factories/servico/base.rb +0 -5
  243. data/test/factories/servico/betha/base.rb +0 -5
  244. data/test/factories/servico/betha/v1/build_response.rb +0 -6
  245. data/test/factories/servico/betha/v1/cancelamento_nfs.rb +0 -7
  246. data/test/factories/servico/betha/v1/consulta_nfse.rb +0 -8
  247. data/test/factories/servico/betha/v1/recepcao_lote_rps.rb +0 -6
  248. data/test/factories/servico/betha/v2/cancelamento_nfs.rb +0 -7
  249. data/test/factories/servico/betha/v2/consulta_lote_rps.rb +0 -6
  250. data/test/factories/servico/betha/v2/consulta_nfse_por_rps.rb +0 -6
  251. data/test/factories/servico/betha/v2/envio_lote_rps_sincrono.rb +0 -5
  252. data/test/factories/servico/betha/v2/gateway.rb +0 -5
  253. data/test/factories/servico/betha/v2/gera_nfse.rb +0 -6
  254. data/test/factories/servico/betha/v2/recepcao_lote_rps.rb +0 -5
  255. data/test/factories/servico/betha/v2/substituicao_nfse.rb +0 -8
  256. data/test/factories/servico/response/default.rb +0 -10
  257. data/test/factories/servico/rps.rb +0 -44
@@ -0,0 +1,84 @@
1
+ require 'test_helper'
2
+
3
+ describe BrNfe::Service::Betha::V1::RecepcaoLoteRps do
4
+ subject { FactoryGirl.build(:br_nfe_servico_betha_recepcao_lote_rps, emitente: emitente) }
5
+ let(:emitente) { FactoryGirl.build(:emitente) }
6
+ let(:rps_1) { FactoryGirl.build(:br_nfe_rps, valor_pis: '', valor_cofins: nil, valor_inss: nil, valor_ir: nil, valor_csll: nil) }
7
+ let(:rps_2) { FactoryGirl.build(:br_nfe_rps, :completo) }
8
+
9
+ describe "superclass" do
10
+ it { subject.class.superclass.must_equal BrNfe::Service::Betha::V1::Gateway }
11
+ end
12
+
13
+ describe "validations" do
14
+ it { must validate_presence_of(:numero_lote_rps) }
15
+ context "validações do certificado" do
16
+ before do
17
+ subject.certificate_pkcs12 = nil
18
+ subject.certificate_pkcs12_value = nil
19
+ subject.certificate_pkcs12_password = nil
20
+ end
21
+ it { must validate_presence_of(:certificate) }
22
+ it { must validate_presence_of(:certificate_key) }
23
+ end
24
+
25
+ it "deve chamar o metodo validar_lote_rps" do
26
+ subject.expects(:validar_lote_rps)
27
+ subject.valid?
28
+ end
29
+ end
30
+
31
+ describe "#wsdl" do
32
+ context "for env production" do
33
+ it { subject.wsdl.must_equal 'http://e-gov.betha.com.br/e-nota-contribuinte-ws/recepcionarLoteRps?wsdl' }
34
+ end
35
+ context "for env test" do
36
+ before do
37
+ subject.env = :test
38
+ end
39
+ it { subject.wsdl.must_equal 'http://e-gov.betha.com.br/e-nota-contribuinte-test-ws/recepcionarLoteRps?wsdl' }
40
+ end
41
+ end
42
+
43
+ describe "#method_wsdl" do
44
+ it { subject.method_wsdl.must_equal :enviar_lote_rps_envio }
45
+ end
46
+
47
+ it "#response_path_module" do
48
+ subject.response_path_module.must_equal BrNfe::Service::Response::Paths::V1::ServicoEnviarLoteRpsResposta
49
+ end
50
+
51
+ it "#response_root_path" do
52
+ subject.response_root_path.must_equal [:enviar_lote_rps_envio_response]
53
+ end
54
+
55
+ describe "Validação do XML através do XSD" do
56
+ let(:rps_basico) { FactoryGirl.build(:br_nfe_rps) }
57
+ let(:rps_completo) { FactoryGirl.build(:br_nfe_rps, :completo) }
58
+
59
+ let(:schemas_dir) { BrNfe.root+'/test/br_nfe/service/betha/v1/xsd' }
60
+
61
+ def validate_schema
62
+ Dir.chdir(schemas_dir) do
63
+ schema = Nokogiri::XML::Schema(IO.read('servico_enviar_lote_rps_envio_v01.xsd'))
64
+ document = Nokogiri::XML(subject.content_xml)
65
+ errors = schema.validate(document)
66
+ errors.must_be_empty "#{subject.content_xml}"
67
+ end
68
+ end
69
+ it "Deve ser válido com 1 RPS com todas as informações preenchidas" do
70
+ subject.lote_rps = [rps_completo]
71
+ validate_schema
72
+ end
73
+ it "Deve ser válido com 1 RPS com apenas as informações obrigatórias preenchidas" do
74
+ subject.lote_rps = [rps_basico]
75
+ validate_schema
76
+ end
77
+ it "Deve ser válido com vários RPS's - 1 rps completo e 1 parcial" do
78
+ subject.lote_rps = [rps_completo, rps_basico]
79
+ validate_schema
80
+ end
81
+ end
82
+
83
+
84
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ describe BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarLoteRpsResposta do
4
+ class ServicoConsultarLoteRpsRespostaTest
5
+ include BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarLoteRpsResposta
6
+ end
7
+ subject { ServicoConsultarLoteRpsRespostaTest.new }
8
+
9
+ it "deve estar incluso o module ..Response::Paths::V1::ServicoConsultarLoteRpsResposta" do
10
+ subject.class.included_modules.must_include BrNfe::Service::Response::Paths::V1::ServicoConsultarLoteRpsResposta
11
+ end
12
+
13
+ it "metodo invoices_path sobrescrito com valor padrão" do
14
+ subject.invoices_path.must_equal [:consultar_lote_rps_resposta, :lista_nfse, :compl_nfse]
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ describe BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarNfseResposta do
4
+ class ServicoConsultarNfseRespostaTest
5
+ include BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarNfseResposta
6
+ end
7
+ subject { ServicoConsultarNfseRespostaTest.new }
8
+
9
+ it "deve estar incluso o module ..Response::Paths::V1::ServicoConsultarNfseResposta" do
10
+ subject.class.included_modules.must_include BrNfe::Service::Response::Paths::V1::ServicoConsultarNfseResposta
11
+ end
12
+
13
+ it "metodo invoices_path sobrescrito com valor padrão" do
14
+ subject.invoices_path.must_equal [:consultar_nfse_resposta, :lista_nfse, :compl_nfse]
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ describe BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarNfseRpsResposta do
4
+ class ServicoConsultarNfseRpsRespostaTest
5
+ include BrNfe::Service::Betha::V1::ResponsePaths::ServicoConsultarNfseRpsResposta
6
+ end
7
+ subject { ServicoConsultarNfseRpsRespostaTest.new }
8
+
9
+ it "deve estar incluso o module ..Response::Paths::V1::ServicoConsultarNfseRpsResposta" do
10
+ subject.class.included_modules.must_include BrNfe::Service::Response::Paths::V1::ServicoConsultarNfseRpsResposta
11
+ end
12
+
13
+ it "metodo invoices_path sobrescrito com valor padrão" do
14
+ subject.invoices_path.must_equal [:consultar_nfse_rps_resposta, :compl_nfse]
15
+ end
16
+ end
@@ -0,0 +1,583 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <xs:schema targetNamespace="http://www.betha.com.br/e-nota-contribuinte-ws/tipos"
3
+ xmlns:tipos="http://www.betha.com.br/e-nota-contribuinte-ws/tipos"
4
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
5
+ xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
6
+ <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema_v01.xsd" />
7
+
8
+ <!-- Tipos Simples-->
9
+ <xs:simpleType name="TsNumeroNfse">
10
+ <xs:annotation>
11
+ <xs:documentation>Número da NFS-e</xs:documentation>
12
+ </xs:annotation>
13
+ <xs:restriction base="xs:long">
14
+ <xs:pattern value="[0-9]{1,15}" />
15
+ </xs:restriction>
16
+ </xs:simpleType>
17
+
18
+ <xs:simpleType name="TsCnpj">
19
+ <xs:annotation>
20
+ <xs:documentation>Núumero Cnpj</xs:documentation>
21
+ </xs:annotation>
22
+ <xs:restriction base="xs:string">
23
+ <xs:pattern value="[0-9]{14}" />
24
+ </xs:restriction>
25
+ </xs:simpleType>
26
+
27
+ <xs:simpleType name="TsCpf">
28
+ <xs:annotation>
29
+ <xs:documentation>Cpf</xs:documentation>
30
+ </xs:annotation>
31
+ <xs:restriction base="xs:string">
32
+ <xs:pattern value="[0-9]{0}|[0-9]{11}" />
33
+ </xs:restriction>
34
+ </xs:simpleType>
35
+
36
+ <xs:simpleType name="tsInscricaoMunicipal">
37
+ <xs:annotation>
38
+ <xs:documentation>Tipo padrão referente a inscrição municipal.</xs:documentation>
39
+ </xs:annotation>
40
+ <xs:restriction base="xs:long">
41
+ <xs:pattern value="[0-9]{1,20}" />
42
+ </xs:restriction>
43
+ </xs:simpleType>
44
+
45
+ <xs:simpleType name="tsRazaoSocial">
46
+ <xs:annotation>
47
+ <xs:documentation>Razão Social do Contribuinte</xs:documentation>
48
+ </xs:annotation>
49
+ <xs:restriction base="xs:string">
50
+ <xs:minLength value="1" />
51
+ <xs:maxLength value="115" />
52
+ <xs:whiteSpace value="collapse" />
53
+ </xs:restriction>
54
+ </xs:simpleType>
55
+
56
+ <xs:simpleType name="tsNumeroLote">
57
+ <xs:annotation>
58
+ <xs:documentation>Número do Lote de RPS</xs:documentation>
59
+ </xs:annotation>
60
+ <xs:restriction base="xs:long">
61
+ <xs:pattern value="[0-9]{1,15}" />
62
+ </xs:restriction>
63
+ </xs:simpleType>
64
+
65
+ <xs:simpleType name="TsQuantidadeRps">
66
+ <xs:annotation>
67
+ <xs:documentation>Quantidade de Rps do lote</xs:documentation>
68
+ </xs:annotation>
69
+ <xs:restriction base="xs:int">
70
+ <xs:pattern value="[0-9]{1,4}" />
71
+ </xs:restriction>
72
+ </xs:simpleType>
73
+
74
+ <xs:simpleType name="TsNumeroRps">
75
+ <xs:annotation>
76
+ <xs:documentation>Número do RPS</xs:documentation>
77
+ </xs:annotation>
78
+ <xs:restriction base="xs:long">
79
+ <xs:pattern value="[0-9]{1,15}" />
80
+ </xs:restriction>
81
+ </xs:simpleType>
82
+
83
+ <xs:simpleType name="TsSerieRps">
84
+ <xs:annotation>
85
+ <xs:documentation>Número de série do RPS</xs:documentation>
86
+ </xs:annotation>
87
+ <xs:restriction base="xs:string">
88
+ <xs:minLength value="0" />
89
+ <xs:maxLength value="5" />
90
+ <xs:whiteSpace value="collapse" />
91
+ </xs:restriction>
92
+ </xs:simpleType>
93
+
94
+ <xs:simpleType name="TsTipoRps">
95
+ <xs:annotation>
96
+ <xs:documentation>Código de Tipo de RPS</xs:documentation>
97
+ </xs:annotation>
98
+ <xs:restriction base="xs:int">
99
+ <xs:pattern value="[1-3]{1}" />
100
+ </xs:restriction>
101
+ </xs:simpleType>
102
+
103
+ <xs:simpleType name="tsNaturezaOperacao">
104
+ <xs:annotation>
105
+ <xs:documentation>Código da natureza da operação</xs:documentation>
106
+ </xs:annotation>
107
+ <xs:restriction base="xs:int">
108
+ <xs:pattern value="[1-7]{1}" />
109
+ </xs:restriction>
110
+ </xs:simpleType>
111
+
112
+ <xs:simpleType name="tsRegimeEspecialTributacao">
113
+ <xs:annotation>
114
+ <xs:documentation>Código de identificação do regime especial de tributação</xs:documentation>
115
+ </xs:annotation>
116
+ <xs:restriction base="xs:int">
117
+ <xs:pattern value="[1-6]{1}" />
118
+ </xs:restriction>
119
+ </xs:simpleType>
120
+
121
+ <xs:simpleType name="TsSimNao">
122
+ <xs:annotation>
123
+ <xs:documentation>Identificação de Sim/Não</xs:documentation>
124
+ </xs:annotation>
125
+ <xs:restriction base="xs:int">
126
+ <xs:pattern value="[1-3]{1}" />
127
+ </xs:restriction>
128
+ </xs:simpleType>
129
+
130
+ <xs:simpleType name="TsStatusRps">
131
+ <xs:annotation>
132
+ <xs:documentation>Código do status do RPS</xs:documentation>
133
+ </xs:annotation>
134
+ <xs:restriction base="xs:int">
135
+ <xs:pattern value="[1-2]{1}" />
136
+ </xs:restriction>
137
+ </xs:simpleType>
138
+
139
+ <xs:simpleType name="TsValor">
140
+ <xs:annotation>
141
+ <xs:documentation>Valor monetário - 15 dígitos, sendo 13 de corpo e 2 decimais</xs:documentation>
142
+ </xs:annotation>
143
+ <xs:restriction base="xs:decimal">
144
+ <xs:totalDigits value="15" />
145
+ <xs:fractionDigits value="2" />
146
+ <xs:minInclusive value="0" />
147
+ <xs:pattern value="0|0\.[0-9]{2}|[1-9]{1}[0-9]{0,12}(\.[0-9]{0,2})?" />
148
+ </xs:restriction>
149
+ </xs:simpleType>
150
+
151
+ <xs:simpleType name="TsAliquota">
152
+ <xs:annotation>
153
+ <xs:documentation>Alíquota. Valor percentual.</xs:documentation>
154
+ </xs:annotation>
155
+ <xs:restriction base="xs:decimal">
156
+ <xs:totalDigits value="5" />
157
+ <xs:fractionDigits value="4" />
158
+ <xs:minInclusive value="0" />
159
+ </xs:restriction>
160
+ </xs:simpleType>
161
+
162
+ <xs:simpleType name="tsItemListaServico">
163
+ <xs:annotation>
164
+ <xs:documentation>Código do item da lista de serviço</xs:documentation>
165
+ </xs:annotation>
166
+ <xs:restriction base="xs:string">
167
+ <xs:minLength value="0" />
168
+ <xs:maxLength value="4" />
169
+ <xs:whiteSpace value="collapse" />
170
+ </xs:restriction>
171
+ </xs:simpleType>
172
+
173
+ <xs:simpleType name="TsCodigoCnae">
174
+ <xs:annotation>
175
+ <xs:documentation>Código CNAE</xs:documentation>
176
+ </xs:annotation>
177
+ <xs:restriction base="xs:long">
178
+ <xs:pattern value="[0-9]{1,7}" />
179
+ </xs:restriction>
180
+ </xs:simpleType>
181
+
182
+ <xs:simpleType name="tsCodigoTributacao">
183
+ <xs:annotation>
184
+ <xs:documentation>Código de tributação</xs:documentation>
185
+ </xs:annotation>
186
+ <xs:restriction base="xs:string">
187
+ <xs:minLength value="1" />
188
+ <xs:maxLength value="20" />
189
+ <xs:whiteSpace value="collapse" />
190
+ </xs:restriction>
191
+ </xs:simpleType>
192
+
193
+ <xs:simpleType name="tsDiscriminacao">
194
+ <xs:annotation>
195
+ <xs:documentation>Discriminação do conteúdo da NFS-e.</xs:documentation>
196
+ </xs:annotation>
197
+ <xs:restriction base="xs:string">
198
+ <xs:minLength value="0" />
199
+ <xs:maxLength value="2000" />
200
+ <xs:whiteSpace value="collapse" />
201
+ </xs:restriction>
202
+ </xs:simpleType>
203
+
204
+ <xs:simpleType name="tsCodigoMunicipioIbge">
205
+ <xs:annotation>
206
+ <xs:documentation>Código CNAE</xs:documentation>
207
+ </xs:annotation>
208
+ <xs:restriction base="xs:long">
209
+ <xs:pattern value="[0-9]{1,7}" />
210
+ </xs:restriction>
211
+ </xs:simpleType>
212
+
213
+ <xs:simpleType name="tsEndereco">
214
+ <xs:annotation>
215
+ <xs:documentation>Endereço</xs:documentation>
216
+ </xs:annotation>
217
+ <xs:restriction base="xs:string">
218
+ <xs:minLength value="0" />
219
+ <xs:maxLength value="100" />
220
+ <xs:whiteSpace value="collapse" />
221
+ </xs:restriction>
222
+ </xs:simpleType>
223
+
224
+ <xs:simpleType name="tsNumeroEndereco">
225
+ <xs:annotation>
226
+ <xs:documentation>Número do endereço</xs:documentation>
227
+ </xs:annotation>
228
+ <xs:restriction base="xs:string">
229
+ <xs:minLength value="0" />
230
+ <xs:maxLength value="10" />
231
+ <xs:whiteSpace value="collapse" />
232
+ </xs:restriction>
233
+ </xs:simpleType>
234
+
235
+ <xs:simpleType name="tsComplementoEndereco">
236
+ <xs:annotation>
237
+ <xs:documentation>Complemento de endereço.</xs:documentation>
238
+ </xs:annotation>
239
+ <xs:restriction base="xs:string">
240
+ <xs:minLength value="0" />
241
+ <xs:maxLength value="60" />
242
+ <xs:whiteSpace value="collapse" />
243
+ </xs:restriction>
244
+ </xs:simpleType>
245
+
246
+ <xs:simpleType name="tsBairro">
247
+ <xs:annotation>
248
+ <xs:documentation>Bairro</xs:documentation>
249
+ </xs:annotation>
250
+ <xs:restriction base="xs:string">
251
+ <xs:minLength value="0" />
252
+ <xs:maxLength value="60" />
253
+ <xs:whiteSpace value="collapse" />
254
+ </xs:restriction>
255
+ </xs:simpleType>
256
+
257
+ <xs:simpleType name="tsUf">
258
+ <xs:annotation>
259
+ <xs:documentation>Sigla da unidade federativa</xs:documentation>
260
+ </xs:annotation>
261
+ <xs:restriction base="xs:string">
262
+ <xs:minLength value="2" />
263
+ <xs:maxLength value="2" />
264
+ <xs:whiteSpace value="collapse" />
265
+ </xs:restriction>
266
+ </xs:simpleType>
267
+
268
+ <xs:simpleType name="tsCep">
269
+ <xs:annotation>
270
+ <xs:documentation>Número do CEP</xs:documentation>
271
+ </xs:annotation>
272
+ <xs:restriction base="xs:int">
273
+ <xs:pattern value="[0-9]{7,8}" />
274
+ </xs:restriction>
275
+ </xs:simpleType>
276
+
277
+ <xs:simpleType name="tsEmail">
278
+ <xs:annotation>
279
+ <xs:documentation>E-mail</xs:documentation>
280
+ </xs:annotation>
281
+ <xs:restriction base="xs:string">
282
+ <xs:minLength value="5" />
283
+ <xs:maxLength value="80" />
284
+ <xs:whiteSpace value="collapse" />
285
+ <xs:pattern value="[A-Za-z0-9\\._-]+@[A-Za-z0-9\\._-]+[.][A-Za-z]+" />
286
+ </xs:restriction>
287
+ </xs:simpleType>
288
+
289
+ <xs:simpleType name="tsTelefone">
290
+ <xs:annotation>
291
+ <xs:documentation>Telefone</xs:documentation>
292
+ </xs:annotation>
293
+ <xs:restriction base="xs:string">
294
+ <xs:minLength value="8" />
295
+ <xs:maxLength value="11" />
296
+ <xs:whiteSpace value="collapse" />
297
+ <xs:pattern value="[0-9]{8,11}" />
298
+ </xs:restriction>
299
+ </xs:simpleType>
300
+
301
+ <xs:simpleType name="tsCodigoObra">
302
+ <xs:annotation>
303
+ <xs:documentation>Código de Obra</xs:documentation>
304
+ </xs:annotation>
305
+ <xs:restriction base="xs:string">
306
+ <xs:minLength value="1" />
307
+ <xs:maxLength value="15" />
308
+ <xs:whiteSpace value="collapse" />
309
+ </xs:restriction>
310
+ </xs:simpleType>
311
+
312
+ <xs:simpleType name="tsArt">
313
+ <xs:annotation>
314
+ <xs:documentation>Código ART</xs:documentation>
315
+ </xs:annotation>
316
+ <xs:restriction base="xs:string">
317
+ <xs:minLength value="1" />
318
+ <xs:maxLength value="15" />
319
+ <xs:whiteSpace value="collapse" />
320
+ </xs:restriction>
321
+ </xs:simpleType>
322
+
323
+ <xs:simpleType name="tsNumeroProtocolo">
324
+ <xs:annotation>
325
+ <xs:documentation>Número do protocolo de recebimento do RPS</xs:documentation>
326
+ </xs:annotation>
327
+ <xs:restriction base="xs:long">
328
+ <xs:pattern value="[0-9]{1,15}" />
329
+ </xs:restriction>
330
+ </xs:simpleType>
331
+
332
+ <xs:simpleType name="tsCodigoVerificacao">
333
+ <xs:annotation>
334
+ <xs:documentation>Código de verificação da nota fiscal</xs:documentation>
335
+ </xs:annotation>
336
+ <xs:restriction base="xs:string">
337
+ <xs:maxLength value="9"/>
338
+ <xs:minLength value="1"/>
339
+ <xs:whiteSpace value="collapse"/>
340
+ </xs:restriction>
341
+ </xs:simpleType>
342
+
343
+ <xs:simpleType name="tsCodigoCancelamentoNfse">
344
+ <xs:annotation>
345
+ <xs:documentation>Código de erro, conforme definido na tabela erros</xs:documentation>
346
+ </xs:annotation>
347
+ <xs:restriction base="xs:string">
348
+ <xs:maxLength value="4"/>
349
+ <xs:minLength value="1"/>
350
+ <xs:whiteSpace value="collapse"/>
351
+ </xs:restriction>
352
+ </xs:simpleType>
353
+
354
+ <!-- Tipos Complexos-->
355
+ <xs:complexType name="tcIdentificacaoPrestador">
356
+ <xs:annotation>
357
+ <xs:documentation>Representa dados para identificação do prestador de serviços</xs:documentation>
358
+ </xs:annotation>
359
+ <xs:sequence>
360
+ <xs:element name="Cnpj" type="tipos:TsCnpj" minOccurs="1" maxOccurs="1" />
361
+ <xs:element name="InscricaoMunicipal" type="tipos:tsInscricaoMunicipal" minOccurs="0" maxOccurs="1" />
362
+ </xs:sequence>
363
+ </xs:complexType>
364
+
365
+ <xs:complexType name="tcIdentificacaoTomador">
366
+ <xs:annotation>
367
+ <xs:documentation>Representa dados para identificação do tomador de serviços</xs:documentation>
368
+ </xs:annotation>
369
+ <xs:sequence>
370
+ <xs:element name="CpfCnpj" type="tipos:TcCpfCnpj" minOccurs="0" maxOccurs="1" />
371
+ <xs:element name="InscricaoMunicipal" type="tipos:tsInscricaoMunicipal" minOccurs="0" maxOccurs="1" />
372
+ </xs:sequence>
373
+ </xs:complexType>
374
+
375
+ <xs:complexType name="TcIdentificacaoIntermediarioServico">
376
+ <xs:annotation>
377
+ <xs:documentation>Representa dados para identificação do intermediário de serviços</xs:documentation>
378
+ </xs:annotation>
379
+ <xs:sequence>
380
+ <xs:element name="RazaoSocial" type="tipos:tsRazaoSocial" minOccurs="1" maxOccurs="1" />
381
+ <xs:element name="CpfCnpj" type="tipos:TcCpfCnpj" minOccurs="1" maxOccurs="1" />
382
+ <xs:element name="InscricaoMunicipal" type="tipos:tsInscricaoMunicipal" minOccurs="0" maxOccurs="1" />
383
+ </xs:sequence>
384
+ </xs:complexType>
385
+
386
+ <xs:complexType name="TcCpfCnpj">
387
+ <xs:annotation>
388
+ <xs:documentation>Número de Cpf ou Cnpj</xs:documentation>
389
+ </xs:annotation>
390
+ <xs:choice>
391
+ <xs:element name="Cpf" type="tipos:TsCpf" minOccurs="1" maxOccurs="1" />
392
+ <xs:element name="Cnpj" type="tipos:TsCnpj" minOccurs="1" maxOccurs="1" />
393
+ </xs:choice>
394
+ </xs:complexType>
395
+
396
+ <xs:complexType name="tcLoteRps">
397
+ <xs:annotation>
398
+ <xs:documentation>Lote dp RPS</xs:documentation>
399
+ </xs:annotation>
400
+ <xs:sequence>
401
+ <xs:element name="NumeroLote" type="tipos:tsNumeroLote" minOccurs="1" maxOccurs="1"/>
402
+ <xs:element name="Cnpj" type="tipos:TsCnpj" minOccurs="1" maxOccurs="1"/>
403
+ <xs:element name="InscricaoMunicipal" type="tipos:tsInscricaoMunicipal" minOccurs="1" maxOccurs="1"/>
404
+ <xs:element name="QuantidadeRps" type="tipos:TsQuantidadeRps" minOccurs="1" maxOccurs="1"/>
405
+ <xs:element name="ListaRps" minOccurs="1" maxOccurs="1">
406
+ <xs:complexType>
407
+ <xs:sequence>
408
+ <xs:element name="Rps" maxOccurs="unbounded" type="tipos:tcRps" minOccurs="1">
409
+ </xs:element>
410
+ </xs:sequence>
411
+ </xs:complexType>
412
+ </xs:element>
413
+ </xs:sequence>
414
+ <xs:attribute name="Id" type="xs:string"/>
415
+ </xs:complexType>
416
+
417
+ <xs:complexType name="tcRps">
418
+ <xs:annotation>
419
+ <xs:documentation>Representação do RPS</xs:documentation>
420
+ </xs:annotation>
421
+ <xs:sequence>
422
+ <xs:element name="InfRps" type="tipos:tcInfRps" minOccurs="1" maxOccurs="1"/>
423
+ <xs:element ref="ds:Signature" minOccurs="0" maxOccurs="1"/>
424
+ </xs:sequence>
425
+ </xs:complexType>
426
+
427
+ <xs:complexType name="tcInfRps">
428
+ <xs:annotation>
429
+ <xs:documentation>Representa a estrutura de recibo provisório de serviços (Rps)</xs:documentation>
430
+ </xs:annotation>
431
+ <xs:sequence>
432
+ <xs:element name="IdentificacaoRps" type="tipos:tcIdentificacaoRps" minOccurs="1" maxOccurs="1" />
433
+ <xs:element name="DataEmissao" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
434
+ <xs:element name="NaturezaOperacao" type="tipos:tsNaturezaOperacao" minOccurs="1" maxOccurs="1" />
435
+ <xs:element name="RegimeEspecialTributacao" type="tipos:tsRegimeEspecialTributacao" minOccurs="0" maxOccurs="1" />
436
+ <xs:element name="OptanteSimplesNacional" type="tipos:TsSimNao" minOccurs="1" maxOccurs="1" />
437
+ <xs:element name="IncentivadorCultural" type="tipos:TsSimNao" minOccurs="1" maxOccurs="1" />
438
+ <xs:element name="Status" type="tipos:TsStatusRps" minOccurs="1" maxOccurs="1" />
439
+ <xs:element name="RpsSubstituido" type="tipos:tcIdentificacaoRps" minOccurs="0" maxOccurs="1" />
440
+ <xs:element name="Servico" type="tipos:TcDadosServico" minOccurs="1" maxOccurs="1" />
441
+ <xs:element name="Prestador" type="tipos:tcIdentificacaoPrestador" minOccurs="1" maxOccurs="1" />
442
+ <xs:element name="Tomador" type="tipos:tcDadosTomador" minOccurs="1" maxOccurs="1" />
443
+ <xs:element name="IntermediarioServico" type="tipos:TcIdentificacaoIntermediarioServico" minOccurs="0" maxOccurs="1" />
444
+ <xs:element name="ConstrucaoCivil" type="tipos:tcDadosConstrucaoCivil" minOccurs="0" maxOccurs="1" />
445
+ </xs:sequence>
446
+ <xs:attribute name="Id" type="xs:string"/>
447
+ </xs:complexType>
448
+
449
+ <xs:complexType name="tcIdentificacaoRps">
450
+ <xs:annotation>
451
+ <xs:documentation>Dados de identificação do Rps</xs:documentation>
452
+ </xs:annotation>
453
+ <xs:sequence>
454
+ <xs:element name="Numero" type="tipos:TsNumeroRps" minOccurs="1" maxOccurs="1" />
455
+ <xs:element name="Serie" type="tipos:TsSerieRps" minOccurs="1" maxOccurs="1" />
456
+ <xs:element name="Tipo" type="tipos:TsTipoRps" minOccurs="1" maxOccurs="1" />
457
+ </xs:sequence>
458
+ </xs:complexType>
459
+
460
+ <xs:complexType name="TcDadosServico">
461
+ <xs:annotation>
462
+ <xs:documentation>Representa dados que compõem o serviço prestado</xs:documentation>
463
+ </xs:annotation>
464
+ <xs:sequence>
465
+ <xs:element name="Valores" type="tipos:TcValores" minOccurs="1" maxOccurs="1" />
466
+ <xs:element name="ItemListaServico" type="tipos:tsItemListaServico" minOccurs="1" maxOccurs="1" />
467
+ <xs:element name="CodigoCnae" type="tipos:TsCodigoCnae" minOccurs="0" maxOccurs="1" />
468
+ <xs:element name="CodigoTributacaoMunicipio" type="tipos:tsCodigoTributacao" minOccurs="0" maxOccurs="1" />
469
+ <xs:element name="Discriminacao" type="tipos:tsDiscriminacao" minOccurs="1" maxOccurs="1" />
470
+ <xs:element name="CodigoMunicipio" type="tipos:tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1" />
471
+ </xs:sequence>
472
+ </xs:complexType>
473
+
474
+ <xs:complexType name="TcValores">
475
+ <xs:annotation>
476
+ <xs:documentation>Representa um conjunto de valores que compõe o documento fiscal</xs:documentation>
477
+ </xs:annotation>
478
+ <xs:sequence>
479
+ <xs:element name="ValorServicos" type="tipos:TsValor" minOccurs="1" maxOccurs="1" />
480
+ <xs:element name="ValorDeducoes" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
481
+ <xs:element name="ValorPis" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
482
+ <xs:element name="ValorCofins" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
483
+ <xs:element name="ValorInss" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
484
+ <xs:element name="ValorIr" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
485
+ <xs:element name="ValorCsll" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
486
+ <xs:element name="IssRetido" type="tipos:TsSimNao" minOccurs="1" maxOccurs="1" />
487
+ <xs:element name="ValorIss" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
488
+ <xs:element name="ValorIssRetido" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
489
+ <xs:element name="OutrasRetencoes" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
490
+ <xs:element name="BaseCalculo" type="tipos:TsValor" minOccurs="0" maxOccurs="1" >
491
+ <xs:annotation>
492
+ <xs:documentation>Valor dos serviços - valor das deduções - descontos incondicionados</xs:documentation>
493
+ </xs:annotation>
494
+ </xs:element>
495
+ <xs:element name="Aliquota" type="tipos:TsAliquota" minOccurs="0" maxOccurs="1" />
496
+ <xs:element name="ValorLiquidoNfse" type="tipos:TsValor" minOccurs="0" maxOccurs="1" >
497
+ <xs:annotation>
498
+ <xs:documentation>Valor dos serviços - valor do PIS - valor COFINS - valor INSS - valor IR - valor CSLL - outras retenções - valor ISS retido - desconto incondicionado - desconto condicionado</xs:documentation>
499
+ </xs:annotation>
500
+ </xs:element>
501
+ <xs:element name="DescontoIncondicionado" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
502
+ <xs:element name="DescontoCondicionado" type="tipos:TsValor" minOccurs="0" maxOccurs="1" />
503
+ </xs:sequence>
504
+ </xs:complexType>
505
+
506
+ <xs:complexType name="tcDadosTomador">
507
+ <xs:annotation>
508
+ <xs:documentation>Representa dados do tomador de serviços</xs:documentation>
509
+ </xs:annotation>
510
+ <xs:sequence>
511
+ <xs:element name="IdentificacaoTomador" type="tipos:tcIdentificacaoTomador" minOccurs="0" maxOccurs="1" />
512
+ <xs:element name="RazaoSocial" type="tipos:tsRazaoSocial" minOccurs="0" maxOccurs="1" />
513
+ <xs:element name="Endereco" type="tipos:TcEndereco" minOccurs="0" maxOccurs="1" />
514
+ <xs:element name="Contato" type="tipos:TcContato" minOccurs="0" maxOccurs="1" />
515
+ </xs:sequence>
516
+ </xs:complexType>
517
+
518
+ <xs:complexType name="TcEndereco">
519
+ <xs:annotation>
520
+ <xs:documentation>Representação completa do endereço</xs:documentation>
521
+ </xs:annotation>
522
+ <xs:sequence>
523
+ <xs:element name="Endereco" type="tipos:tsEndereco" minOccurs="0" maxOccurs="1" />
524
+ <xs:element name="Numero" type="tipos:tsNumeroEndereco" minOccurs="0" maxOccurs="1" />
525
+ <xs:element name="Complemento" type="tipos:tsComplementoEndereco" minOccurs="0" maxOccurs="1" />
526
+ <xs:element name="Bairro" type="tipos:tsBairro" minOccurs="0" maxOccurs="1" />
527
+ <xs:element name="CodigoMunicipio" type="tipos:tsCodigoMunicipioIbge" minOccurs="0" maxOccurs="1" />
528
+ <xs:element name="Uf" type="tipos:tsUf" minOccurs="0" maxOccurs="1" />
529
+ <xs:element name="Cep" type="tipos:tsCep" minOccurs="0" maxOccurs="1" />
530
+ </xs:sequence>
531
+ </xs:complexType>
532
+
533
+ <xs:complexType name="TcContato">
534
+ <xs:annotation>
535
+ <xs:documentation>Representa a forma de contato com a pessoa (física/jurídica)</xs:documentation>
536
+ </xs:annotation>
537
+ <xs:sequence>
538
+ <xs:element name="Telefone" type="tipos:tsTelefone" minOccurs="0" maxOccurs="1" />
539
+ <xs:element name="Email" type="tipos:tsEmail" minOccurs="0" maxOccurs="1" />
540
+ </xs:sequence>
541
+ </xs:complexType>
542
+
543
+ <xs:complexType name="tcDadosConstrucaoCivil">
544
+ <xs:annotation>
545
+ <xs:documentation>Representa dados para identificação de construção civil</xs:documentation>
546
+ </xs:annotation>
547
+ <xs:sequence>
548
+ <xs:element name="CodigoObra" type="tipos:tsCodigoObra" minOccurs="1" maxOccurs="1" />
549
+ <xs:element name="Art" type="tipos:tsArt" minOccurs="1" maxOccurs="1" />
550
+ </xs:sequence>
551
+ </xs:complexType>
552
+
553
+ <xs:complexType name="tcPedidoCancelamento">
554
+ <xs:annotation>
555
+ <xs:documentation>Representa dados para o pedido de cancelamento de uma nota fiscal</xs:documentation>
556
+ </xs:annotation>
557
+ <xs:sequence>
558
+ <xs:element name="InfPedidoCancelamento" type="tipos:tcInfPedidoCancelamento" minOccurs="1" maxOccurs="1"/>
559
+ <xs:element ref="ds:Signature" minOccurs="1" maxOccurs="1"/>
560
+ </xs:sequence>
561
+ </xs:complexType>
562
+
563
+ <xs:complexType name="tcInfPedidoCancelamento">
564
+ <xs:sequence>
565
+ <xs:element name="IdentificacaoNfse" type="tipos:tcIdentificacaoNfse" minOccurs="1" maxOccurs="1"/>
566
+ <xs:element name="CodigoCancelamento" type="tipos:tsCodigoCancelamentoNfse" minOccurs="1" maxOccurs="1"/>
567
+ </xs:sequence>
568
+ <xs:attribute name="Id" type="xs:string"/>
569
+ </xs:complexType>
570
+
571
+ <xs:complexType name="tcIdentificacaoNfse">
572
+ <xs:annotation>
573
+ <xs:documentation>Representa dados que identificam uma Nota Fiscal de Serviços Eletrônica</xs:documentation>
574
+ </xs:annotation>
575
+ <xs:sequence>
576
+ <xs:element name="Numero" type="tipos:TsNumeroNfse" minOccurs="1" maxOccurs="1" />
577
+ <xs:element name="Cnpj" type="tipos:TsCnpj" minOccurs="1" maxOccurs="1"/>
578
+ <xs:element name="InscricaoMunicipal" type="tipos:tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
579
+ <xs:element name="CodigoMunicipio" type="tipos:tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1"/>
580
+ </xs:sequence>
581
+ </xs:complexType>
582
+
583
+ </xs:schema>