br_danfe 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/br_danfe.gemspec +3 -1
  4. data/circle.yml +5 -0
  5. data/config/locales/pt-BR.yml +4 -3
  6. data/lib/br_danfe/danfe.rb +2 -2
  7. data/lib/br_danfe/dest.rb +12 -22
  8. data/lib/br_danfe/det_header.rb +1 -2
  9. data/lib/br_danfe/document.rb +34 -9
  10. data/lib/br_danfe/emit.rb +8 -18
  11. data/lib/br_danfe/issqn.rb +3 -3
  12. data/lib/br_danfe/ticket.rb +10 -5
  13. data/lib/br_danfe/transp.rb +17 -4
  14. data/lib/br_danfe/version.rb +1 -1
  15. data/lib/br_danfe/xprod.rb +4 -4
  16. data/lib/br_danfe.rb +1 -0
  17. data/spec/features/br_danfe_spec.rb +2 -19
  18. data/spec/fixtures/lib/dest#render-with_cnpj.pdf +201 -0
  19. data/spec/fixtures/lib/dest#render-with_cpf.pdf +201 -0
  20. data/spec/fixtures/lib/dest#render-with_ie.pdf +208 -0
  21. data/spec/fixtures/lib/det_body#render-csosn.pdf +855 -0
  22. data/spec/fixtures/lib/det_body#render-cst.pdf +512 -0
  23. data/spec/fixtures/lib/det_body#render-fci.pdf +260 -0
  24. data/spec/fixtures/lib/det_body#render-icms_st.pdf +267 -0
  25. data/spec/fixtures/lib/det_header#render.pdf +207 -0
  26. data/spec/fixtures/lib/document#lcnpj-blank.pdf +74 -0
  27. data/spec/fixtures/lib/document#lcnpj-invalid.pdf +74 -0
  28. data/spec/fixtures/lib/document#lcnpj-valid.pdf +81 -0
  29. data/spec/fixtures/lib/document#lie-blank.pdf +74 -0
  30. data/spec/fixtures/lib/document#lie-invalid.pdf +74 -0
  31. data/spec/fixtures/lib/document#lie-valid.pdf +81 -0
  32. data/spec/fixtures/lib/dup#render.pdf +216 -0
  33. data/spec/fixtures/lib/emit#render.pdf +143 -0
  34. data/spec/fixtures/lib/emit_header#render-with_logo.pdf +712 -0
  35. data/spec/fixtures/lib/emit_header#render-without_logo.pdf +650 -0
  36. data/spec/fixtures/lib/icmstot#render.pdf +255 -0
  37. data/spec/fixtures/lib/infadic#render-extra_volume.pdf +295 -0
  38. data/spec/fixtures/lib/infadic#render.pdf +104 -0
  39. data/spec/fixtures/lib/issqn#render.pdf +143 -0
  40. data/spec/fixtures/lib/ticket#render.pdf +113 -0
  41. data/spec/fixtures/lib/transp#render.pdf +239 -0
  42. data/spec/fixtures/lib/vol#render.pdf +152 -0
  43. data/spec/fixtures/{v2.00/nfe_with_logo.xml.logo.png → logo.png} +0 -0
  44. data/spec/fixtures/v2.00/nfe_simples_nacional.xml.fixture.pdf +14 -14
  45. data/spec/fixtures/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +29 -43
  46. data/spec/fixtures/v2.00/nfe_with_fci.xml.fixture.pdf +12 -12
  47. data/spec/fixtures/v2.00/nfe_with_logo.xml.fixture.pdf +16 -16
  48. data/spec/fixtures/v2.00/nfe_with_ns.xml.fixture.pdf +29 -43
  49. data/spec/fixtures/v2.00/nfe_without_ns.xml.fixture.pdf +13 -27
  50. data/spec/fixtures/v3.10/nfe_simples_nacional.xml.fixture.pdf +23 -23
  51. data/spec/lib/dest_spec.rb +69 -0
  52. data/spec/lib/det_body_spec.rb +299 -0
  53. data/spec/lib/det_header_spec.rb +26 -0
  54. data/spec/lib/document_spec.rb +172 -0
  55. data/spec/lib/dup_spec.rb +52 -0
  56. data/spec/lib/emit_header_spec.rb +76 -0
  57. data/spec/lib/emit_spec.rb +54 -0
  58. data/spec/lib/icmstot_spec.rb +48 -0
  59. data/spec/lib/infadic_spec.rb +81 -0
  60. data/spec/lib/issqn_spec.rb +45 -0
  61. data/spec/lib/ticket_spec.rb +42 -0
  62. data/spec/lib/transp_spec.rb +51 -0
  63. data/spec/lib/vol_spec.rb +65 -0
  64. data/spec/lib/xprod_spec.rb +2 -2
  65. metadata +96 -12
  66. data/spec/fixtures/v2.00/nfe_with_cpf.xml +0 -1
  67. data/spec/fixtures/v2.00/nfe_with_cpf.xml.fixture.pdf +0 -1871
