br_danfe 0.15.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -8
- data/.github/dependabot.yml +19 -0
- data/.rubocop.yml +24 -11
- data/.tool-versions +1 -0
- data/Gemfile.lock +69 -50
- data/Guardfile +4 -2
- data/README.md +23 -0
- data/bin/_guard-core +29 -0
- data/bin/guard +29 -0
- data/br_danfe.gemspec +9 -7
- data/lib/br_danfe/danfe_lib/nfce.rb +11 -9
- data/lib/br_danfe/danfe_lib/nfce_lib/document.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfce_lib/footer.rb +2 -2
- data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +30 -16
- data/lib/br_danfe/danfe_lib/nfce_lib/key.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb +3 -3
- data/lib/br_danfe/danfe_lib/nfce_lib/product_list.rb +44 -53
- data/lib/br_danfe/danfe_lib/nfce_lib/recipient.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfce_lib/total_list.rb +16 -15
- data/lib/br_danfe/danfe_lib/nfe.rb +11 -9
- data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +1 -1
- data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +1 -2
- data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +5 -6
- data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +2 -1
- data/lib/br_danfe/document_builder.rb +1 -1
- data/lib/br_danfe/helper.rb +8 -10
- data/lib/br_danfe/mdfe.rb +55 -0
- data/lib/br_danfe/mdfe_lib/authorization_protocol.rb +24 -0
- data/lib/br_danfe/mdfe_lib/document.rb +26 -0
- data/lib/br_danfe/mdfe_lib/drivers.rb +70 -0
- data/lib/br_danfe/mdfe_lib/fisco_control.rb +21 -0
- data/lib/br_danfe/mdfe_lib/header.rb +77 -0
- data/lib/br_danfe/mdfe_lib/mdfe_identification.rb +69 -0
- data/lib/br_danfe/mdfe_lib/notes.rb +94 -0
- data/lib/br_danfe/mdfe_lib/totalizer.rb +57 -0
- data/lib/br_danfe/mdfe_lib/vehicles.rb +80 -0
- data/lib/br_danfe/qr_code.rb +21 -0
- data/lib/br_danfe/version.rb +1 -1
- data/lib/br_danfe.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/footer_spec.rb +3 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/header_spec.rb +6 -4
- data/spec/br_danfe/danfe_lib/nfce_lib/helper_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb +2 -2
- data/spec/br_danfe/danfe_lib/nfce_lib/recipient_spec.rb +10 -10
- data/spec/br_danfe/danfe_lib/nfce_lib/total_list_spec.rb +12 -12
- data/spec/br_danfe/danfe_lib/nfce_spec.rb +2 -1
- data/spec/br_danfe/danfe_lib/nfe_lib/cst_spec.rb +4 -4
- data/spec/br_danfe/danfe_lib/nfe_lib/dest_spec.rb +178 -178
- data/spec/br_danfe/danfe_lib/nfe_lib/det_body_spec.rb +274 -274
- data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +77 -77
- data/spec/br_danfe/danfe_lib/nfe_lib/dup_spec.rb +23 -23
- data/spec/br_danfe/danfe_lib/nfe_lib/emit_header_spec.rb +37 -37
- data/spec/br_danfe/danfe_lib/nfe_lib/helper_spec.rb +34 -34
- data/spec/br_danfe/danfe_lib/nfe_lib/icmstot_spec.rb +19 -19
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_spec.rb +240 -240
- data/spec/br_danfe/danfe_lib/nfe_lib/infadic_vol_spec.rb +3 -2
- data/spec/br_danfe/danfe_lib/nfe_lib/issqn_spec.rb +16 -16
- data/spec/br_danfe/danfe_lib/nfe_lib/ticket_spec.rb +13 -13
- data/spec/br_danfe/danfe_lib/nfe_lib/transp_spec.rb +76 -76
- data/spec/br_danfe/danfe_lib/nfe_lib/vol_spec.rb +40 -40
- data/spec/br_danfe/danfe_lib/nfe_lib/xprod_spec.rb +118 -118
- data/spec/br_danfe/danfe_spec.rb +2 -2
- data/spec/br_danfe/helper_spec.rb +26 -14
- data/spec/br_danfe/mdfe_lib/authorization_protocol_spec.rb +35 -0
- data/spec/br_danfe/mdfe_lib/document_spec.rb +20 -0
- data/spec/br_danfe/mdfe_lib/drivers_spec.rb +88 -0
- data/spec/br_danfe/mdfe_lib/fisco_control_spec.rb +69 -0
- data/spec/br_danfe/mdfe_lib/header_spec.rb +135 -0
- data/spec/br_danfe/mdfe_lib/mdfe_identification_spec.rb +104 -0
- data/spec/br_danfe/mdfe_lib/notes_spec.rb +97 -0
- data/spec/br_danfe/mdfe_lib/totalizer_spec.rb +63 -0
- data/spec/br_danfe/mdfe_lib/vehicles_spec.rb +66 -0
- data/spec/br_danfe/mdfe_spec.rb +45 -0
- data/spec/br_danfe/qr_code_spec.rb +31 -0
- data/spec/br_danfe/xml_spec.rb +6 -6
- data/spec/fixtures/mdfe/lib/document#render.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.align.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.pad.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.simple.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.size.pdf +0 -0
- data/spec/fixtures/mdfe/lib/document#text.style.pdf +0 -0
- data/spec/fixtures/mdfe/lib/fisco_control#barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/fisco_control#without-barcode.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-with_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without-qr-code.pdf +0 -0
- data/spec/fixtures/mdfe/lib/header#render-without_logo.pdf +0 -0
- data/spec/fixtures/mdfe/lib/mdfe-with-multiple-pages.pdf +1945 -0
- data/spec/fixtures/mdfe/lib/mdfe.fixture.pdf +1286 -0
- data/spec/fixtures/mdfe/lib/notes#render-big-aditional-information.pdf +1943 -0
- data/spec/fixtures/mdfe/lib/xml-mdfe-multiples-pages.xml +116 -0
- data/spec/fixtures/mdfe/lib/xml-mdfe.xml +250 -0
- data/spec/fixtures/nfce/lib/document#render.pdf +12 -23
- data/spec/fixtures/nfce/lib/footer#render-with_additional_information.pdf +0 -0
- data/spec/fixtures/nfce/lib/footer#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-homologation.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-long_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_with_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/header#render-short_name_without_logo.pdf +0 -0
- data/spec/fixtures/nfce/lib/key#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/nfce_identification#render.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_many_products_and_long_names.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list#render-with_single_product_and_long_name.pdf +0 -0
- data/spec/fixtures/nfce/lib/product_list_with_many_products_and_long_names.xml +2 -2
- data/spec/fixtures/nfce/lib/product_list_with_single_product_and_long_name.xml +1 -1
- data/spec/fixtures/nfce/lib/recipient#render-company.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-consumer_without_document.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-foreign.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-individual.pdf +0 -0
- data/spec/fixtures/nfce/lib/recipient#render-unidentified_consumer.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#does_not_render-payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-grouped_payment_methods.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-totals.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render-without_payment.pdf +0 -0
- data/spec/fixtures/nfce/lib/total_list#render.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf +568 -447
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/nfce-unauthorized-prod.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/rendered_nfce.fixture.pdf +0 -0
- data/spec/fixtures/nfce/v4.00/saved_nfce.fixture.pdf +0 -0
- data/spec/fixtures/qr_code/qr_code#render.pdf +0 -0
- data/spec/spec_helper.rb +1 -1
- metadata +118 -48
- data/lib/br_danfe/danfe_lib/nfce_lib/qr_code.rb +0 -25
- data/lib/br_danfe/danfe_lib/nfe_lib/cep.rb +0 -11
- data/spec/br_danfe/danfe_lib/nfce_lib/qr_code_spec.rb +0 -35
- data/spec/br_danfe/danfe_lib/nfe_lib/cep_spec.rb +0 -10
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/spec/spec_helper.rb
CHANGED
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.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ASSEINFO
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: barby
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 2.1.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 2.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: byebug
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,134 +123,168 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 11.1.3
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: guard
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: 2.18.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 2.18.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: rspec
|
140
|
+
name: guard-rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pdf-inspector
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 1.3.0
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 1.3.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rake
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
171
|
- - '='
|
144
172
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
173
|
+
version: 13.0.6
|
146
174
|
type: :development
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
178
|
- - '='
|
151
179
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
180
|
+
version: 13.0.6
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
182
|
+
name: rspec
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
156
184
|
requirements:
|
157
185
|
- - '='
|
158
186
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
187
|
+
version: 3.10.0
|
160
188
|
type: :development
|
161
189
|
prerelease: false
|
162
190
|
version_requirements: !ruby/object:Gem::Requirement
|
163
191
|
requirements:
|
164
192
|
- - '='
|
165
193
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
194
|
+
version: 3.10.0
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
|
-
name: rubocop
|
196
|
+
name: rubocop
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
170
198
|
requirements:
|
171
199
|
- - "~>"
|
172
200
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
201
|
+
version: 0.93.1
|
174
202
|
type: :development
|
175
203
|
prerelease: false
|
176
204
|
version_requirements: !ruby/object:Gem::Requirement
|
177
205
|
requirements:
|
178
206
|
- - "~>"
|
179
207
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
208
|
+
version: 0.93.1
|
181
209
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
210
|
+
name: rubocop-performance
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
|
-
- -
|
213
|
+
- - "~>"
|
186
214
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
215
|
+
version: 1.10.2
|
188
216
|
type: :development
|
189
217
|
prerelease: false
|
190
218
|
version_requirements: !ruby/object:Gem::Requirement
|
191
219
|
requirements:
|
192
|
-
- -
|
220
|
+
- - "~>"
|
193
221
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
222
|
+
version: 1.10.2
|
195
223
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
224
|
+
name: rubocop-rspec
|
197
225
|
requirement: !ruby/object:Gem::Requirement
|
198
226
|
requirements:
|
199
|
-
- -
|
227
|
+
- - "~>"
|
200
228
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
229
|
+
version: 1.44.1
|
202
230
|
type: :development
|
203
231
|
prerelease: false
|
204
232
|
version_requirements: !ruby/object:Gem::Requirement
|
205
233
|
requirements:
|
206
|
-
- -
|
234
|
+
- - "~>"
|
207
235
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
236
|
+
version: 1.44.1
|
209
237
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
238
|
+
name: simplecov
|
211
239
|
requirement: !ruby/object:Gem::Requirement
|
212
240
|
requirements:
|
213
|
-
- -
|
241
|
+
- - '='
|
214
242
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
243
|
+
version: 0.17.1
|
216
244
|
type: :development
|
217
245
|
prerelease: false
|
218
246
|
version_requirements: !ruby/object:Gem::Requirement
|
219
247
|
requirements:
|
220
|
-
- -
|
248
|
+
- - '='
|
221
249
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
250
|
+
version: 0.17.1
|
223
251
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
252
|
+
name: simplecov-html
|
225
253
|
requirement: !ruby/object:Gem::Requirement
|
226
254
|
requirements:
|
227
|
-
- -
|
255
|
+
- - '='
|
228
256
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
257
|
+
version: 0.10.2
|
230
258
|
type: :development
|
231
259
|
prerelease: false
|
232
260
|
version_requirements: !ruby/object:Gem::Requirement
|
233
261
|
requirements:
|
234
|
-
- -
|
262
|
+
- - '='
|
235
263
|
- !ruby/object:Gem::Version
|
236
|
-
version:
|
237
|
-
description:
|
264
|
+
version: 0.10.2
|
265
|
+
description:
|
238
266
|
email: asseinfo@asseinfo.com.br
|
239
|
-
executables:
|
267
|
+
executables:
|
268
|
+
- _guard-core
|
269
|
+
- guard
|
240
270
|
extensions: []
|
241
271
|
extra_rdoc_files: []
|
242
272
|
files:
|
243
273
|
- ".circleci/config.yml"
|
244
274
|
- ".codeclimate.yml"
|
275
|
+
- ".github/dependabot.yml"
|
245
276
|
- ".gitignore"
|
246
277
|
- ".rspec"
|
247
278
|
- ".rubocop.yml"
|
279
|
+
- ".tool-versions"
|
248
280
|
- Dockerfile
|
249
281
|
- Gemfile
|
250
282
|
- Gemfile.lock
|
251
283
|
- Guardfile
|
252
284
|
- README.md
|
253
285
|
- Rakefile
|
286
|
+
- bin/_guard-core
|
287
|
+
- bin/guard
|
254
288
|
- br_danfe.gemspec
|
255
289
|
- config/locales/pt-BR.yml
|
256
290
|
- docker-compose.yml
|
@@ -278,11 +312,9 @@ files:
|
|
278
312
|
- lib/br_danfe/danfe_lib/nfce_lib/key.rb
|
279
313
|
- lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
|
280
314
|
- lib/br_danfe/danfe_lib/nfce_lib/product_list.rb
|
281
|
-
- lib/br_danfe/danfe_lib/nfce_lib/qr_code.rb
|
282
315
|
- lib/br_danfe/danfe_lib/nfce_lib/recipient.rb
|
283
316
|
- lib/br_danfe/danfe_lib/nfce_lib/total_list.rb
|
284
317
|
- lib/br_danfe/danfe_lib/nfe.rb
|
285
|
-
- lib/br_danfe/danfe_lib/nfe_lib/cep.rb
|
286
318
|
- lib/br_danfe/danfe_lib/nfe_lib/consts.rb
|
287
319
|
- lib/br_danfe/danfe_lib/nfe_lib/cst.rb
|
288
320
|
- lib/br_danfe/danfe_lib/nfe_lib/dest.rb
|
@@ -305,6 +337,17 @@ files:
|
|
305
337
|
- lib/br_danfe/helper.rb
|
306
338
|
- lib/br_danfe/logo_config.rb
|
307
339
|
- lib/br_danfe/logo_options.rb
|
340
|
+
- lib/br_danfe/mdfe.rb
|
341
|
+
- lib/br_danfe/mdfe_lib/authorization_protocol.rb
|
342
|
+
- lib/br_danfe/mdfe_lib/document.rb
|
343
|
+
- lib/br_danfe/mdfe_lib/drivers.rb
|
344
|
+
- lib/br_danfe/mdfe_lib/fisco_control.rb
|
345
|
+
- lib/br_danfe/mdfe_lib/header.rb
|
346
|
+
- lib/br_danfe/mdfe_lib/mdfe_identification.rb
|
347
|
+
- lib/br_danfe/mdfe_lib/notes.rb
|
348
|
+
- lib/br_danfe/mdfe_lib/totalizer.rb
|
349
|
+
- lib/br_danfe/mdfe_lib/vehicles.rb
|
350
|
+
- lib/br_danfe/qr_code.rb
|
308
351
|
- lib/br_danfe/uf.rb
|
309
352
|
- lib/br_danfe/version.rb
|
310
353
|
- lib/br_danfe/xml.rb
|
@@ -325,11 +368,9 @@ files:
|
|
325
368
|
- spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb
|
326
369
|
- spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb
|
327
370
|
- spec/br_danfe/danfe_lib/nfce_lib/product_list_spec.rb
|
328
|
-
- spec/br_danfe/danfe_lib/nfce_lib/qr_code_spec.rb
|
329
371
|
- spec/br_danfe/danfe_lib/nfce_lib/recipient_spec.rb
|
330
372
|
- spec/br_danfe/danfe_lib/nfce_lib/total_list_spec.rb
|
331
373
|
- spec/br_danfe/danfe_lib/nfce_spec.rb
|
332
|
-
- spec/br_danfe/danfe_lib/nfe_lib/cep_spec.rb
|
333
374
|
- spec/br_danfe/danfe_lib/nfe_lib/cst_spec.rb
|
334
375
|
- spec/br_danfe/danfe_lib/nfe_lib/dest_spec.rb
|
335
376
|
- spec/br_danfe/danfe_lib/nfe_lib/det_body_spec.rb
|
@@ -352,6 +393,17 @@ files:
|
|
352
393
|
- spec/br_danfe/helper_spec.rb
|
353
394
|
- spec/br_danfe/logo_config_spec.rb
|
354
395
|
- spec/br_danfe/logo_options_spec.rb
|
396
|
+
- spec/br_danfe/mdfe_lib/authorization_protocol_spec.rb
|
397
|
+
- spec/br_danfe/mdfe_lib/document_spec.rb
|
398
|
+
- spec/br_danfe/mdfe_lib/drivers_spec.rb
|
399
|
+
- spec/br_danfe/mdfe_lib/fisco_control_spec.rb
|
400
|
+
- spec/br_danfe/mdfe_lib/header_spec.rb
|
401
|
+
- spec/br_danfe/mdfe_lib/mdfe_identification_spec.rb
|
402
|
+
- spec/br_danfe/mdfe_lib/notes_spec.rb
|
403
|
+
- spec/br_danfe/mdfe_lib/totalizer_spec.rb
|
404
|
+
- spec/br_danfe/mdfe_lib/vehicles_spec.rb
|
405
|
+
- spec/br_danfe/mdfe_spec.rb
|
406
|
+
- spec/br_danfe/qr_code_spec.rb
|
355
407
|
- spec/br_danfe/uf_spec.rb
|
356
408
|
- spec/br_danfe/xml_spec.rb
|
357
409
|
- spec/fixtures/cce/lib/barcode#render.pdf
|
@@ -370,6 +422,23 @@ files:
|
|
370
422
|
- spec/fixtures/cce/v1.00/cce.fixture.pdf
|
371
423
|
- spec/fixtures/cce/v1.00/cce.xml
|
372
424
|
- spec/fixtures/logo.png
|
425
|
+
- spec/fixtures/mdfe/lib/document#render.pdf
|
426
|
+
- spec/fixtures/mdfe/lib/document#text.align.pdf
|
427
|
+
- spec/fixtures/mdfe/lib/document#text.pad.pdf
|
428
|
+
- spec/fixtures/mdfe/lib/document#text.simple.pdf
|
429
|
+
- spec/fixtures/mdfe/lib/document#text.size.pdf
|
430
|
+
- spec/fixtures/mdfe/lib/document#text.style.pdf
|
431
|
+
- spec/fixtures/mdfe/lib/fisco_control#barcode.pdf
|
432
|
+
- spec/fixtures/mdfe/lib/fisco_control#without-barcode.pdf
|
433
|
+
- spec/fixtures/mdfe/lib/header#render-qr-code.pdf
|
434
|
+
- spec/fixtures/mdfe/lib/header#render-with_logo.pdf
|
435
|
+
- spec/fixtures/mdfe/lib/header#render-without-qr-code.pdf
|
436
|
+
- spec/fixtures/mdfe/lib/header#render-without_logo.pdf
|
437
|
+
- spec/fixtures/mdfe/lib/mdfe-with-multiple-pages.pdf
|
438
|
+
- spec/fixtures/mdfe/lib/mdfe.fixture.pdf
|
439
|
+
- spec/fixtures/mdfe/lib/notes#render-big-aditional-information.pdf
|
440
|
+
- spec/fixtures/mdfe/lib/xml-mdfe-multiples-pages.xml
|
441
|
+
- spec/fixtures/mdfe/lib/xml-mdfe.xml
|
373
442
|
- spec/fixtures/nfce/lib/document#render.pdf
|
374
443
|
- spec/fixtures/nfce/lib/footer#render-with_additional_information.pdf
|
375
444
|
- spec/fixtures/nfce/lib/footer#render.pdf
|
@@ -484,13 +553,14 @@ files:
|
|
484
553
|
- spec/fixtures/nfe/v3.10/with_three_pages.xml
|
485
554
|
- spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf
|
486
555
|
- spec/fixtures/nfe/v3.10/without_issqn.xml
|
556
|
+
- spec/fixtures/qr_code/qr_code#render.pdf
|
487
557
|
- spec/spec_helper.rb
|
488
558
|
- spec/support/have_same_content_of.rb
|
489
559
|
homepage: http://github.com/asseinfo/br_danfe
|
490
560
|
licenses:
|
491
561
|
- MIT
|
492
562
|
metadata: {}
|
493
|
-
post_install_message:
|
563
|
+
post_install_message:
|
494
564
|
rdoc_options: []
|
495
565
|
require_paths:
|
496
566
|
- lib
|
@@ -498,7 +568,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
498
568
|
requirements:
|
499
569
|
- - ">="
|
500
570
|
- !ruby/object:Gem::Version
|
501
|
-
version: 2.
|
571
|
+
version: '2.6'
|
502
572
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
503
573
|
requirements:
|
504
574
|
- - ">="
|
@@ -506,7 +576,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
506
576
|
version: '0'
|
507
577
|
requirements: []
|
508
578
|
rubygems_version: 3.1.6
|
509
|
-
signing_key:
|
579
|
+
signing_key:
|
510
580
|
specification_version: 4
|
511
581
|
summary: DANFE pdf generator for Brazilian invoices.
|
512
582
|
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module BrDanfe
|
2
|
-
module DanfeLib
|
3
|
-
module NfceLib
|
4
|
-
class QrCode
|
5
|
-
require 'rqrcode'
|
6
|
-
require 'chunky_png'
|
7
|
-
require 'tempfile'
|
8
|
-
|
9
|
-
def initialize(pdf, xml)
|
10
|
-
@pdf = pdf
|
11
|
-
@xml = xml
|
12
|
-
end
|
13
|
-
|
14
|
-
def render
|
15
|
-
qrcode = RQRCode::QRCode.new(@xml['qrCode'])
|
16
|
-
image = Tempfile.new(%w[qrcode png], binmode: true)
|
17
|
-
image.write(qrcode.as_png(module_px_size: 12).to_s)
|
18
|
-
|
19
|
-
box_size = 3.cm
|
20
|
-
@pdf.image image, width: box_size, height: box_size, position: :center
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe BrDanfe::DanfeLib::NfceLib::QrCode do
|
4
|
-
let(:base_dir) { './spec/fixtures/nfce/lib/' }
|
5
|
-
let(:output_pdf) { "#{base_dir}output.pdf" }
|
6
|
-
|
7
|
-
let(:pdf) { BrDanfe::DanfeLib::NfceLib::Document.new(8.cm, 5.cm) }
|
8
|
-
|
9
|
-
let(:xml) do
|
10
|
-
xml = <<-eos
|
11
|
-
<infNFeSupl>
|
12
|
-
<qrCode><![CDATA[http://sistemas.sefaz.am.gov.br/nfceweb/consultarNFCe.jsp?p=13130901144012000152651231234567891123456786|2|2|1|A604FD51E40ED8465B787B3E9CF8C1D90E61DB13]]></qrCode>
|
13
|
-
<urlChave>www.sefaz.am.gov.br/nfce/consulta</urlChave>
|
14
|
-
</infNFeSupl>
|
15
|
-
eos
|
16
|
-
|
17
|
-
BrDanfe::XML.new(xml)
|
18
|
-
end
|
19
|
-
|
20
|
-
subject { described_class.new pdf, xml }
|
21
|
-
|
22
|
-
describe '#render' do
|
23
|
-
before do
|
24
|
-
subject.render
|
25
|
-
File.delete(output_pdf) if File.exist?(output_pdf)
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'renders qr-code to the pdf' do
|
29
|
-
expect(File.exist?(output_pdf)).to be_falsey
|
30
|
-
pdf.render_file output_pdf
|
31
|
-
|
32
|
-
expect("#{base_dir}qr_code#render.pdf").to have_same_content_of file: output_pdf
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|