ruby-nfe 0.0.2 → 0.0.3

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: 3fb335eb560231f2d44ef6538e7c8964c6601d9c
4
- data.tar.gz: 1b052433e8db80b96b16916bbb5cdbfd4f7011b0
3
+ metadata.gz: 06b536d1fbc2592d67401dee5e27d09ba4ca1eeb
4
+ data.tar.gz: ca9319e219bbbe8e943686f549904b03444539c6
5
5
  SHA512:
6
- metadata.gz: d9f48181dfa4c7769d9c01ef2cb643b365594ecad3d621af38f6b30a849938848e0f4fd5c2bfccc0cfe1d06f99f4c2708a1907656cc99679ba18726c2aa37a1c
7
- data.tar.gz: d26df46eb1fea1af2c77edae4679449be72cf73c21ac873052eeaa82cddae0abaf62b700bd42cec0c8da82cdc7736ae5bb8ba54efb3bd5a569f5e3caf2d81e1c
6
+ metadata.gz: b0ba90baaac6cc0685975eb0fd570865a6d9efc70bf28b646abfd23d0a0bfb31b74a82218b18b07c1f1b53457fdbca491af6752011e9c4a0c47e5c5f9c165e10
7
+ data.tar.gz: 9b6403a54271583e7efd48aae09ad3bc54fc2bba8cef60f9f320fde9fe79201b03ed417b752f90e1987700b4b127eb9b694a52299fc8a673e5c6996fd4e17299
data/lib/nfe.rb CHANGED
@@ -11,6 +11,7 @@ require 'nfe/entidades/infNFe/dest/destinatario.rb'
11
11
  require 'nfe/entidades/infNFe/dest/endereco_destinatario.rb'
12
12
  require 'nfe/entidades/infNFe/det/produto.rb'
13
13
  require 'nfe/entidades/infNFe/det/imposto.rb'
14
+ require 'nfe/entidades/infNFe/total/icmstot.rb'
14
15
  require 'nfe/entidades/infNFe/transp/transportadora.rb'
15
16
  require 'nfe/entidades/infNFe/transp/veiculo.rb'
16
17
  require 'nfe/entidades/infNFe/transp/volume.rb'
@@ -7,6 +7,7 @@ module NFe
7
7
  attr_accessor :emit
8
8
  attr_accessor :dest
9
9
  attr_accessor :prod
10
+ attr_accessor :icms_tot
10
11
  attr_accessor :transp
11
12
  attr_accessor :veiculo
12
13
  attr_accessor :vol
@@ -21,6 +22,7 @@ module NFe
21
22
  @dest = NFe::Destinatario.new
22
23
  @dest.endereco_destinatario = NFe::EnderecoDesinatario.new
23
24
  @prod = []
25
+ @icms_tot = NFe::IcmsTot.new
24
26
  @transp = NFe::Transportadora.new
25
27
  @veiculo = NFe::Veiculo.new
26
28
  @vol = NFe::Volume.new
@@ -35,6 +37,7 @@ module NFe
35
37
  self.emit = NFe::Emitente.new
36
38
  self.dest = NFe::Destinatario.new
37
39
  self.emit.endereco_emitente = NFe::EnderecoEmitente.new
40
+ self.icms_tot = NFe::IcmsTot.new
38
41
  self.transp = NFe::Transportadora.new
39
42
  self.veiculo = NFe::Veiculo.new
40
43
  self.vol = NFe::Volume.new
@@ -48,6 +51,7 @@ module NFe
48
51
  self.emit.endereco_emitente = NFe::EnderecoEmitente.new.xml_to_hash(doc.elements.css('emit'))
49
52
  self.dest.serialize(@dest.xml_to_hash(doc.elements.css('dest')))
50
53
  self.dest.endereco_destinatario = NFe::EnderecoDestinatario.new.xml_to_hash(doc.elements.css('dest'))
54
+ self.icms_tot.serialize(@icms_tot.xml_to_hash(doc.elements.css('total/ICMSTot')))
51
55
  self.transp.serialize(@transp.xml_to_hash(doc.elements.css('transp/transporta')))
52
56
  self.veiculo.serialize(@veiculo.xml_to_hash(doc.elements.css('transp/veicTransp')))
53
57
  self.vol.serialize(@vol.xml_to_hash(doc.elements.css('transp/vol')))
@@ -0,0 +1,118 @@
1
+ # encoding: UTF-8
2
+ module NFe
3
+ class IcmsTot < NFe::EntidadeNFe
4
+ attr_accessor :vBC
5
+ attr_accessor :vICMS
6
+ attr_accessor :vICMSDeson
7
+ attr_accessor :vFCPUFDest
8
+ attr_accessor :vICMSUFDest
9
+ attr_accessor :vICMSUFRemet
10
+ attr_accessor :vBCST
11
+ attr_accessor :vST
12
+ attr_accessor :vProd
13
+ attr_accessor :vFrete
14
+ attr_accessor :vSeg
15
+ attr_accessor :vDesc
16
+ attr_accessor :vII
17
+ attr_accessor :vIPI
18
+ attr_accessor :vPIS
19
+ attr_accessor :vCOFINS
20
+ attr_accessor :vOutro
21
+ attr_accessor :vNF
22
+ attr_accessor :vTotTrib
23
+
24
+ def initialize(attrs = {})
25
+ self.vBC = attrs[:vBC]
26
+ self.vICMS = attrs[:vICMS]
27
+ self.vICMSDeson = attrs[:vICMSDeson]
28
+ self.vFCPUFDest = attrs[:vFCPUFDest]
29
+ self.vICMSUFDest = attrs[:vICMSUFDest]
30
+ self.vICMSUFRemet = attrs[:vICMSUFRemet]
31
+ self.vBCST = attrs[:vBCST]
32
+ self.vST = attrs[:vST]
33
+ self.vProd = attrs[:vProd]
34
+ self.vFrete = attrs[:vFrete]
35
+ self.vSeg = attrs[:vSeg]
36
+ self.vDesc = attrs[:vDesc]
37
+ self.vII = attrs[:vII]
38
+ self.vIPI = attrs[:vIPI]
39
+ self.vPIS = attrs[:vPIS]
40
+ self.vCOFINS = attrs[:vCOFINS]
41
+ self.vOutro = attrs[:vOutro]
42
+ self.vNF = attrs[:vNF]
43
+ self.vTotTrib = attrs[:vTotTrib]
44
+ end
45
+
46
+ def attributes
47
+ @attributes = {
48
+ "vBC" => vBC,
49
+ "vICMS" => vICMS,
50
+ "vICMSDeson" => vICMSDeson,
51
+ "vFCPUFDest" => vFCPUFDest,
52
+ "vICMSUFDest" => vICMSUFDest,
53
+ "vICMSUFRemet" => vICMSUFRemet,
54
+ "vBCST" => vBCST,
55
+ "vST" => vST,
56
+ "vProd" => vProd,
57
+ "vFrete" => vFrete,
58
+ "vSeg" => vSeg,
59
+ "vDesc" => vDesc,
60
+ "vII" => vII,
61
+ "vIPI" => vIPI,
62
+ "vPIS" => vPIS,
63
+ "vCOFINS" => vCOFINS,
64
+ "vOutro" => vOutro,
65
+ "vNF" => vNF,
66
+ "vTotTrib" => vTotTrib
67
+ }
68
+ end
69
+
70
+ def attributes=(params)
71
+ self.vBC = params['vBC'],
72
+ self.vICMS = params['vICMS'],
73
+ self.vICMSDeson = params['vICMSDeson'],
74
+ self.vFCPUFDest = params['vFCPUFDest'],
75
+ self.vICMSUFDest = params['vICMSUFDest'],
76
+ self.vICMSUFRemet = params['vICMSUFRemet'],
77
+ self.vBCST = params['vBCST'],
78
+ self.vST = params['vST'],
79
+ self.vProd = params['vProd'],
80
+ self.vFrete = params['vFrete'],
81
+ self.vSeg = params['vSeg'],
82
+ self.vDesc = params['vDesc'],
83
+ self.vII = params['vII'],
84
+ self.vIPI = params['vIPI'],
85
+ self.vPIS = params['vPIS'],
86
+ self.vCOFINS = params['vCOFINS'],
87
+ self.vOutro = params['vOutro'],
88
+ self.vNF = params['vNF'],
89
+ self.vTotTrib = params['vTotTrib']
90
+ end
91
+
92
+ # def xml_to_hash(xml) #node XML
93
+ # xml.children.css('enderDest').each do |p|
94
+ # self.vBC = p.css('vBC').text
95
+ # self.vICMS = p.css('vICMS').text
96
+ # self.vICMSDeson = p.css('vICMSDeson').text
97
+ # self.vFCPUFDest = p.css('vFCPUFDest').text
98
+ # self.vICMSUFDest = p.css('vICMSUFDest').text
99
+ # self.vICMSUFRemet = p.css('vICMSUFRemet').text
100
+ # self.vBCST = p.css('vBCST').text
101
+ # self.vST = p.css('vST').text
102
+ # self.vProd = p.css('vProd').text
103
+ # self.vFrete = p.css('vFrete').text
104
+ # self.vSeg = p.css('vSeg').text
105
+ # self.vDesc = p.css('vDesc').text
106
+ # self.vII = p.css('vII').text
107
+ # self.vIPI = p.css('vIPI').text
108
+ # self.vPIS = p.css('vPIS').text
109
+ # self.vCOFINS = p.css('vCOFINS').text
110
+ # self.vOutro = p.css('vOutro').text
111
+ # self.vNF = p.css('vNF').text
112
+ # self.vTotTrib = p.css('vTotTrib').text
113
+
114
+ # end
115
+ # self
116
+ # end
117
+ end
118
+ end
@@ -1,3 +1,3 @@
1
1
  module NFe
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
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.2
4
+ version: 0.0.3
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-30 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,6 +85,7 @@ files:
85
85
  - lib/nfe/entidades/infNFe/ide/identificacao_nfe.rb
86
86
  - lib/nfe/entidades/infNFe/infAdic/info.rb
87
87
  - lib/nfe/entidades/infNFe/nota_fiscal.rb
88
+ - lib/nfe/entidades/infNFe/total/icmstot.rb
88
89
  - lib/nfe/entidades/infNFe/transp/transportadora.rb
89
90
  - lib/nfe/entidades/infNFe/transp/veiculo.rb
90
91
  - lib/nfe/entidades/infNFe/transp/volume.rb