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.
- checksums.yaml +4 -4
- data/.github/workflows/config.yml +19 -10
- data/.octocov.yml +18 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +23 -24
- data/config/locales/pt-BR.yml +4 -3
- data/fonts/Arimo-LICENSE.txt +118 -0
- data/fonts/arimo.ttf +0 -0
- data/fonts/arimo_bold.ttf +0 -0
- data/fonts/arimo_bold_italic.ttf +0 -0
- data/fonts/arimo_italic.ttf +0 -0
- data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +1 -5
- data/lib/br_danfe/danfe_lib/nfce_lib/recipient.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/consts.rb +7 -0
- data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfe_lib/det_body.rb +12 -4
- data/lib/br_danfe/danfe_lib/nfe_lib/document.rb +27 -14
- data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +34 -20
- data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +34 -17
- data/lib/br_danfe/danfe_lib/nfe_lib/entrega.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfe_lib/helper.rb +8 -0
- data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +4 -4
- data/lib/br_danfe/danfe_lib/nfe_lib/ticket.rb +30 -6
- data/lib/br_danfe/danfe_lib/nfe_lib/transp.rb +2 -2
- data/lib/br_danfe/danfe_lib/nfe_lib/vol.rb +1 -1
- data/lib/br_danfe/document_builder.rb +7 -0
- data/lib/br_danfe/helper.rb +4 -0
- data/lib/br_danfe/version.rb +1 -1
- data/spec/br_danfe/cce_lib/document_spec.rb +12 -0
- data/spec/br_danfe/danfe_lib/nfce_lib/document_spec.rb +12 -0
- data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +12 -0
- data/spec/br_danfe/helper_spec.rb +25 -0
- data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-v4.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with-address-bigger.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +0 -0
- data/spec/fixtures/nfe/lib/dest#render-without-address-complement.pdf +0 -0
- data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +1234 -1223
- data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +836 -771
- data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +613 -527
- data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +619 -534
- data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +609 -522
- data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +10032 -11157
- data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +9834 -10928
- data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +609 -522
- data/spec/fixtures/nfe/lib/det_body#render-with_entrega.pdf +620 -527
- data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +614 -539
- data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +4812 -5222
- data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +4454 -5414
- data/spec/fixtures/nfe/lib/document#lcnpj_cpf-blank.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lcnpj_cpf-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lcnpj_cpf-valid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-blank-uf-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-blank.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +0 -0
- data/spec/fixtures/nfe/lib/document#lie-valid.pdf +0 -0
- data/spec/fixtures/nfe/lib/dup#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/dup#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/emit_header#render-nfe_key.pdf +225 -251
- data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +225 -251
- data/spec/fixtures/nfe/lib/emit_header#render-with_cpf.pdf +222 -249
- data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +225 -251
- data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +223 -249
- data/spec/fixtures/nfe/lib/entrega#render-v2.00.pdf +0 -0
- data/spec/fixtures/nfe/lib/entrega#render-with-address-bigger.pdf +0 -0
- data/spec/fixtures/nfe/lib/entrega#render-with_cpf.pdf +0 -0
- data/spec/fixtures/nfe/lib/icmstot#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/icmstot#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-all_the_informations.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-difal.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_complementary_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_dup_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_fisco_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-with_street_data.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render-without_dup_additional_information.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/infadic_vol#render-extra_volume.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_issqn.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +0 -0
- data/spec/fixtures/nfe/lib/issqn#render-without_issqn.pdf +4 -4
- data/spec/fixtures/nfe/lib/ticket#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/ticket#render_with_dEmit.pdf +0 -0
- data/spec/fixtures/nfe/lib/ticket#render_with_dhEmit.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_3.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_4.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/transp#render.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render-with_entrega.pdf +0 -0
- data/spec/fixtures/nfe/lib/vol#render.pdf +0 -0
- data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +1484 -1417
- data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +1481 -1407
- data/spec/fixtures/nfe/v2.00/nfe_with_entrega.xml.fixture.pdf +1544 -1451
- data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +4604 -6164
- data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +1091 -1005
- data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +4657 -6185
- data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +1492 -1449
- data/spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf +5190 -5309
- data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +2684 -2771
- data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +4095 -5042
- data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +3704 -3901
- data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +11692 -13493
- data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +4569 -5591
- data/spec/spec_helper.rb +6 -6
- metadata +13 -9
- data/lib/br_danfe/danfe_lib/nfce_lib/helper.rb +0 -11
- 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.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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:
|
|
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:
|
|
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.
|
|
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
|