fm_timbrado_cfdi 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2582e25a56146d9dc81168d01ee98697244367b
4
- data.tar.gz: 2c34955c53b3db7c4c21f8540259510924421991
3
+ metadata.gz: 89cd03bc7bf2f58390477d7a1512cb0c02948afa
4
+ data.tar.gz: 989a8a71fc06753db2016b1aca6d5e45dd4bff29
5
5
  SHA512:
6
- metadata.gz: fb32a28f691f19aef58e428385bbc3299a4b0dcdc146fdfc790f787ffa23b1797c3b7d6ed93bd08046fd8c1964da7ec6b4354c00a8a03c7e3d1616d8ebed6813
7
- data.tar.gz: 7de560ae159cc58026ad86e2a4b2e45894a523cc0996d3f0319d895f0d7fc0afc1918156c9c04296b312f10d12541bac9b61be1de4f22e86248b9c09bef2f76d
6
+ metadata.gz: d8348f8b2703b5f718d3cc1488c45dcb0d57ad9a8decfb73f52f9131d999432c071340b562b343e00ceb5af30cec0fa94fe1004c3eb20babafcc48ec4f46a391
7
+ data.tar.gz: bce2590e41caec15a8cfecc3b8ce94e65b9bc2c3a000c1e754fc566ca3e472c8ac411e8ae23591c84be7f9cec3f1a16c504f1cc4552e976e83f23b8971385647
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'coveralls', require: false
4
+ gem 'rake'
4
5
  # Specify your gem's dependencies in fm_timbrado_cfdi.gemspec
5
6
  gemspec
@@ -3,7 +3,7 @@ require 'nokogiri'
3
3
 
4
4
  module FmTimbradoCfdi
5
5
  class FmTimbre
6
- attr_reader :no_certificado_sat, :fecha_timbrado, :uuid, :sello_sat, :sello_cfd, :fecha_comprobante, :serie, :folio, :trans_id
6
+ attr_reader :no_certificado_sat, :no_certificado, :fecha_timbrado, :uuid, :sello_sat, :sello_cfd, :fecha_comprobante, :serie, :folio, :trans_id, :version
7
7
 
8
8
  def initialize ( nodo_timbre )
9
9
  parse( nodo_timbre )
@@ -17,6 +17,10 @@ module FmTimbradoCfdi
17
17
  end
18
18
  end
19
19
 
20
+ def cadena_original
21
+ "||#{version}|#{uuid}|#{fecha_timbrado}|#{sello_cfd}|#{no_certificado_sat}||"
22
+ end
23
+
20
24
  private
21
25
 
22
26
  def generar_namespaces(xml)
@@ -30,7 +34,9 @@ module FmTimbradoCfdi
30
34
 
31
35
  def atributos
32
36
  [ 'trans_id',
37
+ 'version',
33
38
  'no_certificado_sat',
39
+ 'no_certificado',
34
40
  'fecha_timbrado',
35
41
  'uuid',
36
42
  'sello_sat',
@@ -40,6 +46,18 @@ module FmTimbradoCfdi
40
46
  'folio' ]
41
47
  end
42
48
 
49
+ def obtener_version(xml,ns)
50
+ xml.xpath("//tfd:TimbreFiscalDigital", ns).attribute('version').value rescue nil
51
+ end
52
+
53
+ def obtener_no_certificado(xml,ns)
54
+ xml.xpath("//cfdi:Comprobante",ns).attribute('noCertificado').value rescue nil
55
+ end
56
+
57
+ def obtener_trans_id(xml,ns)
58
+ xml.xpath("//cfdi:Comprobante",ns).attribute('TransID').value rescue nil
59
+ end
60
+
43
61
  def obtener_trans_id(xml,ns)
44
62
  xml.xpath("//cfdi:Comprobante",ns).attribute('TransID').value rescue nil
45
63
  end
@@ -1,3 +1,3 @@
1
1
  module FmTimbradoCfdi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -12,5 +12,6 @@ describe FmTimbradoCfdi::FmTimbre do
12
12
  it { timbre.uuid.should_not be_nil }
13
13
  it { timbre.sello_sat.should_not be_nil }
14
14
  it { timbre.sello_cfd.should_not be_nil }
15
+ it { timbre.cadena_original.should_not be_nil }
15
16
  end
16
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fm_timbrado_cfdi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos García
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-02 00:00:00.000000000 Z
13
+ date: 2014-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -130,4 +130,3 @@ test_files:
130
130
  - spec/fm_timbrado_cfdi/fm_timbre_spec.rb
131
131
  - spec/fm_timbrado_cfdi_spec.rb
132
132
  - spec/spec_helper.rb
133
- has_rdoc: