br_danfe 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +35 -34
  3. data/README.md +16 -0
  4. data/br_danfe.gemspec +1 -1
  5. data/config/locales/pt-BR.yml +1 -0
  6. data/fonts/Tinos-LICENSE.txt +202 -0
  7. data/fonts/tinos.ttf +0 -0
  8. data/fonts/tinos_bold.ttf +0 -0
  9. data/fonts/tinos_bold_italic.ttf +0 -0
  10. data/fonts/tinos_italic.ttf +0 -0
  11. data/lib/br_danfe.rb +6 -0
  12. data/lib/br_danfe/cce_lib/document.rb +2 -2
  13. data/lib/br_danfe/danfe.rb +8 -5
  14. data/lib/br_danfe/danfe_lib/base.rb +2 -2
  15. data/lib/br_danfe/danfe_lib/nfce.rb +14 -12
  16. data/lib/br_danfe/danfe_lib/nfce_lib/document.rb +1 -1
  17. data/lib/br_danfe/danfe_lib/nfe.rb +39 -27
  18. data/lib/br_danfe/danfe_lib/nfe_lib/document.rb +3 -2
  19. data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +4 -4
  20. data/lib/br_danfe/danfe_lib/nfe_lib/issqn.rb +1 -1
  21. data/lib/br_danfe/danfe_lib/nfe_lib/xprod.rb +5 -5
  22. data/lib/br_danfe/document_builder.rb +16 -0
  23. data/lib/br_danfe/helper.rb +6 -0
  24. data/lib/br_danfe/version.rb +1 -1
  25. data/lib/prawn/font.rb +7 -0
  26. data/lib/prawn/font_metric_cache.rb +33 -0
  27. data/spec/br_danfe/danfe_lib/nfce_spec.rb +12 -1
  28. data/spec/br_danfe/danfe_lib/nfe_lib/emit_header_spec.rb +2 -2
  29. data/spec/br_danfe/danfe_lib/nfe_lib/infadic_spec.rb +0 -1
  30. data/spec/br_danfe/danfe_lib/nfe_lib/xprod_spec.rb +2 -2
  31. data/spec/br_danfe/danfe_lib/nfe_spec.rb +17 -1
  32. data/spec/br_danfe/danfe_spec.rb +16 -0
  33. data/spec/fixtures/cce/lib/correction#render.pdf +0 -0
  34. data/spec/fixtures/cce/lib/document#box.with.block.pdf +0 -0
  35. data/spec/fixtures/cce/lib/document#text.align.pdf +0 -0
  36. data/spec/fixtures/cce/lib/document#text.pad.pdf +0 -0
  37. data/spec/fixtures/cce/lib/document#text.simple.pdf +0 -0
  38. data/spec/fixtures/cce/lib/document#text.size.pdf +0 -0
  39. data/spec/fixtures/cce/lib/document#text.style.pdf +0 -0
  40. data/spec/fixtures/cce/lib/footer#render.pdf +0 -0
  41. data/spec/fixtures/cce/lib/header#render.pdf +0 -0
  42. data/spec/fixtures/cce/lib/nfe_key#render.pdf +0 -0
  43. data/spec/fixtures/cce/lib/protocol#render.pdf +0 -0
  44. data/spec/fixtures/cce/v1.00/cce.fixture.pdf +211 -48
  45. data/spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf +1229 -0
  46. data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +0 -0
  47. data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +0 -0
  48. data/spec/fixtures/nfe/lib/dest#render-v4.00.pdf +0 -0
  49. data/spec/fixtures/nfe/lib/dest#render-with-address-bigger.pdf +0 -0
  50. data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +0 -0
  51. data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +0 -0
  52. data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +0 -0
  53. data/spec/fixtures/nfe/lib/dest#render-without-address-complement.pdf +0 -0
  54. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +739 -658
  55. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +476 -393
  56. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +323 -238
  57. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +327 -237
  58. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +319 -233
  59. data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +6619 -7057
  60. data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +6474 -6396
  61. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +319 -233
  62. data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +315 -237
  63. data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +3026 -2948
  64. data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +3026 -2948
  65. data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +0 -0
  66. data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +0 -0
  67. data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +0 -0
  68. data/spec/fixtures/nfe/lib/document#lie-blank-uf-invalid.pdf +0 -0
  69. data/spec/fixtures/nfe/lib/document#lie-blank.pdf +0 -0
  70. data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +0 -0
  71. data/spec/fixtures/nfe/lib/document#lie-valid.pdf +0 -0
  72. data/spec/fixtures/nfe/lib/dup#render.pdf +0 -0
  73. data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +214 -67
  74. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +214 -67
  75. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +212 -65
  76. data/spec/fixtures/nfe/lib/icmstot#render.pdf +0 -0
  77. data/spec/fixtures/nfe/lib/infadic#address-shipment.pdf +0 -0
  78. data/spec/fixtures/nfe/lib/infadic#render-all_the_informations.pdf +0 -0
  79. data/spec/fixtures/nfe/lib/infadic#render-difal.pdf +0 -0
  80. data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +0 -0
  81. data/spec/fixtures/nfe/lib/infadic#render-with_complementary_information.pdf +0 -0
  82. data/spec/fixtures/nfe/lib/infadic#render-with_fisco_additional_information.pdf +0 -0
  83. data/spec/fixtures/nfe/lib/infadic#render-with_street_data.pdf +0 -0
  84. data/spec/fixtures/nfe/lib/infadic#render.pdf +0 -0
  85. data/spec/fixtures/nfe/lib/infadic_vol#render-extra_volume.pdf +0 -0
  86. data/spec/fixtures/nfe/lib/issqn#render-with_issqn.pdf +0 -0
  87. data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +0 -0
  88. data/spec/fixtures/nfe/lib/ticket#render.pdf +0 -0
  89. data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +0 -0
  90. data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +0 -0
  91. data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +0 -0
  92. data/spec/fixtures/nfe/lib/transp#render-modfrete_3.pdf +0 -0
  93. data/spec/fixtures/nfe/lib/transp#render-modfrete_4.pdf +0 -0
  94. data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +0 -0
  95. data/spec/fixtures/nfe/lib/transp#render.pdf +0 -0
  96. data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +0 -0
  97. data/spec/fixtures/nfe/lib/vol#render.pdf +0 -0
  98. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +1037 -793
  99. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +1035 -791
  100. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +2963 -2738
  101. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +731 -504
  102. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +2909 -2688
  103. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +938 -768
  104. data/spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf +11471 -0
  105. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +1823 -1601
  106. data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +3110 -2436
  107. data/spec/fixtures/nfe/v3.10/with_footer.xml +18 -0
  108. data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +2564 -3072
  109. data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +8404 -8187
  110. data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +3167 -2951
  111. data/spec/spec_helper.rb +2 -0
  112. metadata +15 -6
