ruby-nfe 0.0.1 → 0.0.2

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: 9831937f61dc95bd11d461006e90f7f146889d65
4
- data.tar.gz: 829c3d9d331d8ba4496ba850c213fa22ef515a3d
3
+ metadata.gz: 3fb335eb560231f2d44ef6538e7c8964c6601d9c
4
+ data.tar.gz: 1b052433e8db80b96b16916bbb5cdbfd4f7011b0
5
5
  SHA512:
6
- metadata.gz: 6ea4fa1f0079d4025077da17da7d659ca9a746443ca56c57435de334bc54eae70fe08fc6edad0087641885b42c95064b1a5907c0e3bc4fc279831a80eed5ff9b
7
- data.tar.gz: 3c37d59461509a2003510f0f5f9f7c63fc13e258886c401e628e83f64a57e654eb001842584c84ab6faacaf70f0c70027b0d95956e2b49d2539ea4f34bd6a863
6
+ metadata.gz: d9f48181dfa4c7769d9c01ef2cb643b365594ecad3d621af38f6b30a849938848e0f4fd5c2bfccc0cfe1d06f99f4c2708a1907656cc99679ba18726c2aa37a1c
7
+ data.tar.gz: d26df46eb1fea1af2c77edae4679449be72cf73c21ac873052eeaa82cddae0abaf62b700bd42cec0c8da82cdc7736ae5bb8ba54efb3bd5a569f5e3caf2d81e1c
data/lib/nfe.rb CHANGED
@@ -15,6 +15,7 @@ require 'nfe/entidades/infNFe/transp/transportadora.rb'
15
15
  require 'nfe/entidades/infNFe/transp/veiculo.rb'
16
16
  require 'nfe/entidades/infNFe/transp/volume.rb'
17
17
  require 'nfe/entidades/infNFe/infAdic/info.rb'
18
+ require 'nfe/entidades/protNFe/infProt.rb'
18
19
 
19
20
 
20
21
 
@@ -11,6 +11,7 @@ module NFe
11
11
  attr_accessor :veiculo
12
12
  attr_accessor :vol
13
13
  attr_accessor :info
14
+ attr_accessor :infoProt
14
15
 
15
16
  def initializer
16
17
  #@versao_processo_emissao = Nfe::Config::Params::VERSAO_PADRAO
@@ -24,6 +25,7 @@ module NFe
24
25
  @veiculo = NFe::Veiculo.new
25
26
  @vol = NFe::Volume.new
26
27
  @info = NFe::Info.new
28
+ @infoProt = NFe::InfoProtocolo.new
27
29
  @versao = '2.0' #criar uma constante em params da versao da NF-e
28
30
  end
29
31
 
@@ -37,6 +39,7 @@ module NFe
37
39
  self.veiculo = NFe::Veiculo.new
38
40
  self.vol = NFe::Volume.new
39
41
  self.info = NFe::Info.new
42
+ self.infoProt = NFe::InfoProtocolo.new
40
43
  produto = Produto.new
41
44
  produto.xml_to_hash(file)
42
45
 
@@ -49,6 +52,7 @@ module NFe
49
52
  self.veiculo.serialize(@veiculo.xml_to_hash(doc.elements.css('transp/veicTransp')))
50
53
  self.vol.serialize(@vol.xml_to_hash(doc.elements.css('transp/vol')))
51
54
  self.info.serialize(@info.xml_to_hash(doc.elements.css('infAdic')))
55
+ self.infoProt.serialize(@infoProt.xml_to_hash(doc.elements.css('protNFe/infProt')))
52
56
  self.prod = produto.all_products
53
57
  self
54
58
 
@@ -0,0 +1,39 @@
1
+ # encoding: UTF-8
2
+ module NFe
3
+ class InfoProtocolo < NFe::EntidadeNFe
4
+ xml_name :infProt
5
+ attr_accessor :tpAmb
6
+ attr_accessor :verAplic
7
+ attr_accessor :chNFe
8
+ attr_accessor :dhRecbto
9
+ attr_accessor :nProt
10
+ attr_accessor :digVal
11
+ attr_accessor :cStat
12
+ attr_accessor :xMotivo
13
+
14
+ def attributes
15
+ @attributes = {
16
+ "tpAmb" => tpAmb,
17
+ "verAplic" => verAplic,
18
+ "chNFe" => chNFe,
19
+ "dhRecbto" => dhRecbto,
20
+ "nProt" => nProt,
21
+ "cStat" => cStat,
22
+ "xMotivo" => xMotivo
23
+ }
24
+ end
25
+
26
+ def attributes=(params)
27
+ @attributes = {
28
+ "tpAmb" => params["tpAmb"],
29
+ "verAplic" => params["verAplic"],
30
+ "chNFe" => params["chNFe"],
31
+ "dhRecbto" => params["dhRecbto"],
32
+ "nProt" => params["nProt"],
33
+ "cStat" => params["cStat"],
34
+ "xMotivo" => params["xMotivo"]
35
+ }
36
+ end
37
+
38
+ end
39
+ end
data/lib/nfe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module NFe
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-nfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor C. Batista
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,6 +88,7 @@ files:
88
88
  - lib/nfe/entidades/infNFe/transp/transportadora.rb
89
89
  - lib/nfe/entidades/infNFe/transp/veiculo.rb
90
90
  - lib/nfe/entidades/infNFe/transp/volume.rb
91
+ - lib/nfe/entidades/protNFe/infProt.rb
91
92
  - lib/nfe/version.rb
92
93
  - nfe.gemspec
93
94
  homepage: https://github.com/igorcb/ruby-nfe