br_invoices_pdf 0.2.21 → 0.2.22
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb69bab668fd1a482a8b9ae5137f8e5be01ddae1
|
4
|
+
data.tar.gz: 0b181f5e7684a9c2449d3fdf0e9a9a6e48ef47b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d43a9c4355407927bac60d98e8a0e1afe3eaaecda42c8dd9463de0acca2868b42905f99a1bcd4a636919021bde3ac05e806c8662a23f10a3d20f8e94e6c267fe
|
7
|
+
data.tar.gz: 396c412360088e6819bcec997f734e0c6a4fbbb3ae34d8456c895599e8f40c6af6c27c3299f8d57ecf685e807e9e20cabaa9d6cd39cd52ea3b00ac12def06d75
|
@@ -8,14 +8,9 @@ module BrInvoicesPdf
|
|
8
8
|
|
9
9
|
module_function
|
10
10
|
|
11
|
-
FIELDS = { code: 'cProd',
|
12
|
-
|
13
|
-
|
14
|
-
quantity: 'qCom',
|
15
|
-
unit_label: 'uCom',
|
16
|
-
total_value: 'vProd',
|
17
|
-
unit_value: 'vUnCom',
|
18
|
-
item_value: 'vItem' }.freeze
|
11
|
+
FIELDS = { code: 'cProd', description: 'xProd', cfop: 'CFOP',
|
12
|
+
quantity: 'qCom', unit_label: 'uCom', total_value: 'vProd',
|
13
|
+
unit_value: 'vUnCom', item_value: 'vItem' }.freeze
|
19
14
|
|
20
15
|
def execute(xml)
|
21
16
|
node_products = xml.locate('infCFe/det')
|
@@ -29,7 +24,11 @@ module BrInvoicesPdf
|
|
29
24
|
|
30
25
|
def product_by(element)
|
31
26
|
FIELDS
|
32
|
-
.map
|
27
|
+
.map do |(key, field)|
|
28
|
+
[key, node_locate(element, field).force_encoding('windows-1252')
|
29
|
+
.force_encoding('UTF-8')
|
30
|
+
.encode('UTF-8')]
|
31
|
+
end
|
33
32
|
.to_h
|
34
33
|
end
|
35
34
|
private_class_method :product_by
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: br_invoices_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thiago Ribeiro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: barby
|