br_danfe 3.1.0 → 3.1.1
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/Gemfile.lock +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/consts.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfe_lib/det_body.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/document.rb +5 -5
- data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +29 -28
- data/lib/br_danfe/danfe_lib/nfe_lib/helper.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfe_lib/ticket.rb +9 -9
- data/lib/br_danfe/document_builder.rb +0 -7
- data/lib/br_danfe/version.rb +1 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/helper_spec.rb +16 -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 +749 -714
- data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +485 -457
- data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +336 -307
- data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +346 -312
- data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +332 -303
- data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +6690 -6497
- data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +6508 -6322
- data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +332 -303
- data/spec/fixtures/nfe/lib/det_body#render-with_entrega.pdf +338 -314
- data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +350 -311
- data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +3186 -3084
- data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +3459 -2807
- 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 +316 -222
- data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +316 -222
- data/spec/fixtures/nfe/lib/emit_header#render-with_cpf.pdf +317 -218
- data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +316 -222
- data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +300 -206
- 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/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 +1006 -918
- data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +997 -916
- data/spec/fixtures/nfe/v2.00/nfe_with_entrega.xml.fixture.pdf +1034 -953
- data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +2764 -2638
- data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +749 -673
- data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +2647 -2565
- data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +1014 -935
- data/spec/fixtures/nfe/v3.10/multiples.xmls.on.the.same.pdf.pdf +3321 -3235
- data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +1780 -1702
- data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +2550 -2475
- data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +2425 -2347
- data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +7821 -7658
- data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +2914 -2836
- metadata +1 -6
- data/fonts/Arimo-LICENSE.txt +0 -118
- 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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ff19b20871262acd4e02135c7e7d237b5052aef8666a83d6e921cc0e3a4930b
|
|
4
|
+
data.tar.gz: 4410d226e4eaa0123a5180db9d2e33328caacc46105b23aff0715cb605d08e50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d562723a34053ba2e2b8e541fceb2e73357995d7ac173cb73e3ccfa02fa88b127376da1b146930ba5145bed36d8909b0823146811b7662e8e66f8d4b47e612ab
|
|
7
|
+
data.tar.gz: a2966067515c05e32f12f464d13ec16c0184827e1175e2a3e774d9af9fa06b1768d3ba850dbfde4f78d2b0945a21ae3f793973eb07a545eb2920394d290ae7ce
|
data/Gemfile.lock
CHANGED
|
@@ -35,13 +35,13 @@ module BrDanfe
|
|
|
35
35
|
|
|
36
36
|
def render_cnpj_cpf
|
|
37
37
|
xpath = @xml['dest/CNPJ'].present? ? 'dest/CNPJ' : 'dest/CPF'
|
|
38
|
-
@pdf.lcnpj_cpf LINE_HEIGHT, 4.
|
|
38
|
+
@pdf.lcnpj_cpf LINE_HEIGHT, 4.83, 12.57, @l1, @xml, xpath
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def render_line2
|
|
42
42
|
@pdf.i18n_lbox LINE_HEIGHT, 9.66, 0.75, @l2, 'enderDest.xLgr', address
|
|
43
43
|
@pdf.lbox LINE_HEIGHT, 4.33, 10.41, @l2, @xml, 'enderDest/xBairro'
|
|
44
|
-
@pdf.i18n_lbox LINE_HEIGHT, 2.
|
|
44
|
+
@pdf.i18n_lbox LINE_HEIGHT, 2.66, 14.74, @l2, 'enderDest.CEP', cep
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def address
|
|
@@ -62,7 +62,7 @@ module BrDanfe
|
|
|
62
62
|
@pdf.lbox LINE_HEIGHT, 6.61, 0.75, @l3, @xml, 'enderDest/xMun'
|
|
63
63
|
@pdf.i18n_lbox LINE_HEIGHT, 4.06, 7.36, @l3, 'enderDest.fone', phone
|
|
64
64
|
@pdf.lbox LINE_HEIGHT, 1.14, 11.42, @l3, @xml, 'enderDest/UF'
|
|
65
|
-
@pdf.lie LINE_HEIGHT, 4.
|
|
65
|
+
@pdf.lie LINE_HEIGHT, 4.84, 12.56, @l3, @xml, 'enderDest/UF', 'dest/IE'
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def phone
|
|
@@ -12,7 +12,7 @@ module BrDanfe
|
|
|
12
12
|
botton_margin: 0
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
@document.font '
|
|
15
|
+
@document.font 'tinos'
|
|
16
16
|
|
|
17
17
|
@document.line_width = LINE_WIDTH
|
|
18
18
|
end
|
|
@@ -122,13 +122,13 @@ module BrDanfe
|
|
|
122
122
|
def box(at, w, h, title = '', info = '', options = {})
|
|
123
123
|
options = {
|
|
124
124
|
align: :left,
|
|
125
|
-
size:
|
|
125
|
+
size: 10,
|
|
126
126
|
style: nil,
|
|
127
127
|
valign: :top,
|
|
128
128
|
border: 1,
|
|
129
|
-
label_size:
|
|
129
|
+
label_size: 6,
|
|
130
130
|
label_offset: 1.9,
|
|
131
|
-
value_offset:
|
|
131
|
+
value_offset: 10,
|
|
132
132
|
leading: 0
|
|
133
133
|
}.merge(options)
|
|
134
134
|
|
|
@@ -147,7 +147,7 @@ module BrDanfe
|
|
|
147
147
|
def label(at, w, title, options)
|
|
148
148
|
fill_color LABEL_COLOR
|
|
149
149
|
text_box title, size: options[:label_size], at: [at[0], at[1] - options[:label_offset]],
|
|
150
|
-
width: w - (CELL_PADDING * 2), height:
|
|
150
|
+
width: w - (CELL_PADDING * 2), height: 8
|
|
151
151
|
fill_color TEXT_COLOR
|
|
152
152
|
end
|
|
153
153
|
end
|
|
@@ -2,7 +2,8 @@ module BrDanfe
|
|
|
2
2
|
module DanfeLib
|
|
3
3
|
module NfeLib
|
|
4
4
|
class EmitHeader
|
|
5
|
-
|
|
5
|
+
IDENTIFICATION_SIZE = 10
|
|
6
|
+
DESCRIPTION_SIZE = 8
|
|
6
7
|
|
|
7
8
|
def initialize(pdf, xml, logo, logo_dimensions)
|
|
8
9
|
@pdf = pdf
|
|
@@ -25,20 +26,24 @@ module BrDanfe
|
|
|
25
26
|
def company_box
|
|
26
27
|
@pdf.ibox 3.92, 7.46, 0.75, @y_position
|
|
27
28
|
@pdf.ibox 3.92, 7.46, 0.75, @y_position, '', @xml['emit/xNome'],
|
|
28
|
-
size:
|
|
29
|
+
size: 12, align: :center, border: 0, style: :bold
|
|
29
30
|
|
|
30
31
|
address_company
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
def address_company
|
|
34
35
|
if @logo.blank?
|
|
35
|
-
@pdf.ibox 3.92, 7.46, 0.75, @y_position + 1.46, '', address, align: :center
|
|
36
|
+
@pdf.ibox 3.92, 7.46, 0.75, @y_position + 1.46, '', address, address_style.merge(align: :center)
|
|
36
37
|
else
|
|
37
|
-
@pdf.ibox 3.92, 4.7, 3.65, @y_position + 1.46, '', address, align: :left
|
|
38
|
+
@pdf.ibox 3.92, 4.7, 3.65, @y_position + 1.46, '', address, address_style.merge(align: :left)
|
|
38
39
|
logo
|
|
39
40
|
end
|
|
40
41
|
end
|
|
41
42
|
|
|
43
|
+
def address_style
|
|
44
|
+
{ size: DESCRIPTION_SIZE, style: :bold, border: 0, leading: 2 }
|
|
45
|
+
end
|
|
46
|
+
|
|
42
47
|
def address
|
|
43
48
|
"#{@xml['enderEmit/xLgr']}, #{@xml['enderEmit/nro']}\n" \
|
|
44
49
|
"#{@xml['enderEmit/xBairro']} - #{cep}\n" \
|
|
@@ -69,49 +74,45 @@ module BrDanfe
|
|
|
69
74
|
@pdf.ibox 3.92, 2.08, 8.21, @y_position
|
|
70
75
|
|
|
71
76
|
@pdf.ibox 0.60, 2.08, 8.21, @y_position, '', 'DANFE',
|
|
72
|
-
size:
|
|
77
|
+
size: 12, align: :center, border: 0, style: :bold
|
|
73
78
|
|
|
74
|
-
@pdf.
|
|
75
|
-
|
|
76
|
-
size: 4.5, align: :center, border: 0
|
|
77
|
-
@pdf.fill_color TEXT_COLOR
|
|
79
|
+
@pdf.ibox 1.40, 2.08, 8.21, @y_position + 0.52, '', I18n.t('danfe.others.danfe'),
|
|
80
|
+
size: DESCRIPTION_SIZE, align: :center, border: 0
|
|
78
81
|
|
|
79
82
|
operation_type_box
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
I18n.t('danfe.ide.serie', serie: Helper.format_serie(@xml['ide/serie'])),
|
|
86
|
-
size: 5, align: :center, border: 0
|
|
84
|
+
identification_line 2.45, I18n.t('danfe.ide.nNF', nNF: Helper.format_number(@xml['ide/nNF']))
|
|
85
|
+
identification_line 2.88, I18n.t('danfe.ide.serie', serie: Helper.format_serie(@xml['ide/serie']))
|
|
86
|
+
identification_line 3.31, I18n.t('danfe.others.page', current: page, total: total)
|
|
87
|
+
end
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
size:
|
|
89
|
+
def identification_line(y_offset, text)
|
|
90
|
+
@pdf.ibox 0.45, 2.08, 8.21, @y_position + y_offset, '', text,
|
|
91
|
+
size: IDENTIFICATION_SIZE, align: :center, border: 0, style: :bold
|
|
91
92
|
end
|
|
92
93
|
|
|
93
94
|
def operation_type_box
|
|
94
|
-
@
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
operation = @xml['ide/tpNF'] == '0' ? I18n.t('danfe.ide.tpNF.entry') : I18n.t('danfe.ide.tpNF.departure')
|
|
96
|
+
|
|
97
|
+
@pdf.formatted_text_box(
|
|
98
|
+
[{ text: @xml['ide/tpNF'], size: IDENTIFICATION_SIZE, styles: [:bold] },
|
|
99
|
+
{ text: " - #{operation}", size: DESCRIPTION_SIZE }],
|
|
100
|
+
at: [8.21.cm, Helper.invert((@y_position + 1.92).cm)], width: 2.08.cm, height: 0.50.cm,
|
|
101
|
+
align: :center, valign: :center
|
|
102
|
+
)
|
|
101
103
|
end
|
|
102
104
|
|
|
103
105
|
def access_key_box
|
|
104
106
|
@pdf.ibox 2.22, 10.02, 10.29, @y_position
|
|
105
107
|
@pdf.ibarcode 1.50, 8.00, 10.4010, @y_position + 1.90, @xml['infProt > chNFe']
|
|
106
108
|
@pdf.ibox 0.85, 10.02, 10.29, @y_position + 2.22, I18n.t('danfe.chNFe'),
|
|
107
|
-
@xml['infProt > chNFe'].gsub(/(\d)(?=(\d\d\d\d)+(?!\d))/, '\\1 '),
|
|
108
|
-
align: :center
|
|
109
|
+
@xml['infProt > chNFe'].gsub(/(\d)(?=(\d\d\d\d)+(?!\d))/, '\\1 '), style: :bold, align: :center
|
|
109
110
|
end
|
|
110
111
|
|
|
111
112
|
def sefaz_box
|
|
112
113
|
@pdf.fill_color LABEL_COLOR
|
|
113
114
|
@pdf.ibox 0.85, 10.02, 10.29, @y_position + 3.07, '', I18n.t('danfe.others.sefaz'),
|
|
114
|
-
valign: :center, size:
|
|
115
|
+
valign: :center, size: DESCRIPTION_SIZE
|
|
115
116
|
@pdf.fill_color TEXT_COLOR
|
|
116
117
|
end
|
|
117
118
|
|
|
@@ -26,7 +26,7 @@ module BrDanfe
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def render_subtitle
|
|
29
|
-
@pdf.ibox 2.65, 12.45, 0.75, @y_position, I18n.t('danfe.infAdic.infCpl'), ''
|
|
29
|
+
@pdf.ibox 2.65, 12.45, 0.75, @y_position, I18n.t('danfe.infAdic.infCpl'), ''
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def render_volumes
|
|
@@ -35,7 +35,7 @@ module BrDanfe
|
|
|
35
35
|
|
|
36
36
|
def render_additional_data(y_position)
|
|
37
37
|
data = generate_additional_data
|
|
38
|
-
@pdf.ibox 2.65, 12.45, 0.75, y_position, '', data, size:
|
|
38
|
+
@pdf.ibox 2.65, 12.45, 0.75, y_position, '', data, size: 6, valign: :top, border: 0
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def generate_additional_data
|
|
@@ -120,7 +120,7 @@ module BrDanfe
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
def render_reserved_fisco
|
|
123
|
-
@pdf.ibox 2.65, 7.11, 13.20, @y_position, I18n.t('danfe.infAdic.reserved'), ''
|
|
123
|
+
@pdf.ibox 2.65, 7.11, 13.20, @y_position, I18n.t('danfe.infAdic.reserved'), ''
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
end
|
|
@@ -13,25 +13,25 @@ module BrDanfe
|
|
|
13
13
|
|
|
14
14
|
def render
|
|
15
15
|
render_additional_data
|
|
16
|
-
@pdf.ibox 0.85, 3.85, 0.75, 2.7, I18n.t('danfe.ticket.received_at'), ''
|
|
17
|
-
@pdf.ibox 0.85, 11.75, 4.60, 2.7, I18n.t('danfe.ticket.receiver'), ''
|
|
16
|
+
@pdf.ibox 0.85, 3.85, 0.75, 2.7, I18n.t('danfe.ticket.received_at'), ''
|
|
17
|
+
@pdf.ibox 0.85, 11.75, 4.60, 2.7, I18n.t('danfe.ticket.receiver'), ''
|
|
18
18
|
render_document
|
|
19
19
|
render_cut_line
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def render_additional_data
|
|
23
23
|
data = generate_additional_data
|
|
24
|
-
@pdf.ibox 0.85, 15.60, 0.75, 1.85, '', data, size:
|
|
24
|
+
@pdf.ibox 0.85, 15.60, 0.75, 1.85, '', data, size: 6, style: :bold, valign: :center
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def render_document
|
|
28
28
|
@pdf.ibox 1.70, 3.96, 16.35, 1.85
|
|
29
|
-
@pdf.ibox 0.
|
|
30
|
-
size:
|
|
31
|
-
@pdf.ibox 0.
|
|
32
|
-
size:
|
|
33
|
-
@pdf.ibox 0.
|
|
34
|
-
size:
|
|
29
|
+
@pdf.ibox 0.55, 3.96, 16.35, 1.95, '', I18n.t('danfe.ticket.title'),
|
|
30
|
+
size: 12, align: :center, border: 0, style: :bold
|
|
31
|
+
@pdf.ibox 0.45, 3.96, 16.35, 2.45, '', I18n.t('danfe.ide.nNF', nNF: Helper.format_number(@xml['ide/nNF'])),
|
|
32
|
+
size: 10, align: :center, border: 0, style: :bold
|
|
33
|
+
@pdf.ibox 0.45, 3.96, 16.35, 2.88, '', I18n.t('danfe.ide.serie', serie: Helper.format_serie(@xml['ide/serie'])),
|
|
34
|
+
size: 10, align: :center, border: 0, style: :bold
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def render_cut_line
|
|
@@ -10,13 +10,6 @@ module BrDanfe
|
|
|
10
10
|
normal: "#{BrDanfe.root_path}/fonts/tinos.ttf"
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
document.font_families['arimo'] = {
|
|
14
|
-
bold: "#{BrDanfe.root_path}/fonts/arimo_bold.ttf",
|
|
15
|
-
italic: "#{BrDanfe.root_path}/fonts/arimo_italic.ttf",
|
|
16
|
-
bold_italic: "#{BrDanfe.root_path}/fonts/arimo_bold_italic.ttf",
|
|
17
|
-
normal: "#{BrDanfe.root_path}/fonts/arimo.ttf"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
13
|
document
|
|
21
14
|
end
|
|
22
15
|
end
|
data/lib/br_danfe/version.rb
CHANGED
|
@@ -40,6 +40,22 @@ describe BrDanfe::DanfeLib::NfeLib::Helper do
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
describe '.format_number' do
|
|
44
|
+
it 'groups the thousands with dots' do
|
|
45
|
+
expect(described_class.format_number('1234567')).to eq '1.234.567'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'drops the leading zeros' do
|
|
49
|
+
expect(described_class.format_number('000001')).to eq '1'
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe '.format_serie' do
|
|
54
|
+
it 'pads the serie with zeros up to three digits' do
|
|
55
|
+
expect(described_class.format_serie('1')).to eq '001'
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
43
59
|
describe '.address_is_too_big' do
|
|
44
60
|
let(:pdf) { BrDanfe::DanfeLib::NfeLib::Document.new }
|
|
45
61
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|