br_danfe 2.1.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/config.yml +19 -10
  3. data/.octocov.yml +18 -0
  4. data/Gemfile +0 -1
  5. data/Gemfile.lock +23 -24
  6. data/config/locales/pt-BR.yml +4 -3
  7. data/fonts/Arimo-LICENSE.txt +118 -0
  8. data/fonts/arimo.ttf +0 -0
  9. data/fonts/arimo_bold.ttf +0 -0
  10. data/fonts/arimo_bold_italic.ttf +0 -0
  11. data/fonts/arimo_italic.ttf +0 -0
  12. data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +1 -5
  13. data/lib/br_danfe/danfe_lib/nfce_lib/recipient.rb +1 -1
  14. data/lib/br_danfe/danfe_lib/nfe_lib/consts.rb +7 -0
  15. data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +3 -3
  16. data/lib/br_danfe/danfe_lib/nfe_lib/det_body.rb +12 -4
  17. data/lib/br_danfe/danfe_lib/nfe_lib/document.rb +27 -14
  18. data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +34 -20
  19. data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +34 -17
  20. data/lib/br_danfe/danfe_lib/nfe_lib/entrega.rb +3 -3
  21. data/lib/br_danfe/danfe_lib/nfe_lib/helper.rb +8 -0
  22. data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +4 -4
  23. data/lib/br_danfe/danfe_lib/nfe_lib/ticket.rb +30 -6
  24. data/lib/br_danfe/danfe_lib/nfe_lib/transp.rb +2 -2
  25. data/lib/br_danfe/danfe_lib/nfe_lib/vol.rb +1 -1
  26. data/lib/br_danfe/document_builder.rb +7 -0
  27. data/lib/br_danfe/helper.rb +4 -0
  28. data/lib/br_danfe/version.rb +1 -1
  29. data/spec/br_danfe/cce_lib/document_spec.rb +12 -0
  30. data/spec/br_danfe/danfe_lib/nfce_lib/document_spec.rb +12 -0
  31. data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +12 -0
  32. data/spec/br_danfe/helper_spec.rb +25 -0
  33. data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +0 -0
  34. data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +0 -0
  35. data/spec/fixtures/nfe/lib/dest#render-v4.00.pdf +0 -0
  36. data/spec/fixtures/nfe/lib/dest#render-with-address-bigger.pdf +0 -0
  37. data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +0 -0
  38. data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +0 -0
  39. data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +0 -0
  40. data/spec/fixtures/nfe/lib/dest#render-without-address-complement.pdf +0 -0
  41. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +1234 -1223
  42. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +836 -771
  43. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +613 -527
  44. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +619 -534
  45. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +609 -522
  46. data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +10032 -11157
  47. data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +9834 -10928
  48. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +609 -522
  49. data/spec/fixtures/nfe/lib/det_body#render-with_entrega.pdf +620 -527
  50. data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +614 -539
  51. data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +4812 -5222
  52. data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +4454 -5414
  53. data/spec/fixtures/nfe/lib/document#lcnpj_cpf-blank.pdf +0 -0
  54. data/spec/fixtures/nfe/lib/document#lcnpj_cpf-invalid.pdf +0 -0
  55. data/spec/fixtures/nfe/lib/document#lcnpj_cpf-valid.pdf +0 -0
  56. data/spec/fixtures/nfe/lib/document#lie-blank-uf-invalid.pdf +0 -0
  57. data/spec/fixtures/nfe/lib/document#lie-blank.pdf +0 -0
  58. data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +0 -0
  59. data/spec/fixtures/nfe/lib/document#lie-valid.pdf +0 -0
  60. data/spec/fixtures/nfe/lib/dup#render-with_entrega.pdf +0 -0
  61. data/spec/fixtures/nfe/lib/dup#render.pdf +0 -0
  62. data/spec/fixtures/nfe/lib/emit_header#render-nfe_key.pdf +225 -251
  63. data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +225 -251
  64. data/spec/fixtures/nfe/lib/emit_header#render-with_cpf.pdf +222 -249
  65. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +225 -251
  66. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +223 -249
  67. data/spec/fixtures/nfe/lib/entrega#render-v2.00.pdf +0 -0
  68. data/spec/fixtures/nfe/lib/entrega#render-with-address-bigger.pdf +0 -0
  69. data/spec/fixtures/nfe/lib/entrega#render-with_cpf.pdf +0 -0
  70. data/spec/fixtures/nfe/lib/icmstot#render-with_entrega.pdf +0 -0
  71. data/spec/fixtures/nfe/lib/icmstot#render.pdf +0 -0
  72. data/spec/fixtures/nfe/lib/infadic#render-all_the_informations.pdf +0 -0
  73. data/spec/fixtures/nfe/lib/infadic#render-difal.pdf +0 -0
  74. data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +0 -0
  75. data/spec/fixtures/nfe/lib/infadic#render-with_complementary_information.pdf +0 -0
  76. data/spec/fixtures/nfe/lib/infadic#render-with_dup_additional_information.pdf +0 -0
  77. data/spec/fixtures/nfe/lib/infadic#render-with_fisco_additional_information.pdf +0 -0
  78. data/spec/fixtures/nfe/lib/infadic#render-with_street_data.pdf +0 -0
  79. data/spec/fixtures/nfe/lib/infadic#render-without_dup_additional_information.pdf +0 -0
  80. data/spec/fixtures/nfe/lib/infadic#render.pdf +0 -0
  81. data/spec/fixtures/nfe/lib/infadic_vol#render-extra_volume.pdf +0 -0
  82. data/spec/fixtures/nfe/lib/issqn#render-with_entrega.pdf +0 -0
  83. data/spec/fixtures/nfe/lib/issqn#render-with_issqn.pdf +0 -0
  84. data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +0 -0
  85. data/spec/fixtures/nfe/lib/issqn#render-without_issqn.pdf +4 -4
  86. data/spec/fixtures/nfe/lib/ticket#render.pdf +0 -0
  87. data/spec/fixtures/nfe/lib/ticket#render_with_dEmit.pdf +0 -0
  88. data/spec/fixtures/nfe/lib/ticket#render_with_dhEmit.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-with_entrega.pdf +0 -0
  96. data/spec/fixtures/nfe/lib/transp#render.pdf +0 -0
  97. data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +0 -0
  98. data/spec/fixtures/nfe/lib/vol#render-with_entrega.pdf +0 -0
  99. data/spec/fixtures/nfe/lib/vol#render.pdf +0 -0
  100. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +1484 -1417
  101. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +1481 -1407
  102. data/spec/fixtures/nfe/v2.00/nfe_with_entrega.xml.fixture.pdf +1544 -1451
  103. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +4604 -6164
  104. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +1091 -1005
  105. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +4657 -6185
  106. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +1492 -1449
  107. data/spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf +5190 -5309
  108. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +2684 -2771
  109. data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +4095 -5042
  110. data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +3704 -3901
  111. data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +11692 -13493
  112. data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +4569 -5591
  113. data/spec/spec_helper.rb +6 -6
  114. metadata +13 -9
  115. data/lib/br_danfe/danfe_lib/nfce_lib/helper.rb +0 -11
  116. data/spec/br_danfe/danfe_lib/nfce_lib/helper_spec.rb +0 -28