data/spec/spec_helper.rb CHANGED
@@ -13,5 +13,7 @@ RSpec.configure do |config|
13
13
  c.syntax = :expect
14
14
  end
15
15
 
16
+ config.filter_run_when_matching :focus
17
+
16
18
  config.order = "random"
17
19
  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.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-21 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: barby
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 3.9.0
145
+ version: 3.10.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 3.9.0
152
+ version: 3.10.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -254,6 +254,11 @@ files:
254
254
  - br_danfe.gemspec
255
255
  - config/locales/pt-BR.yml
256
256
  - docker-compose.yml
257
+ - fonts/Tinos-LICENSE.txt
258
+ - fonts/tinos.ttf
259
+ - fonts/tinos_bold.ttf
260
+ - fonts/tinos_bold_italic.ttf
261
+ - fonts/tinos_italic.ttf
257
262
  - lib/br_danfe.rb
258
263
  - lib/br_danfe/cce.rb
259
264
  - lib/br_danfe/cce_lib/barcode.rb
@@ -296,12 +301,15 @@ files:
296
301
  - lib/br_danfe/danfe_lib/nfe_lib/transp.rb
297
302
  - lib/br_danfe/danfe_lib/nfe_lib/vol.rb
298
303
  - lib/br_danfe/danfe_lib/nfe_lib/xprod.rb
304
+ - lib/br_danfe/document_builder.rb
299
305
  - lib/br_danfe/helper.rb
300
306
  - lib/br_danfe/logo_config.rb
301
307
  - lib/br_danfe/logo_options.rb
302
308
  - lib/br_danfe/uf.rb
303
309
  - lib/br_danfe/version.rb
304
310
  - lib/br_danfe/xml.rb
311
+ - lib/prawn/font.rb
312
+ - lib/prawn/font_metric_cache.rb
305
313
  - spec/br_danfe/cce_lib/barcode_spec.rb
306
314
  - spec/br_danfe/cce_lib/correction_spec.rb
307
315
  - spec/br_danfe/cce_lib/document_spec.rb
@@ -391,6 +399,7 @@ files:
391
399
  - spec/fixtures/nfce/lib/total_list#render-totals.pdf
392
400
  - spec/fixtures/nfce/lib/total_list#render-without_payment.pdf
393
401
  - spec/fixtures/nfce/lib/total_list#render.pdf
402
+ - spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf
394
403
  - spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.fixture.pdf
395
404
  - spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.xml
396
405
  - spec/fixtures/nfce/v4.00/nfce-unauthorized-prod.fixture.pdf
@@ -464,6 +473,7 @@ files:
464
473
  - spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf
465
474
  - spec/fixtures/nfe/v2.00/nfe_without_ns.xml
466
475
  - spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf
476
+ - spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf
467
477
  - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml
468
478
  - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf
469
479
  - spec/fixtures/nfe/v3.10/with_footer.fixture.pdf
@@ -495,8 +505,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
495
505
  - !ruby/object:Gem::Version
496
506
  version: '0'
497
507
  requirements: []
498
- rubyforge_project:
499
- rubygems_version: 2.7.6
508
+ rubygems_version: 3.1.4
500
509
  signing_key:
501
510
  specification_version: 4
502
511
  summary: DANFE pdf generator for Brazilian invoices.