@@ -57,7 +57,7 @@ describe BrDanfe::Xprod do
57
57
  it "returns product + ST" do
58
58
  expected = "MONITOR DE ARCO ELETRICO"
59
59
  expected += "\n"
60
- expected += "ST: MVA: 56.00% * Alíq: 17.00% * BC: 479.82 * Vlr: 29.28"
60
+ expected += "ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28"
61
61
 
62
62
  expect(subject.render).to eq expected
63
63
  end
@@ -123,7 +123,7 @@ describe BrDanfe::Xprod do
123
123
  expected += "\n"
124
124
  expected +="FCI: 12232531-74B2-4FDD-87A6-CF0AD3E55386"
125
125
  expected += "\n"
126
- expected += "ST: MVA: 56.00% * Alíq: 17.00% * BC: 479.82 * Vlr: 29.28"
126
+ expected += "ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28"
127
127
 
128
128
  expect(subject.render).to eq expected
129
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_danfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-17 00:00:00.000000000 Z
11
+ date: 2015-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -30,14 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: 1.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0
40
+ version: 1.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: prawn-table
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.2.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.2.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: barby
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -135,6 +149,7 @@ files:
135
149
  - README.md
136
150
  - Rakefile
137
151
  - br_danfe.gemspec
152
+ - circle.yml
138
153
  - config/locales/pt-BR.yml
139
154
  - lib/br_danfe.rb
140
155
  - lib/br_danfe/cep.rb
@@ -163,17 +178,40 @@ files:
163
178
  - spec/features/br_danfe_spec.rb
164
179
  - spec/fixtures/lib/dest#render-v2.00.pdf
165
180
  - spec/fixtures/lib/dest#render-v3.10.pdf
181
+ - spec/fixtures/lib/dest#render-with_cnpj.pdf
182
+ - spec/fixtures/lib/dest#render-with_cpf.pdf
183
+ - spec/fixtures/lib/dest#render-with_ie.pdf
184
+ - spec/fixtures/lib/det_body#render-csosn.pdf
185
+ - spec/fixtures/lib/det_body#render-cst.pdf
186
+ - spec/fixtures/lib/det_body#render-fci.pdf
187
+ - spec/fixtures/lib/det_body#render-icms_st.pdf
188
+ - spec/fixtures/lib/det_header#render.pdf
189
+ - spec/fixtures/lib/document#lcnpj-blank.pdf
190
+ - spec/fixtures/lib/document#lcnpj-invalid.pdf
191
+ - spec/fixtures/lib/document#lcnpj-valid.pdf
192
+ - spec/fixtures/lib/document#lie-blank.pdf
193
+ - spec/fixtures/lib/document#lie-invalid.pdf
194
+ - spec/fixtures/lib/document#lie-valid.pdf
195
+ - spec/fixtures/lib/dup#render.pdf
196
+ - spec/fixtures/lib/emit#render.pdf
197
+ - spec/fixtures/lib/emit_header#render-with_logo.pdf
198
+ - spec/fixtures/lib/emit_header#render-without_logo.pdf
199
+ - spec/fixtures/lib/icmstot#render.pdf
200
+ - spec/fixtures/lib/infadic#render-extra_volume.pdf
201
+ - spec/fixtures/lib/infadic#render.pdf
202
+ - spec/fixtures/lib/issqn#render.pdf
203
+ - spec/fixtures/lib/ticket#render.pdf
204
+ - spec/fixtures/lib/transp#render.pdf
205
+ - spec/fixtures/lib/vol#render.pdf
206
+ - spec/fixtures/logo.png
166
207
  - spec/fixtures/v2.00/nfe_simples_nacional.xml