data/spec/spec_helper.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'simplecov'
2
- require 'simplecov-json'
3
2
 
4
3
  unless ENV["NO_COVERAGE"]
5
- SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
6
- SimpleCov::Formatter::HTMLFormatter,
7
- SimpleCov::Formatter::JSONFormatter
8
- ])
9
- SimpleCov.start
4
+ SimpleCov.start do
5
+ add_filter '/spec/support/'
6
+
7
+ # Prawn internals monkey-patch, not br_danfe's own logic.
8
+ add_filter '/lib/prawn/'
9
+ end
10
10
  end
11
11
 
12
12
  require "bundler/setup"
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: 2.1.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-09 00:00:00.000000000 Z
11
+ date: 2026-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: barby
@@ -114,7 +114,7 @@ dependencies:
114
114
  - - "<"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '2.3'
117
- description:
117
+ description:
118
118
  email: asseinfo@asseinfo.com.br
119
119
  executables: []
120
120
  extensions: []
@@ -124,6 +124,7 @@ files:
124
124
  - ".github/dependabot.yml"
125
125
  - ".github/workflows/config.yml"
126
126
  - ".gitignore"
127
+ - ".octocov.yml"
127
128
  - ".rspec"
128
129
  - ".rubocop.yml"
129
130
  - Dockerfile
