enotas_nfe 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/lib/enotas_nfe/connection.rb +1 -1
- data/lib/enotas_nfe/endpoints.rb +1 -1
- data/lib/enotas_nfe/model/cofins.rb +3 -0
- data/lib/enotas_nfe/model/nfe.rb +1 -0
- data/lib/enotas_nfe/model/pis.rb +3 -0
- data/lib/enotas_nfe/model/valor_imposto.rb +12 -0
- data/lib/enotas_nfe/request.rb +2 -2
- data/lib/enotas_nfe/version.rb +1 -1
- data/lib/enotas_nfe.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88b73f75a045a75f3b7ac985a8e8668cd4485d5c
|
4
|
+
data.tar.gz: 4e60f2b790e5139f8c3cc1689e8414aaa51599fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e9af4694012e2785aeb2c4a5ba1c81155610a8110fcdb91b6dc411decdf67776d9b7cda2c82e50799e675eb091247a852eedd6f2ba9b947270f1deb3dd4607d
|
7
|
+
data.tar.gz: 7afd65b1ede9b7dd8bfadd289e1c1abf92163df33b3032ceee855628119913ae90ce82aac0c54f5b97ff7df13af496890c45e19b1f72c7cc33fc244f7bf96285
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ Ou instale manualmente:
|
|
36
36
|
* Instancie o cliente passando sua API key:
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
client =
|
39
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfse')
|
40
40
|
```
|
41
41
|
|
42
42
|
Agora já podemos emitir uma nota!
|
@@ -83,7 +83,7 @@ nfe.servico = {
|
|
83
83
|
nfe.valorTotal = 1.00
|
84
84
|
|
85
85
|
#enviando a nota
|
86
|
-
|
86
|
+
client.nfse_create('id-da-empresa-no-enotas', nfe)
|
87
87
|
client.nfse_delete('id-da-empresa-no-enotas', id-da-nota)
|
88
88
|
```
|
89
89
|
|
@@ -92,7 +92,7 @@ client.nfse_delete('id-da-empresa-no-enotas', id-da-nota)
|
|
92
92
|
* Instancie o cliente passando sua API key:
|
93
93
|
|
94
94
|
```ruby
|
95
|
-
client =
|
95
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfe')
|
96
96
|
```
|
97
97
|
|
98
98
|
Agora já podemos emitir uma nota!
|
@@ -169,7 +169,7 @@ client.nfe_delete('id-da-empresa-no-enotas', id-da-nota)
|
|
169
169
|
* Instancie o cliente passando sua API key:
|
170
170
|
|
171
171
|
```ruby
|
172
|
-
client =
|
172
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfe')
|
173
173
|
```
|
174
174
|
|
175
175
|
Agora já podemos emitir uma nota!
|
@@ -247,7 +247,7 @@ client.nfe_create('id-da-empresa-no-enotas', nfe)
|
|
247
247
|
* Para emitir uma NFCE você precisa definir o ID E O CSC em produção, que também servirá para homologação
|
248
248
|
|
249
249
|
```ruby
|
250
|
-
client =
|
250
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfe')
|
251
251
|
empresa = EnotasNfe::Model::Empresa.new(client.get_empresa('id-da-empresa-no-enotas'))
|
252
252
|
empresa.emissaoNFeConsumidor.ambienteProducao = EnotasNfe::Model::AmbienteProducao.new
|
253
253
|
empresa.emissaoNFeConsumidor.ambienteProducao.serieNFe = "2"
|
@@ -261,7 +261,7 @@ client.create_update_empresa(empresa)
|
|
261
261
|
* Instancie o cliente passando sua API key:
|
262
262
|
|
263
263
|
```ruby
|
264
|
-
client =
|
264
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfe')
|
265
265
|
```
|
266
266
|
|
267
267
|
Agora já podemos emitir uma nota!
|
@@ -284,7 +284,7 @@ nfe.pedido.pagamento = {
|
|
284
284
|
|
285
285
|
nfe.pedido.pagamento.formas = [
|
286
286
|
{
|
287
|
-
"tipo": "Dinheiro",
|
287
|
+
"tipo": "Dinheiro",
|
288
288
|
"valor": 10.00
|
289
289
|
}
|
290
290
|
]
|
@@ -317,7 +317,7 @@ client.nfce_delete('id-da-empresa-no-enotas', id-da-nota)
|
|
317
317
|
* Instancie o cliente passando sua API key:
|
318
318
|
|
319
319
|
```ruby
|
320
|
-
client =
|
320
|
+
client = EnotasNfe::Client.new('sua-api-key-do-e-notas', 'nfe')
|
321
321
|
```
|
322
322
|
|
323
323
|
Agora já podemos emitir uma nota!
|
@@ -328,7 +328,7 @@ Agora já podemos emitir uma nota!
|
|
328
328
|
nfe = EnotasNfe::Model::Nfe.new
|
329
329
|
nfe.id = "1"
|
330
330
|
# "Producao" ou "Homologacao"
|
331
|
-
nfe.ambienteEmissao = "Homologacao"
|
331
|
+
nfe.ambienteEmissao = "Homologacao"
|
332
332
|
nfe.naturezaOperacao = "Venda"
|
333
333
|
nfe.finalidade = "Normal"
|
334
334
|
nfe.consumidorFinal = true
|
@@ -371,7 +371,7 @@ nfe.itens << produto
|
|
371
371
|
|
372
372
|
produto = EnotasNfe::Model::Produto.new
|
373
373
|
#OBS: Deve ser utilizado o CFOP 6933 quando for serviço realizado fora do estado.
|
374
|
-
produto.cfop = "5933"
|
374
|
+
produto.cfop = "5933"
|
375
375
|
produto.codigo = "S001"
|
376
376
|
produto.descricao = "Serviço de Troca de Disco de Freio (dianteiro ou traseiro)"
|
377
377
|
produto.ncm = "00"
|
data/lib/enotas_nfe/endpoints.rb
CHANGED
@@ -4,7 +4,7 @@ module EnotasNfe
|
|
4
4
|
|
5
5
|
## rotas para criaçacão/update e onfiguraçao da empresa
|
6
6
|
def get_empresas(pageNumber, pageSize)
|
7
|
-
get("empresas?pageNumber=#{pageNumber}&pageSize=#{
|
7
|
+
get("empresas?pageNumber=#{pageNumber}&pageSize=#{pageSize}")
|
8
8
|
end
|
9
9
|
|
10
10
|
def get_empresa(firm_id)
|
data/lib/enotas_nfe/model/nfe.rb
CHANGED
data/lib/enotas_nfe/model/pis.rb
CHANGED
data/lib/enotas_nfe/request.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module EnotasNfe
|
2
2
|
module Request
|
3
3
|
include Connection
|
4
|
-
|
4
|
+
|
5
5
|
def get(path, body = {})
|
6
6
|
request(:get, path, body)
|
7
7
|
end
|
@@ -27,7 +27,7 @@ module EnotasNfe
|
|
27
27
|
request.url(path, body_serialized)
|
28
28
|
when :post
|
29
29
|
request.path = path
|
30
|
-
|
30
|
+
EnotasNfe.logger.info request.body = body_serialized.to_json
|
31
31
|
request.headers
|
32
32
|
end
|
33
33
|
end
|
data/lib/enotas_nfe/version.rb
CHANGED
data/lib/enotas_nfe.rb
CHANGED
@@ -30,6 +30,7 @@ require "enotas_nfe/model/endereco_entrega"
|
|
30
30
|
require "enotas_nfe/model/transportadora"
|
31
31
|
require "enotas_nfe/model/frete"
|
32
32
|
require "enotas_nfe/model/transporte"
|
33
|
+
require "enotas_nfe/model/valor_imposto"
|
33
34
|
require "enotas_nfe/model/nfe"
|
34
35
|
require "enotas_nfe/model/carta_correcao"
|
35
36
|
require "enotas_nfe/model/cofins"
|
@@ -41,4 +42,11 @@ require "enotas_nfe/facades"
|
|
41
42
|
require "enotas_nfe/client"
|
42
43
|
|
43
44
|
module EnotasNfe
|
45
|
+
def self.logger
|
46
|
+
@@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.logger=(logger)
|
50
|
+
@@logger = logger
|
51
|
+
end
|
44
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enotas_nfe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Fernando Pimenta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/enotas_nfe/model/servico.rb
|
158
158
|
- lib/enotas_nfe/model/transportadora.rb
|
159
159
|
- lib/enotas_nfe/model/transporte.rb
|
160
|
+
- lib/enotas_nfe/model/valor_imposto.rb
|
160
161
|
- lib/enotas_nfe/model/veiculo.rb
|
161
162
|
- lib/enotas_nfe/model/volume.rb
|
162
163
|
- lib/enotas_nfe/request.rb
|