167
208
  - spec/fixtures/v2.00/nfe_simples_nacional.xml.fixture.pdf
168
- - spec/fixtures/v2.00/nfe_with_cpf.xml
169
- - spec/fixtures/v2.00/nfe_with_cpf.xml.fixture.pdf
170
209
  - spec/fixtures/v2.00/nfe_with_extra_volumes.xml
171
210
  - spec/fixtures/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
172
211
  - spec/fixtures/v2.00/nfe_with_fci.xml
173
212
  - spec/fixtures/v2.00/nfe_with_fci.xml.fixture.pdf
174
213
  - spec/fixtures/v2.00/nfe_with_logo.xml
175
214
  - spec/fixtures/v2.00/nfe_with_logo.xml.fixture.pdf
176
- - spec/fixtures/v2.00/nfe_with_logo.xml.logo.png
177
215
  - spec/fixtures/v2.00/nfe_with_ns.xml
178
216
  - spec/fixtures/v2.00/nfe_with_ns.xml.fixture.pdf
179
217
  - spec/fixtures/v2.00/nfe_without_ns.xml
@@ -183,10 +221,22 @@ files:
183
221
  - spec/lib/cep_spec.rb
184
222
  - spec/lib/cst_spec.rb
185
223
  - spec/lib/dest_spec.rb
224
+ - spec/lib/det_body_spec.rb
225
+ - spec/lib/det_header_spec.rb
226
+ - spec/lib/document_spec.rb
227
+ - spec/lib/dup_spec.rb
228
+ - spec/lib/emit_header_spec.rb
229
+ - spec/lib/emit_spec.rb
186
230
  - spec/lib/helper_spec.rb
231
+ - spec/lib/icmstot_spec.rb
232
+ - spec/lib/infadic_spec.rb
233
+ - spec/lib/issqn_spec.rb
187
234
  - spec/lib/options_spec.rb
188
235
  - spec/lib/phone_spec.rb
189
236
  - spec/lib/plate_spec.rb
237
+ - spec/lib/ticket_spec.rb
238
+ - spec/lib/transp_spec.rb
239
+ - spec/lib/vol_spec.rb
190
240
  - spec/lib/xml_spec.rb
191
241
  - spec/lib/xprod_spec.rb
192
242
  - spec/spec_helper.rb
@@ -203,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
253
  requirements:
204
254
  - - '>='
205
255
  - !ruby/object:Gem::Version
206
- version: '0'
256
+ version: '2.0'
207
257
  required_rubygems_version: !ruby/object:Gem::Requirement
208
258
  requirements:
209
259
  - - '>='
@@ -219,17 +269,40 @@ test_files:
219
269
  - spec/features/br_danfe_spec.rb
220
270
  - spec/fixtures/lib/dest#render-v2.00.pdf
221
271
  - spec/fixtures/lib/dest#render-v3.10.pdf
272
+ - spec/fixtures/lib/dest#render-with_cnpj.pdf
273
+ - spec/fixtures/lib/dest#render-with_cpf.pdf
274
+ - spec/fixtures/lib/dest#render-with_ie.pdf
275
+ - spec/fixtures/lib/det_body#render-csosn.pdf
276
+ - spec/fixtures/lib/det_body#render-cst.pdf
277
+ - spec/fixtures/lib/det_body#render-fci.pdf
278
+ - spec/fixtures/lib/det_body#render-icms_st.pdf
279
+ - spec/fixtures/lib/det_header#render.pdf
280
+ - spec/fixtures/lib/document#lcnpj-blank.pdf
281
+ - spec/fixtures/lib/document#lcnpj-invalid.pdf
282
+ - spec/fixtures/lib/document#lcnpj-valid.pdf
283
+ - spec/fixtures/lib/document#lie-blank.pdf
284
+ - spec/fixtures/lib/document#lie-invalid.pdf
285
+ - spec/fixtures/lib/document#lie-valid.pdf
286
+ - spec/fixtures/lib/dup#render.pdf
287
+ - spec/fixtures/lib/emit#render.pdf
288
+ - spec/fixtures/lib/emit_header#render-with_logo.pdf
289
+ - spec/fixtures/lib/emit_header#render-without_logo.pdf
290
+ - spec/fixtures/lib/icmstot#render.pdf
291
+ - spec/fixtures/lib/infadic#render-extra_volume.pdf
292
+ - spec/fixtures/lib/infadic#render.pdf
293
+ - spec/fixtures/lib/issqn#render.pdf
294
+ - spec/fixtures/lib/ticket#render.pdf
295
+ - spec/fixtures/lib/transp#render.pdf
296
+ - spec/fixtures/lib/vol#render.pdf
297
+ - spec/fixtures/logo.png
222
298
  - spec/fixtures/v2.00/nfe_simples_nacional.xml
