br_nfe 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/br_nfe/active_model_base.rb +0 -5
- data/lib/br_nfe/base.rb +116 -7
- data/lib/br_nfe/helper/values_ts/service_v1.rb +15 -11
- data/lib/br_nfe/response/service/build_response.rb +230 -53
- data/lib/br_nfe/response/service/nota_fiscal.rb +9 -0
- data/lib/br_nfe/response/service/paths/base.rb +93 -59
- data/lib/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta.rb +2 -2
- data/lib/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta.rb +4 -4
- data/lib/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta.rb +8 -8
- data/lib/br_nfe/response/service/paths/v1/tc_nfse.rb +201 -57
- data/lib/br_nfe/service/base.rb +104 -5
- data/lib/br_nfe/service/betha/base.rb +5 -0
- data/lib/br_nfe/service/betha/v1/cancelamento_nfs.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_lote_rps.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_nfs_por_rps.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_nfse.rb +1 -4
- data/lib/br_nfe/service/betha/v1/consulta_situacao_lote_rps.rb +1 -3
- data/lib/br_nfe/service/betha/v1/gateway.rb +1 -1
- data/lib/br_nfe/service/betha/v1/recepcao_lote_rps.rb +1 -3
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta.rb +5 -1
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta.rb +5 -1
- data/lib/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +5 -1
- data/lib/br_nfe/service/concerns/rules/cancelamento_nfs.rb +5 -0
- data/lib/br_nfe/service/rps.rb +13 -4
- data/lib/br_nfe/service/simpliss/v1/base.rb +79 -0
- data/lib/br_nfe/service/simpliss/v1/cancela_nfse.rb +30 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_lote_rps.rb +38 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_nfs_por_rps.rb +31 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_nfse.rb +30 -0
- data/lib/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps.rb +29 -0
- data/lib/br_nfe/service/simpliss/v1/recepcao_lote_rps.rb +35 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_cancelar_nfse_resposta.rb +22 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_lote_rps_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +25 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_consultar_situacao_lote_rps_resposta.rb +31 -0
- data/lib/br_nfe/service/simpliss/v1/response_paths/servico_enviar_lote_rps_resposta.rb +36 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_login.xml.slim +3 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_tc_dados_servico.xml.slim +18 -0
- data/lib/br_nfe/service/simpliss/v1/xml/_tc_item_servico.xml.slim +3 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_cancelar_nfse_envio.xml.slim +11 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_lote_rps_envio.xml.slim +7 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_envio.xml.slim +22 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_nfse_rps_envio.xml.slim +8 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_consultar_situacao_lote_rps_envio.xml.slim +7 -0
- data/lib/br_nfe/service/simpliss/v1/xml/servico_enviar_lote_rps_envio.xml.slim +11 -0
- data/lib/br_nfe/service/thema/v1/base.rb +48 -2
- data/lib/br_nfe/service/thema/v1/cancela_nfse.rb +14 -5
- data/lib/br_nfe/service/thema/v1/consulta_lote_rps.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_nfs_por_rps.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_nfse.rb +5 -4
- data/lib/br_nfe/service/thema/v1/consulta_situacao_lote_rps.rb +1 -4
- data/lib/br_nfe/service/thema/v1/recepcao_lote_rps.rb +19 -5
- data/lib/br_nfe/service/thema/v1/recepcao_lote_rps_limitado.rb +1 -1
- data/lib/br_nfe/service/thema/v1/response_paths/servico_cancelar_nfse_resposta.rb +17 -0
- data/lib/br_nfe/service/thema/v1/response_paths/servico_consultar_nfse_rps_resposta.rb +19 -0
- data/lib/br_nfe/service/xml/v1/_tc_contato.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_cpf_cnpj.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_dados_construcao_civil.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_dados_prestador.xml.slim +5 -5
- data/lib/br_nfe/service/xml/v1/_tc_dados_servico.xml.slim +6 -6
- data/lib/br_nfe/service/xml/v1/_tc_dados_tomador.xml.slim +4 -4
- data/lib/br_nfe/service/xml/v1/_tc_endereco.xml.slim +7 -7
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_intermediario_servico.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_nfse.xml.slim +4 -4
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_orgao_gerador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_prestador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_rps.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/_tc_identificacao_tomador.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_inf_pedido_cancelamento.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_inf_rps.xml.slim +13 -13
- data/lib/br_nfe/service/xml/v1/_tc_lote_rps.xml.slim +6 -6
- data/lib/br_nfe/service/xml/v1/_tc_pedido_cancelamento.xml.slim +1 -1
- data/lib/br_nfe/service/xml/v1/_tc_rps.xml.slim +2 -2
- data/lib/br_nfe/service/xml/v1/_tc_valores.xml.slim +16 -17
- data/lib/br_nfe/service/xml/v1/servico_cancelar_nfse_envio.xml.slim +3 -4
- data/lib/br_nfe/service/xml/v1/servico_consultar_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_envio.xml.slim +8 -8
- data/lib/br_nfe/service/xml/v1/servico_consultar_nfse_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_consultar_situacao_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/service/xml/v1/servico_enviar_lote_rps_envio.xml.slim +3 -3
- data/lib/br_nfe/version.rb +1 -1
- data/lib/br_nfe/xml/_signed_info_sh1.xml.slim +9 -9
- data/lib/br_nfe/xml/signature_sh1.xml.slim +5 -5
- data/lib/br_nfe.rb +26 -10
- data/test/br_nfe/base_test.rb +5 -5
- data/test/br_nfe/helper/values_ts/service_v1_test.rb +376 -0
- data/test/br_nfe/response/service/build_response_test.rb +1 -173
- data/test/br_nfe/response/service/paths/base_test.rb +61 -64
- data/test/br_nfe/response/service/paths/v1/servico_cancelar_nfse_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_lote_rps_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_nfse_rps_resposta_test.rb +2 -2
- data/test/br_nfe/response/service/paths/v1/servico_consultar_situacao_lote_rps_resposta_test.rb +3 -3
- data/test/br_nfe/response/service/paths/v1/servico_enviar_lote_rps_resposta_test.rb +4 -4
- data/test/br_nfe/response/service/paths/v1/tc_nfse_test.rb +27 -31
- data/test/br_nfe/service/base_test.rb +206 -11
- data/test/br_nfe/service/betha/base_test.rb +9 -0
- data/test/br_nfe/service/betha/v1/cancelamento_nfs_test.rb +0 -6
- data/test/br_nfe/service/betha/v1/consulta_lote_rps_test.rb +0 -6
- data/test/br_nfe/service/betha/v1/consulta_nfs_por_rps_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/consulta_nfse_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/consulta_situacao_lote_rps_test.rb +1 -5
- data/test/br_nfe/service/betha/v1/gateway_test.rb +4 -2
- data/test/br_nfe/service/betha/v1/recepcao_lote_rps_test.rb +0 -4
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_lote_rps_resposta_test.rb +1 -1
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_resposta_test.rb +1 -1
- data/test/br_nfe/service/betha/v1/response_paths/servico_consultar_nfse_rps_resposta_test.rb +1 -1
- data/test/br_nfe/service/rps_test.rb +39 -6
- data/test/br_nfe/service/simpliss/v1/base_test.rb +102 -0
- data/test/br_nfe/service/simpliss/v1/cancela_nfse_test.rb +97 -0
- data/test/br_nfe/service/simpliss/v1/consulta_lote_rps_test.rb +241 -0
- data/test/br_nfe/service/simpliss/v1/consulta_nfs_por_rps_test.rb +239 -0
- data/test/br_nfe/service/simpliss/v1/consulta_nfse_test.rb +226 -0
- data/test/br_nfe/service/simpliss/v1/consulta_situacao_lote_rps_test.rb +122 -0
- data/test/br_nfe/service/simpliss/v1/recepcao_lote_rps_test.rb +105 -0
- data/test/br_nfe/service/simpliss/v1/xsd/nfse_3.xsd +735 -0
- data/test/br_nfe/service/simpliss/v1/xsd/xmldsig-core-schema20020212.xsd +318 -0
- data/test/br_nfe/service/thema/v1/base_test.rb +23 -2
- data/test/br_nfe/service/thema/v1/cancela_nfse_test.rb +69 -3
- data/test/br_nfe/service/thema/v1/consulta_lote_rps_test.rb +134 -4
- data/test/br_nfe/service/thema/v1/consulta_nfs_por_rps_test.rb +131 -4
- data/test/br_nfe/service/thema/v1/consulta_nfse_test.rb +214 -4
- data/test/br_nfe/service/thema/v1/consulta_situacao_lote_rps_test.rb +97 -4
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_limitado_test.rb +109 -0
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test.rb +72 -4
- data/test/factories/service/rps.rb +17 -16
- data/test/factories/service/{sc/gaspar/recepcao_lote_rps_limitado.rb → simpliss/v1/base.rb} +1 -3
- data/test/factories/service/{sc/gaspar → simpliss/v1}/cancela_nfse.rb +2 -2
- data/test/factories/service/simpliss/v1/consulta_lote_rps.rb +7 -0
- data/test/factories/service/{sc/gaspar → simpliss/v1}/consulta_nfs_por_rps.rb +1 -1
- data/test/factories/service/{sc/gaspar → simpliss/v1}/consulta_nfse.rb +1 -1
- data/test/factories/service/simpliss/v1/consulta_situacao_lote_rps.rb +6 -0
- data/test/factories/service/{sc/gaspar → simpliss/v1}/recepcao_lote_rps.rb +1 -1
- data/test/fixtures/service/response/simpliss/v1/cancela_nfse/fault.xml +21 -0
- data/test/fixtures/service/response/simpliss/v1/cancela_nfse/success.xml +26 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/fault.xml +21 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_complete.xml +134 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_lote_rps/nfse_simple.xml +100 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfs_empty.xml +10 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_complete.xml +134 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse/nfse_simple.xml +100 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_complete.xml +132 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_nfse_por_rps/nfse_simple.xml +98 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/error.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/fault.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/success.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unprocessed.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/consulta_situacao_lote_rps/unreceived.xml +11 -0
- data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/error.xml +16 -0
- data/test/fixtures/service/response/simpliss/v1/recepcao_lote_rps/success.xml +12 -0
- data/test/fixtures/service/response/thema/v1/cancela_nfse/fault.xml +33 -0
- data/test/fixtures/service/response/thema/v1/cancela_nfse/success.xml +30 -0
- data/test/fixtures/service/response/thema/v1/consulta_lote_rps/fault.xml +19 -0
- data/test/fixtures/service/response/thema/v1/consulta_lote_rps/nfse_complete.xml +109 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/fault.xml +20 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfs_empty.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_complete.xml +111 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse/nfse_simple.xml +111 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/fault.xml +23 -0
- data/test/fixtures/service/response/thema/v1/consulta_nfse_por_rps/nfse_complete.xml +110 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/error.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/fault.xml +15 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/success.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unprocessed.xml +14 -0
- data/test/fixtures/service/response/thema/v1/consulta_situacao_lote_rps/unreceived.xml +19 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/error.xml +17 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps/success.xml +15 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/error.xml +19 -0
- data/test/fixtures/service/response/thema/v1/recepcao_lote_rps_limitado/success.xml +15 -0
- data/test/fixtures/service/thema/v1/cancelar_nfse_envio.xml +1 -0
- data/test/fixtures/service/thema/v1/cancelar_nfse_envio_signed.xml +2 -0
- data/test/fixtures/service/thema/v1/enviar_lote_rps.xml +1 -0
- data/test/fixtures/service/thema/v1/enviar_lote_rps_signed.xml +2 -0
- data/test/test_helper.rb +5 -0
- metadata +146 -37
- data/lib/br_nfe/service/sc/gaspar/cancela_nfse.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_nfs_por_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/consulta_nfse.rb +0 -17
- data/lib/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps.rb +0 -13
- data/lib/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado.rb +0 -13
- data/test/br_nfe/service/sc/gaspar/cancela_nfse_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_nfs_por_rps_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_nfse_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/consulta_situacao_lote_rps_test.rb +0 -21
- data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_limitado_test.rb +0 -22
- data/test/br_nfe/service/sc/gaspar/recepcao_lote_rps_test.rb +0 -22
- data/test/br_nfe/service/thema/v1/recepcao_lote_rps_test_limitado.rb +0 -50
- data/test/factories/service/sc/gaspar/consulta_lote_rps.rb +0 -7
- data/test/factories/service/sc/gaspar/consulta_situacao_lote_rps.rb +0 -6
@@ -0,0 +1,318 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE schema
|
3
|
+
PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd"
|
4
|
+
[
|
5
|
+
<!ATTLIST schema
|
6
|
+
xmlns:ds CDATA #FIXED "http://www.w3.org/2000/09/xmldsig#">
|
7
|
+
<!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'>
|
8
|
+
<!ENTITY % p ''>
|
9
|
+
<!ENTITY % s ''>
|
10
|
+
]>
|
11
|
+
|
12
|
+
<!-- Schema for XML Signatures
|
13
|
+
http://www.w3.org/2000/09/xmldsig#
|
14
|
+
$Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
|
15
|
+
|
16
|
+
Copyright 2001 The Internet Society and W3C (Massachusetts Institute
|
17
|
+
of Technology, Institut National de Recherche en Informatique et en
|
18
|
+
Automatique, Keio University). All Rights Reserved.
|
19
|
+
http://www.w3.org/Consortium/Legal/
|
20
|
+
|
21
|
+
This document is governed by the W3C Software License [1] as described
|
22
|
+
in the FAQ [2].
|
23
|
+
|
24
|
+
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
|
25
|
+
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
|
26
|
+
-->
|
27
|
+
|
28
|
+
|
29
|
+
<schema xmlns="http://www.w3.org/2001/XMLSchema"
|
30
|
+
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
|
31
|
+
targetNamespace="http://www.w3.org/2000/09/xmldsig#"
|
32
|
+
version="0.1" elementFormDefault="qualified">
|
33
|
+
|
34
|
+
<!-- Basic Types Defined for Signatures -->
|
35
|
+
|
36
|
+
<simpleType name="CryptoBinary">
|
37
|
+
<restriction base="base64Binary">
|
38
|
+
</restriction>
|
39
|
+
</simpleType>
|
40
|
+
|
41
|
+
<!-- Start Signature -->
|
42
|
+
|
43
|
+
<element name="Signature" type="ds:SignatureType"/>
|
44
|
+
<complexType name="SignatureType">
|
45
|
+
<sequence>
|
46
|
+
<element ref="ds:SignedInfo"/>
|
47
|
+
<element ref="ds:SignatureValue"/>
|
48
|
+
<element ref="ds:KeyInfo" minOccurs="0"/>
|
49
|
+
<element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
|
50
|
+
</sequence>
|
51
|
+
<attribute name="Id" type="ID" use="optional"/>
|
52
|
+
</complexType>
|
53
|
+
|
54
|
+
<element name="SignatureValue" type="ds:SignatureValueType"/>
|
55
|
+
<complexType name="SignatureValueType">
|
56
|
+
<simpleContent>
|
57
|
+
<extension base="base64Binary">
|
58
|
+
<attribute name="Id" type="ID" use="optional"/>
|
59
|
+
</extension>
|
60
|
+
</simpleContent>
|
61
|
+
</complexType>
|
62
|
+
|
63
|
+
<!-- Start SignedInfo -->
|
64
|
+
|
65
|
+
<element name="SignedInfo" type="ds:SignedInfoType"/>
|
66
|
+
<complexType name="SignedInfoType">
|
67
|
+
<sequence>
|
68
|
+
<element ref="ds:CanonicalizationMethod"/>
|
69
|
+
<element ref="ds:SignatureMethod"/>
|
70
|
+
<element ref="ds:Reference" maxOccurs="unbounded"/>
|
71
|
+
</sequence>
|
72
|
+
<attribute name="Id" type="ID" use="optional"/>
|
73
|
+
</complexType>
|
74
|
+
|
75
|
+
<element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
|
76
|
+
<complexType name="CanonicalizationMethodType" mixed="true">
|
77
|
+
<sequence>
|
78
|
+
<any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
|
79
|
+
<!-- (0,unbounded) elements from (1,1) namespace -->
|
80
|
+
</sequence>
|
81
|
+
<attribute name="Algorithm" type="anyURI" use="required"/>
|
82
|
+
</complexType>
|
83
|
+
|
84
|
+
<element name="SignatureMethod" type="ds:SignatureMethodType"/>
|
85
|
+
<complexType name="SignatureMethodType" mixed="true">
|
86
|
+
<sequence>
|
87
|
+
<element name="HMACOutputLength" minOccurs="0" type="ds:HMACOutputLengthType"/>
|
88
|
+
<any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
|
89
|
+
<!-- (0,unbounded) elements from (1,1) external namespace -->
|
90
|
+
</sequence>
|
91
|
+
<attribute name="Algorithm" type="anyURI" use="required"/>
|
92
|
+
</complexType>
|
93
|
+
|
94
|
+
<!-- Start Reference -->
|
95
|
+
|
96
|
+
<element name="Reference" type="ds:ReferenceType"/>
|
97
|
+
<complexType name="ReferenceType">
|
98
|
+
<sequence>
|
99
|
+
<element ref="ds:Transforms" minOccurs="0"/>
|
100
|
+
<element ref="ds:DigestMethod"/>
|
101
|
+
<element ref="ds:DigestValue"/>
|
102
|
+
</sequence>
|
103
|
+
<attribute name="Id" type="ID" use="optional"/>
|
104
|
+
<attribute name="URI" type="anyURI" use="optional"/>
|
105
|
+
<attribute name="Type" type="anyURI" use="optional"/>
|
106
|
+
</complexType>
|
107
|
+
|
108
|
+
<element name="Transforms" type="ds:TransformsType"/>
|
109
|
+
<complexType name="TransformsType">
|
110
|
+
<sequence>
|
111
|
+
<element ref="ds:Transform" maxOccurs="unbounded"/>
|
112
|
+
</sequence>
|
113
|
+
</complexType>
|
114
|
+
|
115
|
+
<element name="Transform" type="ds:TransformType"/>
|
116
|
+
<complexType name="TransformType" mixed="true">
|
117
|
+
<choice minOccurs="0" maxOccurs="unbounded">
|
118
|
+
<any namespace="##other" processContents="lax"/>
|
119
|
+
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
120
|
+
<element name="XPath" type="string"/>
|
121
|
+
</choice>
|
122
|
+
<attribute name="Algorithm" type="anyURI" use="required"/>
|
123
|
+
</complexType>
|
124
|
+
|
125
|
+
<!-- End Reference -->
|
126
|
+
|
127
|
+
<element name="DigestMethod" type="ds:DigestMethodType"/>
|
128
|
+
<complexType name="DigestMethodType" mixed="true">
|
129
|
+
<sequence>
|
130
|
+
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
|
131
|
+
</sequence>
|
132
|
+
<attribute name="Algorithm" type="anyURI" use="required"/>
|
133
|
+
</complexType>
|
134
|
+
|
135
|
+
<element name="DigestValue" type="ds:DigestValueType"/>
|
136
|
+
<simpleType name="DigestValueType">
|
137
|
+
<restriction base="base64Binary"/>
|
138
|
+
</simpleType>
|
139
|
+
|
140
|
+
<!-- End SignedInfo -->
|
141
|
+
|
142
|
+
<!-- Start KeyInfo -->
|
143
|
+
|
144
|
+
<element name="KeyInfo" type="ds:KeyInfoType"/>
|
145
|
+
<complexType name="KeyInfoType" mixed="true">
|
146
|
+
<choice maxOccurs="unbounded">
|
147
|
+
<element ref="ds:KeyName"/>
|
148
|
+
<element ref="ds:KeyValue"/>
|
149
|
+
<element ref="ds:RetrievalMethod"/>
|
150
|
+
<element ref="ds:X509Data"/>
|
151
|
+
<element ref="ds:PGPData"/>
|
152
|
+
<element ref="ds:SPKIData"/>
|
153
|
+
<element ref="ds:MgmtData"/>
|
154
|
+
<any processContents="lax" namespace="##other"/>
|
155
|
+
<!-- (1,1) elements from (0,unbounded) namespaces -->
|
156
|
+
</choice>
|
157
|
+
<attribute name="Id" type="ID" use="optional"/>
|
158
|
+
</complexType>
|
159
|
+
|
160
|
+
<element name="KeyName" type="string"/>
|
161
|
+
<element name="MgmtData" type="string"/>
|
162
|
+
|
163
|
+
<element name="KeyValue" type="ds:KeyValueType"/>
|
164
|
+
<complexType name="KeyValueType" mixed="true">
|
165
|
+
<choice>
|
166
|
+
<element ref="ds:DSAKeyValue"/>
|
167
|
+
<element ref="ds:RSAKeyValue"/>
|
168
|
+
<any namespace="##other" processContents="lax"/>
|
169
|
+
</choice>
|
170
|
+
</complexType>
|
171
|
+
|
172
|
+
<element name="RetrievalMethod" type="ds:RetrievalMethodType"/>
|
173
|
+
<complexType name="RetrievalMethodType">
|
174
|
+
<sequence>
|
175
|
+
<element ref="ds:Transforms" minOccurs="0"/>
|
176
|
+
</sequence>
|
177
|
+
<attribute name="URI" type="anyURI"/>
|
178
|
+
<attribute name="Type" type="anyURI" use="optional"/>
|
179
|
+
</complexType>
|
180
|
+
|
181
|
+
<!-- Start X509Data -->
|
182
|
+
|
183
|
+
<element name="X509Data" type="ds:X509DataType"/>
|
184
|
+
<complexType name="X509DataType">
|
185
|
+
<sequence maxOccurs="unbounded">
|
186
|
+
<choice>
|
187
|
+
<element name="X509IssuerSerial" type="ds:X509IssuerSerialType"/>
|
188
|
+
<element name="X509SKI" type="base64Binary"/>
|
189
|
+
<element name="X509SubjectName" type="string"/>
|
190
|
+
<element name="X509Certificate" type="base64Binary"/>
|
191
|
+
<element name="X509CRL" type="base64Binary"/>
|
192
|
+
<any namespace="##other" processContents="lax"/>
|
193
|
+
</choice>
|
194
|
+
</sequence>
|
195
|
+
</complexType>
|
196
|
+
|
197
|
+
<complexType name="X509IssuerSerialType">
|
198
|
+
<sequence>
|
199
|
+
<element name="X509IssuerName" type="string"/>
|
200
|
+
<element name="X509SerialNumber" type="integer"/>
|
201
|
+
</sequence>
|
202
|
+
</complexType>
|
203
|
+
|
204
|
+
<!-- End X509Data -->
|
205
|
+
|
206
|
+
<!-- Begin PGPData -->
|
207
|
+
|
208
|
+
<element name="PGPData" type="ds:PGPDataType"/>
|
209
|
+
<complexType name="PGPDataType">
|
210
|
+
<choice>
|
211
|
+
<sequence>
|
212
|
+
<element name="PGPKeyID" type="base64Binary"/>
|
213
|
+
<element name="PGPKeyPacket" type="base64Binary" minOccurs="0"/>
|
214
|
+
<any namespace="##other" processContents="lax" minOccurs="0"
|
215
|
+
maxOccurs="unbounded"/>
|
216
|
+
</sequence>
|
217
|
+
<sequence>
|
218
|
+
<element name="PGPKeyPacket" type="base64Binary"/>
|
219
|
+
<any namespace="##other" processContents="lax" minOccurs="0"
|
220
|
+
maxOccurs="unbounded"/>
|
221
|
+
</sequence>
|
222
|
+
</choice>
|
223
|
+
</complexType>
|
224
|
+
|
225
|
+
<!-- End PGPData -->
|
226
|
+
|
227
|
+
<!-- Begin SPKIData -->
|
228
|
+
|
229
|
+
<element name="SPKIData" type="ds:SPKIDataType"/>
|
230
|
+
<complexType name="SPKIDataType">
|
231
|
+
<sequence maxOccurs="unbounded">
|
232
|
+
<element name="SPKISexp" type="base64Binary"/>
|
233
|
+
<any namespace="##other" processContents="lax" minOccurs="0"/>
|
234
|
+
</sequence>
|
235
|
+
</complexType>
|
236
|
+
|
237
|
+
<!-- End SPKIData -->
|
238
|
+
|
239
|
+
<!-- End KeyInfo -->
|
240
|
+
|
241
|
+
<!-- Start Object (Manifest, SignatureProperty) -->
|
242
|
+
|
243
|
+
<element name="Object" type="ds:ObjectType"/>
|
244
|
+
<complexType name="ObjectType" mixed="true">
|
245
|
+
<sequence minOccurs="0" maxOccurs="unbounded">
|
246
|
+
<any namespace="##any" processContents="lax"/>
|
247
|
+
</sequence>
|
248
|
+
<attribute name="Id" type="ID" use="optional"/>
|
249
|
+
<attribute name="MimeType" type="string" use="optional"/> <!-- add a grep facet -->
|
250
|
+
<attribute name="Encoding" type="anyURI" use="optional"/>
|
251
|
+
</complexType>
|
252
|
+
|
253
|
+
<element name="Manifest" type="ds:ManifestType"/>
|
254
|
+
<complexType name="ManifestType">
|
255
|
+
<sequence>
|
256
|
+
<element ref="ds:Reference" maxOccurs="unbounded"/>
|
257
|
+
</sequence>
|
258
|
+
<attribute name="Id" type="ID" use="optional"/>
|
259
|
+
</complexType>
|
260
|
+
|
261
|
+
<element name="SignatureProperties" type="ds:SignaturePropertiesType"/>
|
262
|
+
<complexType name="SignaturePropertiesType">
|
263
|
+
<sequence>
|
264
|
+
<element ref="ds:SignatureProperty" maxOccurs="unbounded"/>
|
265
|
+
</sequence>
|
266
|
+
<attribute name="Id" type="ID" use="optional"/>
|
267
|
+
</complexType>
|
268
|
+
|
269
|
+
<element name="SignatureProperty" type="ds:SignaturePropertyType"/>
|
270
|
+
<complexType name="SignaturePropertyType" mixed="true">
|
271
|
+
<choice maxOccurs="unbounded">
|
272
|
+
<any namespace="##other" processContents="lax"/>
|
273
|
+
<!-- (1,1) elements from (1,unbounded) namespaces -->
|
274
|
+
</choice>
|
275
|
+
<attribute name="Target" type="anyURI" use="required"/>
|
276
|
+
<attribute name="Id" type="ID" use="optional"/>
|
277
|
+
</complexType>
|
278
|
+
|
279
|
+
<!-- End Object (Manifest, SignatureProperty) -->
|
280
|
+
|
281
|
+
<!-- Start Algorithm Parameters -->
|
282
|
+
|
283
|
+
<simpleType name="HMACOutputLengthType">
|
284
|
+
<restriction base="integer"/>
|
285
|
+
</simpleType>
|
286
|
+
|
287
|
+
<!-- Start KeyValue Element-types -->
|
288
|
+
|
289
|
+
<element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
|
290
|
+
<complexType name="DSAKeyValueType">
|
291
|
+
<sequence>
|
292
|
+
<sequence minOccurs="0">
|
293
|
+
<element name="P" type="ds:CryptoBinary"/>
|
294
|
+
<element name="Q" type="ds:CryptoBinary"/>
|
295
|
+
</sequence>
|
296
|
+
<element name="G" type="ds:CryptoBinary" minOccurs="0"/>
|
297
|
+
<element name="Y" type="ds:CryptoBinary"/>
|
298
|
+
<element name="J" type="ds:CryptoBinary" minOccurs="0"/>
|
299
|
+
<sequence minOccurs="0">
|
300
|
+
<element name="Seed" type="ds:CryptoBinary"/>
|
301
|
+
<element name="PgenCounter" type="ds:CryptoBinary"/>
|
302
|
+
</sequence>
|
303
|
+
</sequence>
|
304
|
+
</complexType>
|
305
|
+
|
306
|
+
<element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
|
307
|
+
<complexType name="RSAKeyValueType">
|
308
|
+
<sequence>
|
309
|
+
<element name="Modulus" type="ds:CryptoBinary"/>
|
310
|
+
<element name="Exponent" type="ds:CryptoBinary"/>
|
311
|
+
</sequence>
|
312
|
+
</complexType>
|
313
|
+
|
314
|
+
<!-- End KeyValue Element-types -->
|
315
|
+
|
316
|
+
<!-- End Signature -->
|
317
|
+
|
318
|
+
</schema>
|
@@ -20,6 +20,12 @@ describe BrNfe::Service::Thema::V1::Base do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
describe "#signature_type" do
|
24
|
+
it "seve realizar as assinaturas pela gem signer" do
|
25
|
+
subject.signature_type.must_equal :method_sign
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
23
29
|
describe "#soap_namespaces" do
|
24
30
|
it "deve conter os namespaces padrões mais o namespace da mensagem" do
|
25
31
|
subject.soap_namespaces.must_equal({
|
@@ -32,8 +38,10 @@ describe BrNfe::Service::Thema::V1::Base do
|
|
32
38
|
end
|
33
39
|
end
|
34
40
|
|
35
|
-
describe "#
|
36
|
-
it
|
41
|
+
describe "#namespaces" do
|
42
|
+
it '-> namespace_identifier' do subject.namespace_identifier.must_be_nil end
|
43
|
+
it '-> namespace_for_tags' do subject.namespace_for_tags.must_be_nil end
|
44
|
+
it '-> namespace_for_signature' do subject.namespace_for_signature.must_be_nil end
|
37
45
|
end
|
38
46
|
|
39
47
|
describe "#soap_body_root_tag" do
|
@@ -60,6 +68,19 @@ describe BrNfe::Service::Thema::V1::Base do
|
|
60
68
|
subject.expects(:xml_builder).returns('<xml>Builder</xml>')
|
61
69
|
subject.content_xml.must_equal expected_xml
|
62
70
|
end
|
71
|
+
|
72
|
+
it "Caso o xml_builder já vier com a tag <?xml não deve inserir a tag novamnete" do
|
73
|
+
subject.expects(:soap_body_root_tag).returns('rootTag').twice
|
74
|
+
subject.expects(:xml_builder).returns('<?xml version="1.0" encoding="ISO-8859-1"?><xml>Builder</xml>')
|
75
|
+
subject.content_xml.must_equal expected_xml
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe '#ts_aliquota' do
|
80
|
+
it "sempre deve pegar o valor do parâmetro e dividir por 100" do
|
81
|
+
subject.ts_aliquota(35.75).must_equal 0.3575
|
82
|
+
|
83
|
+
end
|
63
84
|
end
|
64
85
|
|
65
86
|
end
|
@@ -16,10 +16,25 @@ describe BrNfe::Service::Thema::V1::CancelaNfse do
|
|
16
16
|
it { subject.method_wsdl.must_equal :cancelar_nfse }
|
17
17
|
end
|
18
18
|
|
19
|
-
describe "#
|
20
|
-
it "
|
21
|
-
subject.
|
19
|
+
describe "#wsdl" do
|
20
|
+
it "default" do
|
21
|
+
subject.ibge_code_of_issuer_city = '111'
|
22
|
+
subject.env = :production
|
23
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl'
|
24
|
+
subject.env = :test
|
25
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl'
|
22
26
|
end
|
27
|
+
describe 'Para a cidade 4205902 - Gaspar-SC' do
|
28
|
+
before { subject.ibge_code_of_issuer_city = '4205902' }
|
29
|
+
it "ambiente de produção" do
|
30
|
+
subject.env = :production
|
31
|
+
subject.wsdl.must_equal 'http://nfse.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl'
|
32
|
+
end
|
33
|
+
it "ambiente de testes" do
|
34
|
+
subject.env = :test
|
35
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEcancelamento?wsdl'
|
36
|
+
end
|
37
|
+
end
|
23
38
|
end
|
24
39
|
|
25
40
|
it "#response_root_path" do
|
@@ -53,4 +68,55 @@ describe BrNfe::Service::Thema::V1::CancelaNfse do
|
|
53
68
|
end
|
54
69
|
end
|
55
70
|
|
71
|
+
describe "#request and set response" do
|
72
|
+
before { savon.mock! }
|
73
|
+
after { savon.unmock! }
|
74
|
+
|
75
|
+
it "Quando cancelou a NF com sucesso" do
|
76
|
+
fixture = File.read(BrNfe.root+'/test/fixtures/service/response/thema/v1/cancela_nfse/success.xml')
|
77
|
+
|
78
|
+
savon.expects(:cancelar_nfse).returns(fixture)
|
79
|
+
subject.request
|
80
|
+
response = subject.response
|
81
|
+
|
82
|
+
response.cancelation_date_time.must_equal Time.parse('2016-08-15T13:50:31.016Z')
|
83
|
+
response.status.must_equal :success
|
84
|
+
response.successful_request?.must_equal true
|
85
|
+
end
|
86
|
+
|
87
|
+
it "Quando a requisição voltar com erro deve setar os erros corretamente" do
|
88
|
+
fixture = File.read(BrNfe.root+'/test/fixtures/service/response/thema/v1/cancela_nfse/fault.xml')
|
89
|
+
|
90
|
+
savon.expects(:cancelar_nfse).returns(fixture)
|
91
|
+
subject.request
|
92
|
+
response = subject.response
|
93
|
+
|
94
|
+
response.protocolo.must_be_nil
|
95
|
+
response.data_recebimento.must_be_nil
|
96
|
+
response.numero_lote.must_be_nil
|
97
|
+
response.cancelation_date_time.must_be_nil
|
98
|
+
|
99
|
+
response.status.must_equal :falied
|
100
|
+
|
101
|
+
response.error_messages.size.must_equal 1
|
102
|
+
response.error_messages[0][:code].must_equal 'E505'
|
103
|
+
response.error_messages[0][:message].must_equal 'E505-Código da Cancelamento Não existe na tabela de erros e alertas'
|
104
|
+
response.error_messages[0][:solution].must_be_nil
|
105
|
+
response.successful_request?.must_equal true
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "#xml_builder deve assinar o cancelamento corretamente" do
|
110
|
+
it "deve retornar o XMl assinado e comparar com um template testado" do
|
111
|
+
xml_sem_assinatura = File.read("#{BrNfe.root}/test/fixtures/service/thema/v1/cancelar_nfse_envio.xml")
|
112
|
+
xml_assinado = File.read("#{BrNfe.root}/test/fixtures/service/thema/v1/cancelar_nfse_envio_signed.xml")
|
113
|
+
|
114
|
+
subject.id_cancelamento = '5544'
|
115
|
+
|
116
|
+
subject.stubs(:render_xml).with('servico_cancelar_nfse_envio').returns(xml_sem_assinatura)
|
117
|
+
|
118
|
+
subject.xml_builder.must_equal xml_assinado
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
56
122
|
end
|
@@ -14,10 +14,6 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
|
|
14
14
|
it { subject.method_wsdl.must_equal :consultar_lote_rps }
|
15
15
|
end
|
16
16
|
|
17
|
-
it "#response_path_module" do
|
18
|
-
subject.response_path_module.must_equal BrNfe::Service::Response::Paths::V1::ServicoConsultarLoteRpsResposta
|
19
|
-
end
|
20
|
-
|
21
17
|
it "#response_root_path" do
|
22
18
|
subject.response_root_path.must_equal []
|
23
19
|
end
|
@@ -29,6 +25,27 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
|
|
29
25
|
it "#soap_body_root_tag" do
|
30
26
|
subject.soap_body_root_tag.must_equal 'consultarLoteRps'
|
31
27
|
end
|
28
|
+
|
29
|
+
describe "#wsdl" do
|
30
|
+
it "default" do
|
31
|
+
subject.ibge_code_of_issuer_city = '111'
|
32
|
+
subject.env = :production
|
33
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl'
|
34
|
+
subject.env = :test
|
35
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl'
|
36
|
+
end
|
37
|
+
describe 'Para a cidade 4205902 - Gaspar-SC' do
|
38
|
+
before { subject.ibge_code_of_issuer_city = '4205902' }
|
39
|
+
it "ambiente de produção" do
|
40
|
+
subject.env = :production
|
41
|
+
subject.wsdl.must_equal 'http://nfse.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl'
|
42
|
+
end
|
43
|
+
it "ambiente de testes" do
|
44
|
+
subject.env = :test
|
45
|
+
subject.wsdl.must_equal 'http://nfsehml.gaspar.sc.gov.br/nfse/services/NFSEconsulta?wsdl'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
32
49
|
|
33
50
|
describe "Validação do XML através do XSD" do
|
34
51
|
let(:schemas_dir) { BrNfe.root+'/test/br_nfe/service/thema/v1/xsd' }
|
@@ -44,4 +61,117 @@ describe BrNfe::Service::Thema::V1::ConsultaLoteRps do
|
|
44
61
|
end
|
45
62
|
end
|
46
63
|
end
|
64
|
+
|
65
|
+
describe "#request and set response" do
|
66
|
+
before { savon.mock! }
|
67
|
+
after { savon.unmock! }
|
68
|
+
|
69
|
+
it "Quando a requisição voltar com erro deve setar os erros corretamente" do
|
70
|
+
fixture = File.read(BrNfe.root+'/test/fixtures/service/response/thema/v1/consulta_lote_rps/fault.xml')
|
71
|
+
|
72
|
+
savon.expects(:consultar_lote_rps).returns(fixture)
|
73
|
+
subject.request
|
74
|
+
response = subject.response
|
75
|
+
|
76
|
+
response.protocolo.must_be_nil
|
77
|
+
response.data_recebimento.must_be_nil
|
78
|
+
response.numero_lote.must_be_nil
|
79
|
+
response.status.must_equal :falied
|
80
|
+
response.error_messages.size.must_equal 1
|
81
|
+
response.error_messages[0][:code].must_equal 'E86'
|
82
|
+
response.error_messages[0][:message].must_equal 'Número do protocolo de recebimento do lote inexistente na base de dados'
|
83
|
+
response.error_messages[0][:solution].must_equal 'Confira se o lote foi enviado e informe o número correto do protocolo de recebimento.'
|
84
|
+
response.successful_request?.must_equal true
|
85
|
+
end
|
86
|
+
|
87
|
+
it "Quando encontrar uma nota fiscal com as informações completas" do
|
88
|
+
fixture = File.read(BrNfe.root+'/test/fixtures/service/response/thema/v1/consulta_lote_rps/nfse_complete.xml')
|
89
|
+
savon.expects(:consultar_lote_rps).returns(fixture)
|
90
|
+
subject.request
|
91
|
+
response = subject.response
|
92
|
+
|
93
|
+
nf = response.notas_fiscais[0]
|
94
|
+
nf.numero_nf.must_equal '201600000000003'
|
95
|
+
nf.codigo_verificacao.must_equal '1004156850'
|
96
|
+
nf.data_emissao.must_equal DateTime.parse('2016-08-12T20:02:36.000Z')
|
97
|
+
nf.url_nf.must_be_nil
|
98
|
+
nf.xml_nf[0..89].must_equal '<ConsultarLoteRpsResposta xmlns="http://www.abrasf.org.br/ABRASF/arquivos/nfse.xsd"><Lista'
|
99
|
+
nf.rps_numero.must_equal '15'
|
100
|
+
nf.rps_serie.must_equal 'SN'
|
101
|
+
nf.rps_tipo.must_equal '1'
|
102
|
+
nf.rps_situacao.must_be_nil
|
103
|
+
nf.rps_substituido_numero.must_be_nil
|
104
|
+
nf.rps_substituido_serie.must_be_nil
|
105
|
+
nf.rps_substituido_tipo.must_be_nil
|
106
|
+
nf.data_emissao_rps.must_equal Date.parse('2016-08-12Z')
|
107
|
+
nf.competencia.must_equal DateTime.parse('2016-08-12T00:00:00.000Z')
|
108
|
+
nf.natureza_operacao.must_equal '59'
|
109
|
+
nf.regime_especial_tributacao.must_equal '1'
|
110
|
+
nf.optante_simples_nacional.must_equal '1'
|
111
|
+
nf.incentivador_cultural.must_equal '0'
|
112
|
+
nf.outras_informacoes.must_be_nil
|
113
|
+
nf.item_lista_servico.must_equal '107'
|
114
|
+
nf.cnae_code.must_equal '6202300'
|
115
|
+
nf.description.must_equal '1 TESTE WEBSERVICE: R$ 5,00'
|
116
|
+
nf.codigo_municipio.must_equal '4204202'
|
117
|
+
nf.total_services.must_equal '1700'
|
118
|
+
nf.iss_retained.must_equal '2'
|
119
|
+
nf.total_iss.must_equal '33.72'
|
120
|
+
nf.base_calculation.must_equal '1685.88'
|
121
|
+
nf.iss_tax_rate.must_equal '0.02'
|
122
|
+
nf.valor_liquido.must_equal '1663.02'
|
123
|
+
nf.deductions.must_equal '7'
|
124
|
+
nf.valor_pis.must_equal '1.12'
|
125
|
+
nf.valor_cofins.must_equal '2.12'
|
126
|
+
nf.valor_inss.must_equal '3.12'
|
127
|
+
nf.valor_ir.must_equal '4.12'
|
128
|
+
nf.valor_csll.must_equal '5.12'
|
129
|
+
nf.outras_retencoes.must_equal '6.12'
|
130
|
+
nf.desconto_condicionado.must_equal '8.12'
|
131
|
+
nf.desconto_incondicionado.must_equal '7.12'
|
132
|
+
nf.responsavel_retencao.must_be_nil
|
133
|
+
nf.numero_processo.must_be_nil
|
134
|
+
nf.orgao_gerador_municipio.must_equal '4205902'
|
135
|
+
nf.orgao_gerador_uf.must_equal 'SC'
|
136
|
+
nf.cancelamento_codigo.must_be_nil
|
137
|
+
nf.cancelamento_numero_nf.must_be_nil
|
138
|
+
nf.cancelamento_cnpj.must_be_nil
|
139
|
+
nf.cancelamento_inscricao_municipal.must_be_nil
|
140
|
+
nf.cancelamento_municipio.must_be_nil
|
141
|
+
nf.cancelamento_data_hora.must_be_nil
|
142
|
+
nf.cancelamento_sucesso.must_equal false
|
143
|
+
nf.nfe_substituidora.must_be_nil
|
144
|
+
|
145
|
+
nf.emitente.cnpj.must_equal '65978078000120'
|
146
|
+
nf.emitente.inscricao_municipal.must_equal '11849'
|
147
|
+
nf.emitente.razao_social.must_equal 'EMPRESA EMITENTE LTDA'
|
148
|
+
nf.emitente.nome_fantasia.must_equal 'EMITENTE'
|
149
|
+
nf.emitente.telefone.must_equal '3326891'
|
150
|
+
nf.emitente.email.must_equal 'emitente@gmail.com'
|
151
|
+
|
152
|
+
nf.emitente.endereco.logradouro.must_equal 'DOUGLAS ALEXANDRE'
|
153
|
+
nf.emitente.endereco.numero.must_equal '50'
|
154
|
+
nf.emitente.endereco.complemento.must_equal ''
|
155
|
+
nf.emitente.endereco.bairro.must_equal 'CENTRO'
|
156
|
+
nf.emitente.endereco.codigo_municipio.must_equal '4205902'
|
157
|
+
nf.emitente.endereco.uf.must_equal 'SC'
|
158
|
+
nf.emitente.endereco.cep.must_equal '89110000'
|
159
|
+
|
160
|
+
nf.destinatario.cpf_cnpj.must_equal '08670364000'
|
161
|
+
nf.destinatario.inscricao_municipal.must_be_nil
|
162
|
+
nf.destinatario.inscricao_estadual.must_be_nil
|
163
|
+
nf.destinatario.inscricao_suframa.must_be_nil
|
164
|
+
nf.destinatario.razao_social.must_equal 'BRUNO MUCELINI MERGEN'
|
165
|
+
nf.destinatario.telefone.must_equal '4920493900'
|
166
|
+
nf.destinatario.email.must_equal 'brunomergen@gmail.com'
|
167
|
+
|
168
|
+
nf.destinatario.endereco.logradouro.must_equal 'RUA IGUACU E'
|
169
|
+
nf.destinatario.endereco.numero.must_equal '587'
|
170
|
+
nf.destinatario.endereco.complemento.must_equal ''
|
171
|
+
nf.destinatario.endereco.bairro.must_equal 'SAIC'
|
172
|
+
nf.destinatario.endereco.codigo_municipio.must_equal '4204202'
|
173
|
+
nf.destinatario.endereco.uf.must_equal 'SC'
|
174
|
+
nf.destinatario.endereco.cep.must_equal '89802171'
|
175
|
+
end
|
176
|
+
end
|
47
177
|
end
|