enotas_api 4.1.0 → 4.2.1
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/enotas_api/support/type_handler.rb +1 -0
- data/lib/enotas_api/v2/cancelar_nf.rb +13 -0
- data/lib/enotas_api/v2/consultar_nfs.rb +13 -0
- data/lib/enotas_api/v2/emitir_nf.rb +13 -0
- data/lib/enotas_api/v2/entities/nfe.rb +24 -0
- data/lib/enotas_api/v2/entities/nfe_cliente.rb +20 -0
- data/lib/enotas_api/v2/entities/nfe_cliente_endereco.rb +18 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_cofins.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_icms.rb +22 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_ipi.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_percentual_aproximado_tributos.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_pis.rb +15 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_por_aliquota.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_por_valor.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_tributos_detalhado.rb +13 -0
- data/lib/enotas_api/v2/entities/nfe_imposto_tributos_simplificado.rb +11 -0
- data/lib/enotas_api/v2/entities/nfe_item.rb +24 -0
- data/lib/enotas_api/v2/entities/nfe_item_impostos.rb +20 -0
- data/lib/enotas_api/v2/entities/nfe_referenciada.rb +13 -0
- data/lib/enotas_api/version.rb +1 -1
- metadata +21 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f44602f9239d75f6a487b1c653bf707e8bd2cc4be16247a8a9b94109d232a828
|
4
|
+
data.tar.gz: 6192bab65d26624d9f72788ecf02d9aa1c14ae7eb49f2c6bf9596eb1156ec644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d386e60424edc03a5c65b1c27cae85d19489768ebb0b8f85be32d8acf02ecae2edff24049e445fddf4db26a9bb449a6b6bc0f0d44f5460218a53f4669b1c930
|
7
|
+
data.tar.gz: e6fd4dbf74976bae306efa2f25bc85920b16091c7f0739c36a0c134f1103ace450af38e24ac9f984f8feebc7cef93d0b10d7ff2ea4a6123752ce4200feae823d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -119,9 +119,9 @@ O suporte as novas APIs (V2) com suporte a NFC-e e NF-e estarão disponíveis em
|
|
119
119
|
- [ ] Consultar Inutilização de Número da Nota Fiscal
|
120
120
|
- [ ] Consultar XML de Inutilização
|
121
121
|
- Nota fiscal eletrônica de produto (NF-e)
|
122
|
-
- [
|
123
|
-
- [
|
124
|
-
- [
|
122
|
+
- [x] Emitir Nota Fiscal
|
123
|
+
- [x] Consultar Nota Fiscal
|
124
|
+
- [x] Cancelar Nota Fiscal
|
125
125
|
- [ ] Consultar XML de Cancelamento
|
126
126
|
- [ ] Emitir Carta de Correção pela Chave da NF-e
|
127
127
|
- [ ] Consultar Carta de Correção
|
@@ -11,6 +11,7 @@ module EnotasApi
|
|
11
11
|
integer: ->(value, _type) { value.is_a?(Integer) },
|
12
12
|
string: ->(value, _type) { value.is_a?(String) },
|
13
13
|
datetime: ->(value, _type) { value.is_a?(DateTime) || value.is_a?(Date) },
|
14
|
+
array: ->(value, _type) { value.is_a?(Array) },
|
14
15
|
entity: ->(value, type) { value.is_a?(type) || value.is_a?(Hash) }
|
15
16
|
}.freeze
|
16
17
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class CancelarNf < EnotasApi::Request
|
8
|
+
def initialize(empresa_id, nf_id)
|
9
|
+
super(method: :DELETE, uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e/#{url_encode(nf_id)}")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class ConsultarNf < EnotasApi::Request
|
8
|
+
def initialize(empresa_id, nf_id)
|
9
|
+
super(uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e/#{url_encode(nf_id)}")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../common/request'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class EmitirNf < EnotasApi::Request
|
8
|
+
def initialize(empresa_id, nf)
|
9
|
+
super(method: :POST, uri: "/v2/empresas/#{url_encode(empresa_id)}/nf-e", content: nf.to_json)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_referenciada'
|
5
|
+
require_relative 'nfe_cliente'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class Nfe < EnotasApi::Entity
|
10
|
+
attributes id: :string,
|
11
|
+
ambienteEmissao: :string,
|
12
|
+
naturezaOperacao: :string,
|
13
|
+
tipoOperacao: :string,
|
14
|
+
finalidade: :string,
|
15
|
+
consumidorFinal: :boolean,
|
16
|
+
enviarPorEmail: :boolean,
|
17
|
+
nfeReferenciada: NfeReferenciada,
|
18
|
+
dataEmissao: :string,
|
19
|
+
cliente: NfeCliente,
|
20
|
+
itens: :array,
|
21
|
+
informacoesAdicionais: :string
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_cliente_endereco'
|
5
|
+
|
6
|
+
module EnotasApi
|
7
|
+
module V2
|
8
|
+
class NfeCliente < EnotasApi::Entity
|
9
|
+
attributes endereco: NfeClienteEndereco,
|
10
|
+
tipoPessoa: :string,
|
11
|
+
nome: :string,
|
12
|
+
email: :string,
|
13
|
+
cpfCnpj: :string,
|
14
|
+
inscricaoMunicipal: :string,
|
15
|
+
inscricaoEstadual: :string,
|
16
|
+
indicadorContribuinteICMS: :string,
|
17
|
+
telefone: :string
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class NfeClienteEndereco < EnotasApi::Entity
|
8
|
+
attributes pais: :string,
|
9
|
+
uf: :string,
|
10
|
+
cidade: :string,
|
11
|
+
logradouro: :string,
|
12
|
+
numero: :string,
|
13
|
+
complemento: :string,
|
14
|
+
bairro: :string,
|
15
|
+
cep: :string
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_por_aliquota'
|
5
|
+
require_relative 'nfe_imposto_por_valor'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class NfeImpostoCofins < EnotasApi::Entity
|
10
|
+
attributes situacaoTributaria: :string,
|
11
|
+
porAliquota: NfeImpostoPorAliquota,
|
12
|
+
porValor: NfeImpostoPorValor
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_ipi'
|
5
|
+
|
6
|
+
module EnotasApi
|
7
|
+
module V2
|
8
|
+
class NfeImpostoIcms < EnotasApi::Entity
|
9
|
+
attributes situacaoTributaria: :string,
|
10
|
+
origem: :integer,
|
11
|
+
aliquota: :decimal,
|
12
|
+
baseCalculo: :decimal,
|
13
|
+
modalidadeBaseCalculo: :integer,
|
14
|
+
percentualReducaoBaseCalculo: :decimal,
|
15
|
+
baseCalculoST: :decimal,
|
16
|
+
aliquotaST: :decimal,
|
17
|
+
modalidadeBaseCalculoST: :decimal,
|
18
|
+
percentualReducaoBaseCalculoST: :decimal,
|
19
|
+
percentualMargemValorAdicionadoST: :decimal
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_por_aliquota'
|
5
|
+
require_relative 'nfe_imposto_por_valor'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class NfeImpostoIpi < EnotasApi::Entity
|
10
|
+
attributes situacaoTributaria: :string,
|
11
|
+
porAliquota: NfeImpostoPorAliquota,
|
12
|
+
porValor: NfeImpostoPorValor
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_tributos_simplificado'
|
5
|
+
require_relative 'nfe_imposto_tributos_detalhado'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class NfeImpostoPercentualAproximadoTributos < EnotasApi::Entity
|
10
|
+
attributes simplificado: NfeImpostoTributosSimplificado,
|
11
|
+
detalhado: NfeImpostoTributosDetalhado,
|
12
|
+
fonte: :string
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_por_aliquota'
|
5
|
+
require_relative 'nfe_imposto_por_valor'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class NfeImpostoPis < EnotasApi::Entity
|
10
|
+
attributes situacaoTributaria: :string,
|
11
|
+
porAliquota: NfeImpostoPorAliquota,
|
12
|
+
porValor: NfeImpostoPorValor
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
|
5
|
+
module EnotasApi
|
6
|
+
module V2
|
7
|
+
class NfeImpostoTributosDetalhado < EnotasApi::Entity
|
8
|
+
attributes percentualFederal: :decimal,
|
9
|
+
percentualEstadual: :decimal,
|
10
|
+
percentualMunicipal: :decimal
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_item_impostos'
|
5
|
+
|
6
|
+
module EnotasApi
|
7
|
+
module V2
|
8
|
+
class NfeItem < EnotasApi::Entity
|
9
|
+
attributes cfop: :string,
|
10
|
+
codigo: :string,
|
11
|
+
descricao: :string,
|
12
|
+
descontos: :decimal,
|
13
|
+
sku: :string,
|
14
|
+
ncm: :string,
|
15
|
+
cest: :string,
|
16
|
+
quantidade: :integer,
|
17
|
+
unidadeMedida: :string,
|
18
|
+
valorUnitario: :decimal,
|
19
|
+
frete: :decimal,
|
20
|
+
impostos: NfeItemImpostos,
|
21
|
+
informacoesAdicionais: :string
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'nfe_imposto_percentual_aproximado_tributos'
|
5
|
+
require_relative 'nfe_imposto_icms'
|
6
|
+
require_relative 'nfe_imposto_pis'
|
7
|
+
require_relative 'nfe_imposto_cofins'
|
8
|
+
require_relative 'nfe_imposto_ipi'
|
9
|
+
|
10
|
+
module EnotasApi
|
11
|
+
module V2
|
12
|
+
class NfeItemImpostos < EnotasApi::Entity
|
13
|
+
attributes percentualAproximadoTributos: NfeImpostoPercentualAproximadoTributos,
|
14
|
+
icms: NfeImpostoIcms,
|
15
|
+
pis: NfeImpostoPis,
|
16
|
+
cofins: NfeImpostoCofins,
|
17
|
+
ipi: NfeImpostoIpi
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../common/entity'
|
4
|
+
require_relative 'empresa_endereco'
|
5
|
+
require_relative 'empresa_emissao_nfe_produto'
|
6
|
+
|
7
|
+
module EnotasApi
|
8
|
+
module V2
|
9
|
+
class NfeReferenciada < EnotasApi::Entity
|
10
|
+
attributes chaveAcesso: :string
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/enotas_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enotas_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Bohrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Non oficial, well supported, e-notas ruby api client
|
14
14
|
email:
|
@@ -75,11 +75,29 @@ files:
|
|
75
75
|
- lib/enotas_api/v1/listar_notas_fiscais.rb
|
76
76
|
- lib/enotas_api/v1/vincular_certificado.rb
|
77
77
|
- lib/enotas_api/v1/vincular_logotipo.rb
|
78
|
+
- lib/enotas_api/v2/cancelar_nf.rb
|
78
79
|
- lib/enotas_api/v2/consultar_empresa.rb
|
80
|
+
- lib/enotas_api/v2/consultar_nfs.rb
|
81
|
+
- lib/enotas_api/v2/emitir_nf.rb
|
79
82
|
- lib/enotas_api/v2/entities/empresa.rb
|
80
83
|
- lib/enotas_api/v2/entities/empresa_configuracoes.rb
|
81
84
|
- lib/enotas_api/v2/entities/empresa_emissao_nfe_produto.rb
|
82
85
|
- lib/enotas_api/v2/entities/empresa_endereco.rb
|
86
|
+
- lib/enotas_api/v2/entities/nfe.rb
|
87
|
+
- lib/enotas_api/v2/entities/nfe_cliente.rb
|
88
|
+
- lib/enotas_api/v2/entities/nfe_cliente_endereco.rb
|
89
|
+
- lib/enotas_api/v2/entities/nfe_imposto_cofins.rb
|
90
|
+
- lib/enotas_api/v2/entities/nfe_imposto_icms.rb
|
91
|
+
- lib/enotas_api/v2/entities/nfe_imposto_ipi.rb
|
92
|
+
- lib/enotas_api/v2/entities/nfe_imposto_percentual_aproximado_tributos.rb
|
93
|
+
- lib/enotas_api/v2/entities/nfe_imposto_pis.rb
|
94
|
+
- lib/enotas_api/v2/entities/nfe_imposto_por_aliquota.rb
|
95
|
+
- lib/enotas_api/v2/entities/nfe_imposto_por_valor.rb
|
96
|
+
- lib/enotas_api/v2/entities/nfe_imposto_tributos_detalhado.rb
|
97
|
+
- lib/enotas_api/v2/entities/nfe_imposto_tributos_simplificado.rb
|
98
|
+
- lib/enotas_api/v2/entities/nfe_item.rb
|
99
|
+
- lib/enotas_api/v2/entities/nfe_item_impostos.rb
|
100
|
+
- lib/enotas_api/v2/entities/nfe_referenciada.rb
|
83
101
|
- lib/enotas_api/v2/incluir_atualizar_empresa.rb
|
84
102
|
- lib/enotas_api/v2/listar_empresas.rb
|
85
103
|
- lib/enotas_api/v2/vincular_certificado.rb
|
@@ -109,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
127
|
- !ruby/object:Gem::Version
|
110
128
|
version: '0'
|
111
129
|
requirements: []
|
112
|
-
rubygems_version: 3.
|
130
|
+
rubygems_version: 3.4.10
|
113
131
|
signing_key:
|
114
132
|
specification_version: 4
|
115
133
|
summary: E-notas API client
|