223
299
  - spec/fixtures/v2.00/nfe_simples_nacional.xml.fixture.pdf
224
- - spec/fixtures/v2.00/nfe_with_cpf.xml
225
- - spec/fixtures/v2.00/nfe_with_cpf.xml.fixture.pdf
226
300
  - spec/fixtures/v2.00/nfe_with_extra_volumes.xml
227
301
  - spec/fixtures/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
228
302
  - spec/fixtures/v2.00/nfe_with_fci.xml
229
303
  - spec/fixtures/v2.00/nfe_with_fci.xml.fixture.pdf
230
304
  - spec/fixtures/v2.00/nfe_with_logo.xml
231
305
  - spec/fixtures/v2.00/nfe_with_logo.xml.fixture.pdf
232
- - spec/fixtures/v2.00/nfe_with_logo.xml.logo.png
233
306
  - spec/fixtures/v2.00/nfe_with_ns.xml
234
307
  - spec/fixtures/v2.00/nfe_with_ns.xml.fixture.pdf
235
308
  - spec/fixtures/v2.00/nfe_without_ns.xml
@@ -239,12 +312,23 @@ test_files:
239
312
  - spec/lib/cep_spec.rb
240
313
  - spec/lib/cst_spec.rb
241
314
  - spec/lib/dest_spec.rb
315
+ - spec/lib/det_body_spec.rb
316
+ - spec/lib/det_header_spec.rb
317
+ - spec/lib/document_spec.rb
318
+ - spec/lib/dup_spec.rb
319
+ - spec/lib/emit_header_spec.rb
320
+ - spec/lib/emit_spec.rb
242
321
  - spec/lib/helper_spec.rb
322
+ - spec/lib/icmstot_spec.rb
323
+ - spec/lib/infadic_spec.rb
324
+ - spec/lib/issqn_spec.rb
243
325
  - spec/lib/options_spec.rb
244
326
  - spec/lib/phone_spec.rb
245
327
  - spec/lib/plate_spec.rb
328
+ - spec/lib/ticket_spec.rb
329
+ - spec/lib/transp_spec.rb
330
+ - spec/lib/vol_spec.rb
246
331
  - spec/lib/xml_spec.rb
247
332
  - spec/lib/xprod_spec.rb
248
333
  - spec/spec_helper.rb
249
334
  - spec/support/be_same_file_as.rb
