br_danfe 0.15.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -8
- data/.github/dependabot.yml +19 -0
- data/.rubocop.yml +24 -11
- data/.tool-versions +1 -0
- data/Gemfile.lock +69 -50
- data/Guardfile +4 -2
- data/README.md +23 -0
- data/bin/_guard-core +29 -0
- data/bin/guard +29 -0
- data/br_danfe.gemspec +9 -7
- data/lib/br_danfe/danfe_lib/nfce.rb +11 -9
- data/lib/br_danfe/danfe_lib/nfce_lib/document.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfce_lib/footer.rb +2 -2
- data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +30 -16
- data/lib/br_danfe/danfe_lib/nfce_lib/key.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfce_lib/product_list.rb +44 -53
- data/lib/br_danfe/danfe_lib/nfce_lib/recipient.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfce_lib/total_list.rb +16 -15
- data/lib/br_danfe/danfe_lib/nfe.rb +11 -9
- data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +1 -2
- data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +5 -6
- data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +2 -1
- data/lib/br_danfe/document_builder.rb +1 -1
- data/lib/br_danfe/helper.rb +8 -10
- data/lib/br_danfe/mdfe.rb +55 -0
- data/lib/br_danfe/mdfe_lib/authorization_protocol.rb +24 -0
- data/lib/br_danfe/mdfe_lib/document.rb +26 -0
- data/lib/br_danfe/mdfe_lib/drivers.rb +70 -0
- data/lib/br_danfe/mdfe_lib/fisco_control.rb +21 -0
- data/lib/br_danfe/mdfe_lib/header.rb +77 -0
- data/lib/br_danfe/mdfe_lib/mdfe_identification.rb +69 -0
- data/lib/br_danfe/mdfe_lib/notes.rb +94 -0
- data/lib/br_danfe/mdfe_lib/totalizer.rb +57 -0
- data/lib/br_danfe/mdfe_lib/vehicles.rb +80 -0
- data/lib/br_danfe/qr_code.rb +21 -0
- data/lib/br_danfe/version.rb +1 -1
- data/lib/br_danfe.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/footer_spec.rb +3 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/header_spec.rb +6 -4
- data/spec/br_danfe/danfe_lib/nfce_lib/helper_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/recipient_spec.rb +10 -10
- data/spec/br_danfe/danfe_lib/nfce_lib/total_list_spec.rb +12 -12
- data/spec/br_danfe/danfe_lib/nfce_spec.rb +2 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/cst_spec.rb +4 -4
- data/spec/br_danfe/danfe_lib/nfe_lib/dest_spec.rb +178 -178
- data/spec/br_danfe/danfe_lib/nfe_lib/det_body_spec.rb +274 -274
- data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +77 -77
- data/spec/br_danfe/danfe_lib/nfe_lib/dup_spec.rb +23 -23
- data/spec/br_danfe/danfe_lib/nfe_lib/emit_header_spec.rb +37 -37
- data/spec/br_danfe/danfe_lib/nfe_lib/helper_spec.rb +34 -34
- data/spec/br_danfe/danfe_lib/nfe_lib/icmstot_spec.rb +19 -19
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_spec.rb +240 -240
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_vol_spec.rb +3 -2
- data/spec/br_danfe/danfe_lib/nfe_lib/issqn_spec.rb +16 -16
- data/spec/br_danfe/danfe_lib/nfe_lib/ticket_spec.rb +13 -13
- data/spec/br_danfe/danfe_lib/nfe_lib/transp_spec.rb +76 -76
- data/spec/br_danfe/danfe_lib/nfe_lib/vol_spec.rb +40 -40
- data/spec/br_danfe/danfe_lib/nfe_lib/xprod_spec.rb +118 -118
- data/spec/br_danfe/danfe_spec.rb +2 -2
- data/spec/br_danfe/helper_spec.rb +26 -14
- data/spec/br_danfe/mdfe_lib/authorization_protocol_spec.rb +35 -0
- data/spec/br_danfe/mdfe_lib/document_spec.rb +20 -0
- data/spec/br_danfe/mdfe_lib/drivers_spec.rb +88 -0
- data/spec/br_danfe/mdfe_lib/fisco_control_spec.rb +69 -0
- data/spec/br_danfe/mdfe_lib/header_spec.rb +135 -0
- data/spec/br_danfe/mdfe_lib/mdfe_identification_spec.rb +104 -0
- data/spec/br_danfe/mdfe_lib/notes_spec.rb +97 -0
- data/spec/br_danfe/mdfe_lib/totalizer_spec.rb +63 -0
- data/spec/br_danfe/mdfe_lib/vehicles_spec.rb +66 -0
- data/spec/br_danfe/mdfe_spec.rb +45 -0
- data/spec/br_danfe/qr_code_spec.rb +31 -0
- data/spec/br_danfe/xml_spec.rb +6 -6
- data/spec/fixtures/mdfe/lib/document#render.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.align.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.pad.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.simple.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.size.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.style.pdf +0 -0
- data/spec/fixtures/mdfe/lib/fisco_control#barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/fisco_control#without-barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-with_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/mdfe-with-multiple-pages.pdf +1945 -0
- data/spec/fixtures/mdfe/lib/mdfe.fixture.pdf +1286 -0
- data/spec/fixtures/mdfe/lib/notes#render-big-aditional-information.pdf +1943 -0
- data/spec/fixtures/mdfe/lib/xml-mdfe-multiples-pages.xml +116 -0
- data/spec/fixtures/mdfe/lib/xml-mdfe.xml +250 -0
- data/spec/fixtures/nfce/lib/document#render.pdf +12 -23
- data/spec/fixtures/nfce/lib/footer#render-with_additional_information.pdf +0 -0
- data/spec/fixtures/nfce/lib/footer#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-homologation.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/key#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/nfce_identification#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products_and_long_names.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product_and_long_name.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list_with_many_products_and_long_names.xml +2 -2
- data/spec/fixtures/nfce/lib/product_list_with_single_product_and_long_name.xml +1 -1
- data/spec/fixtures/nfce/lib/recipient#render-company.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-consumer_without_document.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-foreign.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-individual.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-unidentified_consumer.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#does_not_render-payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-grouped_payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-totals.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-without_payment.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf +568 -447
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-prod.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/rendered_nfce.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/saved_nfce.fixture.pdf +0 -0
- data/spec/fixtures/qr_code/qr_code#render.pdf +0 -0
- data/spec/spec_helper.rb +1 -1
- metadata +118 -48
- data/lib/br_danfe/danfe_lib/nfce_lib/qr_code.rb +0 -25
- data/lib/br_danfe/danfe_lib/nfe_lib/cep.rb +0 -11
- data/spec/br_danfe/danfe_lib/nfce_lib/qr_code_spec.rb +0 -35
- data/spec/br_danfe/danfe_lib/nfe_lib/cep_spec.rb +0 -10
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe BrDanfe::DanfeLib::NfeLib::Cst do
|
4
4
|
let(:xml_cst) do
|
5
|
-
xml =
|
5
|
+
xml = <<~XML
|
6
6
|
<imposto>
|
7
7
|
<ICMS>
|
8
8
|
<ICMS00>
|
@@ -15,13 +15,13 @@ describe BrDanfe::DanfeLib::NfeLib::Cst do
|
|
15
15
|
</ICMS00>
|
16
16
|
</ICMS>
|
17
17
|
</imposto>
|
18
|
-
|
18
|
+
XML
|
19
19
|
|
20
20
|
Nokogiri::XML(xml)
|
21
21
|
end
|
22
22
|
|
23
23
|
let(:xml_csosn) do
|
24
|
-
xml =
|
24
|
+
xml = <<~XML
|
25
25
|
<imposto>
|
26
26
|
<ICMS>
|
27
27
|
<ICMSSN102>
|
@@ -30,7 +30,7 @@ describe BrDanfe::DanfeLib::NfeLib::Cst do
|
|
30
30
|
</ICMSSN102>
|
31
31
|
</ICMS>
|
32
32
|
</imposto>
|
33
|
-
|
33
|
+
XML
|
34
34
|
|
35
35
|
Nokogiri::XML(xml)
|
36
36
|
end
|
@@ -16,39 +16,39 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
16
16
|
|
17
17
|
context "when nf-e's version is 2.00" do
|
18
18
|
let(:xml_as_string) do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
19
|
+
<<~XML
|
20
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
21
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
|
22
|
+
<ide>
|
23
|
+
<dEmi>2011-10-29</dEmi>
|
24
|
+
<dSaiEnt>2011-10-30</dSaiEnt>
|
25
|
+
<hSaiEnt>15:32:45</hSaiEnt>
|
26
|
+
</ide>
|
27
|
+
<dest>
|
28
|
+
<CNPJ>82743287000880</CNPJ>
|
29
|
+
<xNome>Schneider Electric Brasil Ltda</xNome>
|
30
|
+
<enderDest>
|
31
|
+
<xLgr>Av da Saudade</xLgr>
|
32
|
+
<nro>1125</nro>
|
33
|
+
<xBairro>Frutal</xBairro>
|
34
|
+
<xCpl>Sala 01 e 02</xCpl>
|
35
|
+
<cMun>3552403</cMun>
|
36
|
+
<xMun>SUMARE</xMun>
|
37
|
+
<UF>SP</UF>
|
38
|
+
<CEP>13171320</CEP>
|
39
|
+
<cPais>1058</cPais>
|
40
|
+
<xPais>BRASIL</xPais>
|
41
|
+
<fone>1921046300</fone>
|
42
|
+
</enderDest>
|
43
|
+
<IE>671008375110</IE>
|
44
|
+
</dest>
|
45
|
+
</infNFe>
|
46
|
+
</NFe>
|
47
|
+
XML
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'renders xml to the pdf' do
|
51
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
51
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
52
52
|
|
53
53
|
pdf.render_file path_of_expected_pdf
|
54
54
|
|
@@ -58,38 +58,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
58
58
|
|
59
59
|
context "when nf-e's version is 3.10" do
|
60
60
|
let(:xml_as_string) do
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
61
|
+
<<~XML
|
62
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
63
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
64
|
+
<ide>
|
65
|
+
<dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
|
66
|
+
<dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
|
67
|
+
</ide>
|
68
|
+
<dest>
|
69
|
+
<CNPJ>82743287000880</CNPJ>
|
70
|
+
<xNome>Schneider Electric Brasil Ltda</xNome>
|
71
|
+
<enderDest>
|
72
|
+
<xLgr>Av da Saudade</xLgr>
|
73
|
+
<nro>1125</nro>
|
74
|
+
<xBairro>Frutal</xBairro>
|
75
|
+
<xCpl>Sala 01 e 02</xCpl>
|
76
|
+
<cMun>3552403</cMun>
|
77
|
+
<xMun>SUMARE</xMun>
|
78
|
+
<UF>SP</UF>
|
79
|
+
<CEP>13171320</CEP>
|
80
|
+
<cPais>1058</cPais>
|
81
|
+
<xPais>BRASIL</xPais>
|
82
|
+
<fone>1921046300</fone>
|
83
|
+
</enderDest>
|
84
|
+
<IE>671008375110</IE>
|
85
|
+
</dest>
|
86
|
+
</infNFe>
|
87
|
+
</NFe>
|
88
|
+
XML
|
89
89
|
end
|
90
90
|
|
91
91
|
it 'renders xml to the pdf' do
|
92
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
92
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
93
93
|
|
94
94
|
pdf.render_file path_of_expected_pdf
|
95
95
|
|
@@ -99,38 +99,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
99
99
|
|
100
100
|
context "when nf-e's version is 4.00" do
|
101
101
|
let(:xml_as_string) do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
102
|
+
<<~XML
|
103
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
104
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="4.00">
|
105
|
+
<ide>
|
106
|
+
<dhEmi>2018-07-30T13:30:59+00:00</dhEmi>
|
107
|
+
<dhSaiEnt>2018-07-30T14:32:45-03:00</dhSaiEnt>
|
108
|
+
</ide>
|
109
|
+
<dest>
|
110
|
+
<CNPJ>82743287000880</CNPJ>
|
111
|
+
<xNome>Schneider Electric Brasil Ltda</xNome>
|
112
|
+
<enderDest>
|
113
|
+
<xLgr>Av da Saudade</xLgr>
|
114
|
+
<nro>1125</nro>
|
115
|
+
<xBairro>Frutal</xBairro>
|
116
|
+
<xCpl>Sala 01 e 02</xCpl>
|
117
|
+
<cMun>3552403</cMun>
|
118
|
+
<xMun>SUMARE</xMun>
|
119
|
+
<UF>SP</UF>
|
120
|
+
<CEP>13171320</CEP>
|
121
|
+
<cPais>1058</cPais>
|
122
|
+
<xPais>BRASIL</xPais>
|
123
|
+
<fone>1921046300</fone>
|
124
|
+
</enderDest>
|
125
|
+
<IE>671008375110</IE>
|
126
|
+
</dest>
|
127
|
+
</infNFe>
|
128
|
+
</NFe>
|
129
|
+
XML
|
130
130
|
end
|
131
131
|
|
132
132
|
it 'renders xml to the pdf' do
|
133
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
133
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
134
134
|
|
135
135
|
pdf.render_file path_of_expected_pdf
|
136
136
|
|
@@ -140,19 +140,19 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
140
140
|
|
141
141
|
context 'when recipient has CNPJ' do
|
142
142
|
let(:xml_as_string) do
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
143
|
+
<<~XML
|
144
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
145
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
146
|
+
<dest>
|
147
|
+
<CNPJ>71058884000183</CNPJ>
|
148
|
+
</dest>
|
149
|
+
</infNFe>
|
150
|
+
</NFe>
|
151
|
+
XML
|
152
152
|
end
|
153
153
|
|
154
154
|
it 'renders xml to the pdf' do
|
155
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
155
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
156
156
|
|
157
157
|
pdf.render_file path_of_expected_pdf
|
158
158
|
|
@@ -162,19 +162,19 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
162
162
|
|
163
163
|
context 'when recipient has CPF' do
|
164
164
|
let(:xml_as_string) do
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
165
|
+
<<~XML
|
166
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
167
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
168
|
+
<dest>
|
169
|
+
<CPF>48532557457</CPF>
|
170
|
+
</dest>
|
171
|
+
</infNFe>
|
172
|
+
</NFe>
|
173
|
+
XML
|
174
174
|
end
|
175
175
|
|
176
176
|
it 'renders xml to the pdf' do
|
177
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
177
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
178
178
|
|
179
179
|
pdf.render_file path_of_expected_pdf
|
180
180
|
|
@@ -184,22 +184,22 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
184
184
|
|
185
185
|
context 'when recipient has IE' do
|
186
186
|
let(:xml_as_string) do
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
187
|
+
<<~XML
|
188
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
189
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
190
|
+
<dest>
|
191
|
+
<enderDest>
|
192
|
+
<UF>SP</UF>
|
193
|
+
</enderDest>
|
194
|
+
<IE>671008375110</IE>
|
195
|
+
</dest>
|
196
|
+
</infNFe>
|
197
|
+
</NFe>
|
198
|
+
XML
|
199
199
|
end
|
200
200
|
|
201
201
|
it 'renders xml to the pdf' do
|
202
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
202
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
203
203
|
|
204
204
|
pdf.render_file path_of_expected_pdf
|
205
205
|
|
@@ -209,37 +209,37 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
209
209
|
|
210
210
|
context "when recipient doesn't have address complement" do
|
211
211
|
let(:xml_as_string) do
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
212
|
+
<<~XML
|
213
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
214
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
215
|
+
<ide>
|
216
|
+
<dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
|
217
|
+
<dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
|
218
|
+
</ide>
|
219
|
+
<dest>
|
220
|
+
<CNPJ>82743287000880</CNPJ>
|
221
|
+
<xNome>Schneider Electric Brasil Ltda</xNome>
|
222
|
+
<enderDest>
|
223
|
+
<xLgr>Av da Saudade</xLgr>
|
224
|
+
<nro>1125</nro>
|
225
|
+
<xBairro>Frutal</xBairro>
|
226
|
+
<cMun>3552403</cMun>
|
227
|
+
<xMun>SUMARE</xMun>
|
228
|
+
<UF>SP</UF>
|
229
|
+
<CEP>13171320</CEP>
|
230
|
+
<cPais>1058</cPais>
|
231
|
+
<xPais>BRASIL</xPais>
|
232
|
+
<fone>1921046300</fone>
|
233
|
+
</enderDest>
|
234
|
+
<IE>671008375110</IE>
|
235
|
+
</dest>
|
236
|
+
</infNFe>
|
237
|
+
</NFe>
|
238
|
+
XML
|
239
239
|
end
|
240
240
|
|
241
241
|
it 'renders xml to the pdf' do
|
242
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
242
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
243
243
|
|
244
244
|
pdf.render_file path_of_expected_pdf
|
245
245
|
|
@@ -250,38 +250,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
|
|
250
250
|
|
251
251
|
context 'when recipient address (xLgr + nro + xCpl) has more than 63 characters' do
|
252
252
|
let(:xml_as_string) do
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
253
|
+
<<~XML
|
254
|
+
<NFe xmlns="http://www.portalfiscal.inf.br/nfe">
|
255
|
+
<infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
|
256
|
+
<ide>
|
257
|
+
<dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
|
258
|
+
<dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
|
259
|
+
</ide>
|
260
|
+
<dest>
|
261
|
+
<CNPJ>82743287000880</CNPJ>
|
262
|
+
<xNome>Schneider Electric Brasil Ltda</xNome>
|
263
|
+
<enderDest>
|
264
|
+
<xLgr>Rua do governo do estado</xLgr>
|
265
|
+
<nro>1125</nro>
|
266
|
+
<xCpl>Em anexo ao super mercado maior do bairro</xCpl>
|
267
|
+
<xBairro>Frutal</xBairro>
|
268
|
+
<cMun>3552403</cMun>
|
269
|
+
<xMun>SUMARE</xMun>
|
270
|
+
<UF>SP</UF>
|
271
|
+
<CEP>13171320</CEP>
|
272
|
+
<cPais>1058</cPais>
|
273
|
+
<xPais>BRASIL</xPais>
|
274
|
+
<fone>1921046300</fone>
|
275
|
+
</enderDest>
|
276
|
+
<IE>671008375110</IE>
|
277
|
+
</dest>
|
278
|
+
</infNFe>
|
279
|
+
</NFe>
|
280
|
+
XML
|
281
281
|
end
|
282
282
|
|
283
283
|
it 'renders xml to pdf discarding the address of after 63 characters' do
|
284
|
-
expect(File.exist?(path_of_expected_pdf)).to
|
284
|
+
expect(File.exist?(path_of_expected_pdf)).to be false
|
285
285
|
|
286
286
|
pdf.render_file path_of_expected_pdf
|
287
287
|
|