cfdi40 0.0.3 → 0.0.4
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 +3 -3
- data/lib/cfdi40/comprobante.rb +7 -6
- data/lib/cfdi40/node.rb +2 -0
- data/lib/cfdi40/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c93f265a23f6c466d800ce90e2258525844b3f15451971b0140f8c2ee826d2c5
|
|
4
|
+
data.tar.gz: 1fcd506dfa5eefbffa1fec8ad3e98543cbc0045936859ca171b42caf46ff6649
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a13afec5754aeb24cf6168f66b23b658e79cb8d8cbf93c74a11bc592ae5913f77b3d6d5da45e19b69384c94a9221bb4f7b9897e0bc6672f7360b71a0538d759
|
|
7
|
+
data.tar.gz: 473a8ce2434b628e1fb61e8342cbdcdc1972fb00350a382e5b2b113c0d16018b804cd6d05438a2b26ddb54ba121491f9df94a75f976247eea682d7fcd7e461f2
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cfdi40 (0.0.
|
|
4
|
+
cfdi40 (0.0.4)
|
|
5
5
|
nokogiri (>= 1.10.10)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -10,12 +10,12 @@ GEM
|
|
|
10
10
|
ast (2.4.2)
|
|
11
11
|
json (2.3.1)
|
|
12
12
|
minitest (5.15.0)
|
|
13
|
-
nokogiri (1.
|
|
13
|
+
nokogiri (1.14.2-x86_64-linux)
|
|
14
14
|
racc (~> 1.4)
|
|
15
15
|
parallel (1.20.1)
|
|
16
16
|
parser (3.1.2.1)
|
|
17
17
|
ast (~> 2.4.1)
|
|
18
|
-
racc (1.6.
|
|
18
|
+
racc (1.6.2)
|
|
19
19
|
rainbow (3.0.0)
|
|
20
20
|
rake (13.0.6)
|
|
21
21
|
regexp_parser (1.8.2)
|
data/lib/cfdi40/comprobante.rb
CHANGED
|
@@ -19,11 +19,11 @@ module Cfdi40
|
|
|
19
19
|
define_attribute :no_certificado, xml_attribute: 'NoCertificado'
|
|
20
20
|
define_attribute :certificado, xml_attribute: 'Certificado'
|
|
21
21
|
define_attribute :condiciones_de_pago, xml_attribute: 'CondicionesDePago'
|
|
22
|
-
define_attribute :subtotal, xml_attribute: 'SubTotal', format: :
|
|
23
|
-
define_attribute :descuento, xml_attribute: 'Descuento', format: :
|
|
22
|
+
define_attribute :subtotal, xml_attribute: 'SubTotal', format: :t_ImporteMXN
|
|
23
|
+
define_attribute :descuento, xml_attribute: 'Descuento', format: :t_ImporteMXN
|
|
24
24
|
define_attribute :moneda, xml_attribute: 'Moneda', default: 'MXN'
|
|
25
25
|
define_attribute :tipo_cambio, xml_attribute: 'TipoCambio'
|
|
26
|
-
define_attribute :total, xml_attribute: 'Total', format: :
|
|
26
|
+
define_attribute :total, xml_attribute: 'Total', format: :t_ImporteMXN
|
|
27
27
|
define_attribute :tipo_de_comprobante, xml_attribute: 'TipoDeComprobante', default: 'I'
|
|
28
28
|
define_attribute :exportacion, xml_attribute: 'Exportacion', default: '01'
|
|
29
29
|
define_attribute :metodo_pago, xml_attribute: 'MetodoPago'
|
|
@@ -133,7 +133,8 @@ module Cfdi40
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def original_content
|
|
136
|
-
|
|
136
|
+
xslt_path = File.join(File.dirname(__FILE__), '..', '..', 'lib/xslt/cadenaoriginal_local.xslt')
|
|
137
|
+
xslt = Nokogiri::XSLT(File.open(xslt_path))
|
|
137
138
|
transformed = xslt.transform(docxml)
|
|
138
139
|
# The ampersand (&) char must be used in original content
|
|
139
140
|
# even though the documentation indicates otherwise
|
|
@@ -226,10 +227,10 @@ module Cfdi40
|
|
|
226
227
|
end
|
|
227
228
|
|
|
228
229
|
def load_private_key
|
|
229
|
-
return unless defined?(@key_data)
|
|
230
|
+
return unless defined?(@key_data)
|
|
230
231
|
|
|
231
232
|
@sat_csd ||= SatCsd.new
|
|
232
|
-
@sat_csd.set_private_key(@key_data, @key_pass)
|
|
233
|
+
@sat_csd.set_private_key(@key_data, (defined?(@key_pass) ? @key_pass : nil))
|
|
233
234
|
end
|
|
234
235
|
end
|
|
235
236
|
end
|
data/lib/cfdi40/node.rb
CHANGED
data/lib/cfdi40/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cfdi40
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Israel Benítez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-03-
|
|
11
|
+
date: 2023-03-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|