250
- has_rdoc:
@@ -1 +0,0 @@
1
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe versao="2.00" Id="NFe35131260891033000109550010000000011000000016"><ide><cUF>35</cUF><cNF>00000001</cNF><natOp>6101-Venda de producao do estabelecimento</natOp><indPag>1</indPag><mod>55</mod><serie>1</serie><nNF>1</nNF><dEmi>2013-12-28</dEmi><tpNF>1</tpNF><cMunFG>3550308</cMunFG><tpImp>1</tpImp><tpEmis>1</tpEmis><cDV>6</cDV><tpAmb>1</tpAmb><finNFe>1</finNFe><procEmi>0</procEmi><verProc>1</verProc></ide><emit><CNPJ>60891033000109</CNPJ><xNome>KRON INSTRUMENTOS ELETRICOS LTDA</xNome><xFant>KRON INSTRUMENTOS ELETRICOS LTDA</xFant><enderEmit><xLgr>RUA ALEXANDRE DE GUSMAO</xLgr><nro>278</nro><xBairro>SOCORRO</xBairro><cMun>3550308</cMun><xMun>SAO PAULO</xMun><UF>SP</UF><CEP>04760020</CEP><cPais>1058</cPais><xPais>BRASIL</xPais><fone>1155252000</fone></enderEmit><IE>111393871117</IE><CRT>1</CRT></emit><dest><CPF>11144477735</CPF><xNome>Pessoa Fisica</xNome><enderDest><xLgr>Av da Saudade</xLgr><nro>1125</nro><xBairro>Frutal</xBairro><cMun>3552403</cMun><xMun>SUMARE</xMun><UF>SP</UF><CEP>13171320</CEP><cPais>1058</cPais><xPais>BRASIL</xPais><fone>1921046300</fone></enderDest></dest><det nItem="1"><prod><cProd>1</cProd><cEAN/><xProd>Tijolo Macico Tipo A</xProd><NCM>69041000</NCM><EXTIPI>00</EXTIPI><CFOP>6101</CFOP><uCom>MI</uCom><qCom>2.0000</qCom><vUnCom>10.0000000000</vUnCom><vProd>20.00</vProd><cEANTrib/><uTrib>MI</uTrib><qTrib>2.0000</qTrib><vUnTrib>10.0000000000</vUnTrib><indTot>1</indTot></prod><imposto><vTotTrib>5.35</vTotTrib><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><det nItem="2"><prod><cProd>2</cProd><cEAN/><xProd>Tijolo Macico Tipo B</xProd><NCM>69041000</NCM><EXTIPI>00</EXTIPI><CFOP>6101</CFOP><uCom>MI</uCom><qCom>3.0000</qCom><vUnCom>20.0000000000</vUnCom><vProd>60.00</vProd><cEANTrib/><uTrib>MI</uTrib><qTrib>3.0000</qTrib><vUnTrib>20.0000000000</vUnTrib><indTot>1</indTot></prod><imposto><vTotTrib>16.05</vTotTrib><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><det nItem="3"><prod><cProd>3</cProd><cEAN/><xProd>Tijolo Macico Tipo C</xProd><NCM>69041000</NCM><EXTIPI>00</EXTIPI><CFOP>6101</CFOP><uCom>MI</uCom><qCom>4.0000</qCom><vUnCom>30.0000000000</vUnCom><vProd>120.00</vProd><cEANTrib/><uTrib>MI</uTrib><qTrib>4.0000</qTrib><vUnTrib>30.0000000000</vUnTrib><indTot>1</indTot></prod><imposto><vTotTrib>32.10</vTotTrib><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS><PIS><PISOutr><CST>99</CST><vBC>0.00</vBC><pPIS>0.00</pPIS><vPIS>0.00</vPIS></PISOutr></PIS><COFINS><COFINSOutr><CST>99</CST><vBC>0.00</vBC><pCOFINS>0.00</pCOFINS><vCOFINS>0.00</vCOFINS></COFINSOutr></COFINS></imposto></det><total><ICMSTot><vBC>0.00</vBC><vICMS>0.00</vICMS><vBCST>0.00</vBCST><vST>0.00</vST><vProd>200.00</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0.00</vII><vIPI>0.00</vIPI><vPIS>0.00</vPIS><vCOFINS>0.00</vCOFINS><vOutro>0.00</vOutro><vNF>200.00</vNF><vTotTrib>53.50</vTotTrib></ICMSTot></total><transp><modFrete>0</modFrete></transp><cobr><fat><nFat>1</nFat></fat><dup><nDup>1</nDup><dVenc>2014-01-27</dVenc><vDup>40.00</vDup></dup><dup><nDup>2</nDup><dVenc>2014-02-26</dVenc><vDup>40.00</vDup></dup><dup><nDup>3</nDup><dVenc>2014-03-28</dVenc><vDup>40.00</vDup></dup><dup><nDup>4</nDup><dVenc>2014-04-27</dVenc><vDup>40.00</vDup></dup><dup><nDup>5</nDup><dVenc>2014-05-27</dVenc><vDup>40.00</vDup></dup></cobr><infAdic><infCpl>DOCUMENTO EMITIDO POR ME OU EPP OPTANTE PELO SIMPLES NACIONAL * NAO GERA DIREITO A CREDITO FISCAL DE IPI * Tributos: R$ 53,50 (26,75%)</infCpl></infAdic></infNFe></NFe>