snoopy_afip 4.0.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +14 -13
- data/Gemfile.lock +39 -48
- data/VERSION +1 -1
- data/lib/snoopy_afip/authentication_adapter.rb +1 -1
- data/lib/snoopy_afip/authorize_adapter.rb +6 -6
- data/lib/snoopy_afip/bill.rb +11 -6
- data/lib/snoopy_afip/constants.rb +3 -1
- data/lib/snoopy_afip/version.rb +1 -1
- data/snoopy_afip.gemspec +5 -5
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8f4df3c29c4692607815f94445de4715e8e51b188fc9d126fddad72621c4467
|
4
|
+
data.tar.gz: 4e06be9ae25590e52765756b2370d7580f9f8d02447915a40d0c186911e1105b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e077d8b0f0d8fc9b216bafddbdcc00223014e97f9dc0c35384b0df5b980459dfaa6d0f43317e95fe656869928e8f073d96d44a0729e28fe036892449939283bf
|
7
|
+
data.tar.gz: bdda1b5b6d0c130535c2681f469d64d4feace9d60db8ed49d815f95c47b20958b71214a08cabea2415b540f0b1a5282107b0cd7885637ca4cde80f863e950466
|
data/Gemfile
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
gemspec
|
4
|
+
# group :development do
|
5
|
+
# platforms :ruby_18 do
|
6
|
+
# gem "ruby-debug"
|
7
|
+
# end
|
8
|
+
# platforms :ruby_19 do
|
9
|
+
# gem 'ruby-debug-base19', "0.11.24"
|
10
|
+
# gem 'ruby-debug19', "0.11.6"
|
11
|
+
# end
|
12
|
+
# gem "rspec", "~> 2.4.0"
|
13
|
+
# gem "bundler", "~> 1.0.0"
|
14
|
+
# gem "jeweler", "~> 1.5.1"
|
15
|
+
# gem "rcov", ">= 0"
|
16
|
+
# end
|
16
17
|
|
data/Gemfile.lock
CHANGED
@@ -1,57 +1,48 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
snoopy_afip (4.0.1)
|
5
|
+
akami (~> 1.3.1)
|
6
|
+
nokogiri (~> 1.10.9)
|
7
|
+
nori (~> 2.6.0)
|
8
|
+
savon (~> 2.12.0)
|
9
|
+
wasabi (~> 3.5.0)
|
10
|
+
|
1
11
|
GEM
|
2
12
|
remote: http://rubygems.org/
|
3
13
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
git (1.2.5)
|
10
|
-
jeweler (1.5.2)
|
11
|
-
bundler (~> 1.0.0)
|
12
|
-
git (>= 1.2.5)
|
13
|
-
rake
|
14
|
-
linecache (0.43)
|
15
|
-
linecache19 (0.5.11)
|
16
|
-
ruby_core_source (>= 0.1.4)
|
17
|
-
rake (0.8.7)
|
18
|
-
rcov (0.9.9)
|
19
|
-
rspec (2.4.0)
|
20
|
-
rspec-core (~> 2.4.0)
|
21
|
-
rspec-expectations (~> 2.4.0)
|
22
|
-
rspec-mocks (~> 2.4.0)
|
23
|
-
rspec-core (2.4.0)
|
24
|
-
rspec-expectations (2.4.0)
|
25
|
-
diff-lcs (~> 1.1.2)
|
26
|
-
rspec-mocks (2.4.0)
|
27
|
-
ruby-debug (0.10.4)
|
28
|
-
columnize (>= 0.1)
|
29
|
-
ruby-debug-base (~> 0.10.4.0)
|
30
|
-
ruby-debug-base (0.10.4)
|
31
|
-
linecache (>= 0.3)
|
32
|
-
ruby-debug-base19 (0.11.24)
|
33
|
-
columnize (>= 0.3.1)
|
34
|
-
linecache19 (>= 0.5.11)
|
35
|
-
ruby_core_source (>= 0.1.4)
|
36
|
-
ruby-debug19 (0.11.6)
|
37
|
-
columnize (>= 0.3.1)
|
38
|
-
linecache19 (>= 0.5.11)
|
39
|
-
ruby-debug-base19 (>= 0.11.19)
|
40
|
-
ruby_core_source (0.1.4)
|
41
|
-
archive-tar-minitar (>= 0.5.2)
|
42
|
-
savon (0.8.6)
|
14
|
+
akami (1.3.1)
|
15
|
+
gyoku (>= 0.4.0)
|
16
|
+
nokogiri
|
17
|
+
builder (3.2.4)
|
18
|
+
gyoku (1.3.1)
|
43
19
|
builder (>= 2.1.2)
|
44
|
-
|
20
|
+
httpi (2.4.4)
|
21
|
+
rack
|
22
|
+
socksify
|
23
|
+
mini_portile2 (2.4.0)
|
24
|
+
nokogiri (1.10.9)
|
25
|
+
mini_portile2 (~> 2.4.0)
|
26
|
+
nori (2.6.0)
|
27
|
+
rack (2.2.2)
|
28
|
+
savon (2.12.0)
|
29
|
+
akami (~> 1.2)
|
30
|
+
builder (>= 2.1.2)
|
31
|
+
gyoku (~> 1.2)
|
32
|
+
httpi (~> 2.3)
|
33
|
+
nokogiri (>= 1.8.1)
|
34
|
+
nori (~> 2.4)
|
35
|
+
wasabi (~> 3.4)
|
36
|
+
socksify (1.7.1)
|
37
|
+
wasabi (3.5.0)
|
38
|
+
httpi (~> 2.0)
|
39
|
+
nokogiri (>= 1.4.2)
|
45
40
|
|
46
41
|
PLATFORMS
|
47
42
|
ruby
|
48
43
|
|
49
44
|
DEPENDENCIES
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
ruby-debug
|
55
|
-
ruby-debug-base19 (= 0.11.24)
|
56
|
-
ruby-debug19 (= 0.11.6)
|
57
|
-
savon (= 0.8.6)
|
45
|
+
snoopy_afip!
|
46
|
+
|
47
|
+
BUNDLED WITH
|
48
|
+
2.1.4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
4.2.1
|
@@ -95,7 +95,7 @@ module Snoopy
|
|
95
95
|
if bill.receiver_iva_cond.to_s.include?("nota_credito")
|
96
96
|
detail.merge!({"CbtesAsoc" => {"CbteAsoc" => {"Nro" => bill.cbte_asoc_num,
|
97
97
|
"PtoVta" => bill.cbte_asoc_to_sale_point,
|
98
|
-
"Tipo" => bill.
|
98
|
+
"Tipo" => bill.cbte_asoc_type }}})
|
99
99
|
end
|
100
100
|
|
101
101
|
@request = { "Auth" => auth }.merge!(fecaereq)
|
@@ -162,10 +162,10 @@ module Snoopy
|
|
162
162
|
result_get = fe_comp_consultar_result[:result_get]
|
163
163
|
|
164
164
|
unless result_get.nil?
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
165
|
+
bill.result = result_get[:resultado]
|
166
|
+
bill.number = result_get[:cbte_desde]
|
167
|
+
bill.cae = result_get[:cod_autorizacion]
|
168
|
+
bill.due_date_cae = result_get[:fch_vto]
|
169
169
|
# bill.imp_iva = result_get[:imp_iva]
|
170
170
|
# bill.document_num = result_get[:doc_numero]
|
171
171
|
# bill.process_date = result_get[:fch_proceso]
|
@@ -185,7 +185,7 @@ module Snoopy
|
|
185
185
|
{ :wsdl => Snoopy.service_url,
|
186
186
|
:headers => { "Accept-Encoding" => "gzip, deflate", "Connection" => "Keep-Alive" },
|
187
187
|
:namespaces => {"xmlns" => "http://ar.gov.afip.dif.FEV1/"},
|
188
|
-
:ssl_version =>
|
188
|
+
:ssl_version => ::Snoopy::SNOOPY_SSL_VERSION,
|
189
189
|
:read_timeout => Snoopy.read_timeout,
|
190
190
|
:open_timeout => Snoopy.open_timeout,
|
191
191
|
:ssl_cert_file => cert,
|
data/lib/snoopy_afip/bill.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
module Snoopy
|
3
3
|
class Bill
|
4
|
-
ATTRIBUTES = [
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
ATTRIBUTES = [:total_net, :document_num, :document_type, :concept, :currency, :result,
|
5
|
+
:cbte_asoc_num, :cae, :service_date_to, :due_date,
|
6
|
+
:number, :alicivas, :cuit, :sale_point, :service_date_from,
|
7
|
+
:due_date_cae, :voucher_date, :process_date, :imp_iva, :cbte_asoc_to_sale_point,
|
8
|
+
:receiver_iva_cond, :issuer_iva_cond, :errors, :asoc_receiver_iva_cond]
|
9
9
|
|
10
|
-
TAX_ATTRIBUTES = [
|
10
|
+
TAX_ATTRIBUTES = [:id, :amount, :taxeable_base]
|
11
11
|
|
12
12
|
ATTRIBUTES_PRECENSE = [:total_net, :concept, :receiver_iva_cond, :alicivas, :document_type, :service_date_from, :service_date_to, :sale_point, :issuer_iva_cond]
|
13
13
|
|
@@ -32,6 +32,7 @@ module Snoopy
|
|
32
32
|
@service_date_to = attrs[:service_date_to]
|
33
33
|
@service_date_from = attrs[:service_date_from]
|
34
34
|
@receiver_iva_cond = attrs[:receiver_iva_cond]
|
35
|
+
@asoc_receiver_iva_cond = attrs[:asoc_receiver_iva_cond]
|
35
36
|
@cbte_asoc_to_sale_point = attrs[:cbte_asoc_to_sale_point] # Esto es el punto de venta de la factura para la nota de credito
|
36
37
|
end
|
37
38
|
|
@@ -77,6 +78,10 @@ module Snoopy
|
|
77
78
|
Snoopy::BILL_TYPE[receiver_iva_cond.to_sym]
|
78
79
|
end
|
79
80
|
|
81
|
+
def cbte_asoc_type
|
82
|
+
Snoopy::BILL_TYPE[asoc_receiver_iva_cond.to_sym]
|
83
|
+
end
|
84
|
+
|
80
85
|
def approved?
|
81
86
|
result == 'A'
|
82
87
|
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
module Snoopy
|
3
2
|
CBTE_TYPE = { '01' => 'Factura A',
|
4
3
|
'02' => 'Nota de Débito A',
|
@@ -21,6 +20,9 @@ module Snoopy
|
|
21
20
|
'63' => 'Liquidacion A',
|
22
21
|
'64' => 'Liquidacion B' }
|
23
22
|
|
23
|
+
# [:TLSv1_2, :TLSv1_1, :TLSv1, :SSLv3, :SSLv23, :SSLv2]
|
24
|
+
SNOOPY_SSL_VERSION = (ENV['SNOOPY_SSL_VERSION'] || 'TLSv1').to_sym
|
25
|
+
|
24
26
|
RESPONSABLE_INSCRIPTO = :responsable_inscripto
|
25
27
|
RESPONSABLE_MONOTRIBUTO = :responsable_monotributo
|
26
28
|
|
data/lib/snoopy_afip/version.rb
CHANGED
data/snoopy_afip.gemspec
CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.summary = "Adaptador AFIP wsfe."
|
22
22
|
s.test_files = ["spec/snoopy_afip/authorizer_spec.rb", "spec/snoopy_afip/bill_spec.rb", "spec/spec_helper.rb"]
|
23
23
|
|
24
|
-
s.add_runtime_dependency('savon', ["~> 2.
|
25
|
-
s.add_runtime_dependency('nokogiri', ["~> 1.
|
26
|
-
s.add_runtime_dependency('wasabi', ["~> 3.
|
27
|
-
s.add_runtime_dependency('akami', ["~> 1.
|
28
|
-
s.add_runtime_dependency('nori', ["~> 2.
|
24
|
+
s.add_runtime_dependency('savon', ["~> 2.12.0"])
|
25
|
+
s.add_runtime_dependency('nokogiri', ["~> 1.10.9"])
|
26
|
+
s.add_runtime_dependency('wasabi', ["~> 3.5.0"])
|
27
|
+
s.add_runtime_dependency('akami', ["~> 1.3.1"])
|
28
|
+
s.add_runtime_dependency('nori', ["~> 2.6.0"])
|
29
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snoopy_afip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- g.edera
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.12.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.12.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.10.9
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.10.9
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: wasabi
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 3.5.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: akami
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.3.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.3.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: nori
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.6.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 2.6.0
|
83
83
|
description: Adaptador para Web Service de Facturación Electrónica Argentina (AFIP)
|
84
84
|
email:
|
85
85
|
- gab.edera@gmail.com
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '0'
|
135
135
|
requirements: []
|
136
|
-
rubygems_version: 3.
|
136
|
+
rubygems_version: 3.2.3
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Adaptador AFIP wsfe.
|