@@ -135,7 +136,12 @@ files:
135
136
  - br_danfe.gemspec
136
137
  - config/locales/pt-BR.yml
137
138
  - docker-compose.yml
139
+ - fonts/Arimo-LICENSE.txt
138
140
  - fonts/Tinos-LICENSE.txt
141
+ - fonts/arimo.ttf
142
+ - fonts/arimo_bold.ttf
143
+ - fonts/arimo_bold_italic.ttf
144
+ - fonts/arimo_italic.ttf
139
145
  - fonts/tinos.ttf
140
146
  - fonts/tinos_bold.ttf
141
147
  - fonts/tinos_bold_italic.ttf
@@ -155,7 +161,6 @@ files:
155
161
  - lib/br_danfe/danfe_lib/nfce_lib/document.rb
156
162
  - lib/br_danfe/danfe_lib/nfce_lib/footer.rb
157
163
  - lib/br_danfe/danfe_lib/nfce_lib/header.rb
158
- - lib/br_danfe/danfe_lib/nfce_lib/helper.rb
159
164
  - lib/br_danfe/danfe_lib/nfce_lib/key.rb
160
165
  - lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
161
166
  - lib/br_danfe/danfe_lib/nfce_lib/product_list.rb
@@ -212,7 +217,6 @@ files:
212
217
  - spec/br_danfe/danfe_lib/nfce_lib/document_spec.rb
213
218
  - spec/br_danfe/danfe_lib/nfce_lib/footer_spec.rb
214
219
  - spec/br_danfe/danfe_lib/nfce_lib/header_spec.rb
215
- - spec/br_danfe/danfe_lib/nfce_lib/helper_spec.rb
216
220
  - spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb
217
221
  - spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb
218
222
  - spec/br_danfe/danfe_lib/nfce_lib/product_list_spec.rb
@@ -428,7 +432,7 @@ licenses:
428
432
  - MIT
429
433
  metadata:
430
434
  rubygems_mfa_required: 'true'
431
- post_install_message:
435
+ post_install_message:
432
436
  rdoc_options: []
433
437
  require_paths:
434
438
  - lib
@@ -443,8 +447,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
443
447
  - !ruby/object:Gem::Version
444
448
  version: '0'
445
449
  requirements: []
446
- rubygems_version: 3.5.16
447
- signing_key:
450
+ rubygems_version: 3.5.9
451
+ signing_key:
448
452
  specification_version: 4
449
453
  summary: DANFE pdf generator for Brazilian invoices.
450
454
  test_files: []
@@ -1,11 +0,0 @@
1
- module BrDanfe
2
- module DanfeLib
3
- module NfceLib
4
- class Helper
5
- def self.address(ender_tag)
6
- "#{ender_tag.css('xLgr').text}, #{ender_tag.css('nro').text}, #{ender_tag.css('xBairro').text}, #{ender_tag.css('xMun').text} - #{ender_tag.css('UF').text}"
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,28 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe BrDanfe::DanfeLib::NfceLib::Helper do
4
- let(:xml) do
5
- xml = <<~XML
6
- <enderDest>
7
- <xLgr>Rua Tijucas</xLgr>
8
- <nro>99</nro>
9
- <xCpl>dwdwa</xCpl>
10
- <xBairro>Centro</xBairro>
11
- <cMun>4218004</cMun>
12
- <xMun>TIJUCAS</xMun>
13
- <UF>SC</UF>
14
- <CEP>88200000</CEP>
15
- <cPais>1058</cPais>
16
- <xPais>Brasil</xPais>
17
- </enderDest>
18
- XML
19
-
20
- BrDanfe::XML.new(xml)
21
- end
22
-
23
- describe '#address' do
24
- it 'returns a formated address string' do
25
- expect(described_class.address(xml)).to eql 'Rua Tijucas, 99, Centro, TIJUCAS - SC'
26
- end
27
- end
28
- end