snoopy_afip 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/snoopy_afip/bill.rb +13 -7
- data/lib/snoopy_afip/constants.rb +1 -0
- data/lib/snoopy_afip/version.rb +1 -1
- data/snoopy_afip.gemspec +7 -46
- metadata +84 -112
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e1b6ea5c224ff75e7dc085b10b57acc2a93125b7
|
4
|
+
data.tar.gz: 6c488db06f8c01ee165fa1c3ea45846b862148db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 964dd0b5447d8bcd6a9d6ec5b290636002460b6069061a9527d8aefb2158c643d0fc31b54365ee2415750caf339680152850ba313d8e30579f64b66f6736566a
|
7
|
+
data.tar.gz: b659f8fae3b64992d40cd607e3cff4b663eedbe95a43823fa61eeaa09551886df9fa30c8ed8084dcf04a44b49cb262db6bb83f258432015eb1e3eac8b1a05a20
|
data/lib/snoopy_afip/bill.rb
CHANGED
@@ -10,7 +10,7 @@ module Snoopy
|
|
10
10
|
:response, :cbte_asoc_num, :cbte_asoc_pto_venta, :numero, :alicivas,
|
11
11
|
:pkey, :cert, :cuit, :punto_venta, :condicion_iva_emisor, :auth, :errors,
|
12
12
|
:cae, :resultado, :fecha_proceso, :vencimiento_cae, :fecha_comprobante,
|
13
|
-
:observaciones, :events, :imp_iva
|
13
|
+
:observaciones, :events, :imp_iva, :backtrace
|
14
14
|
|
15
15
|
def initialize(attrs={})
|
16
16
|
@pkey = attrs[:pkey]
|
@@ -34,6 +34,7 @@ module Snoopy
|
|
34
34
|
@errors = []
|
35
35
|
@observaciones = []
|
36
36
|
@events = []
|
37
|
+
@backtrace = ""
|
37
38
|
end
|
38
39
|
|
39
40
|
def exchange_rate
|
@@ -50,7 +51,7 @@ module Snoopy
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def iva_sum
|
53
|
-
@iva_sum = alicivas.collect{|aliciva| aliciva[:importe] }.sum.to_f.round_with_precision(2)
|
54
|
+
@iva_sum = alicivas.collect{|aliciva| if aliciva.has_key?('importe'); aliciva['importe'].to_f; else aliciva[:importe].to_f end }.sum.to_f.round_with_precision(2)
|
54
55
|
end
|
55
56
|
|
56
57
|
def cbte_type
|
@@ -83,7 +84,8 @@ module Snoopy
|
|
83
84
|
end
|
84
85
|
|
85
86
|
def build_body_request
|
86
|
-
today = Time.new.in_time_zone('Buenos Aires').strftime('%Y%m%d')
|
87
|
+
# today = Time.new.in_time_zone('Buenos Aires').strftime('%Y%m%d')
|
88
|
+
today = Date.today.strftime('%Y%m%d')
|
87
89
|
|
88
90
|
fecaereq = {"FeCAEReq" => {
|
89
91
|
"FeCabReq" => build_header,
|
@@ -98,11 +100,12 @@ module Snoopy
|
|
98
100
|
"ImpOpEx" => 0.00,
|
99
101
|
"ImpTrib" => 0.00 }}}}
|
100
102
|
|
101
|
-
unless condicion_iva_emisor == :responsable_monotributo
|
103
|
+
unless condicion_iva_emisor.to_sym == :responsable_monotributo
|
102
104
|
_alicivas = alicivas.collect do |aliciva|
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
id = if aliciva.has_key?('id'); aliciva['id']; else aliciva[:id]; end
|
106
|
+
importe = if aliciva.has_key?('importe'); aliciva['importe']; else aliciva[:importe]; end
|
107
|
+
base_imp = if aliciva.has_key?('base_imp'); aliciva['base_imp']; else aliciva[:base_imp]; end
|
108
|
+
{ "Id" => Snoopy::ALIC_IVA[id], "BaseImp" => base_imp, "Importe" => importe }
|
106
109
|
end
|
107
110
|
fecaereq["FeCAEReq"]["FeDetReq"]["FECAEDetRequest"]["Iva"] = { "AlicIva" => _alicivas }
|
108
111
|
end
|
@@ -141,6 +144,7 @@ module Snoopy
|
|
141
144
|
end
|
142
145
|
rescue => e #Curl::Err::GotNothingError, Curl::Err::TimeoutError
|
143
146
|
@errors = e.message
|
147
|
+
@backtrace = e.backtrace
|
144
148
|
end
|
145
149
|
!@response.nil?
|
146
150
|
end
|
@@ -157,6 +161,7 @@ module Snoopy
|
|
157
161
|
result[:app_server] == "OK" and result[:db_server] == "OK" and result[:auth_server] == "OK"
|
158
162
|
rescue => e
|
159
163
|
@errors << e.message
|
164
|
+
@backtrace = e.backtrace
|
160
165
|
false
|
161
166
|
end
|
162
167
|
end
|
@@ -240,6 +245,7 @@ module Snoopy
|
|
240
245
|
bill.parse_fe_comp_consultar_response
|
241
246
|
rescue => e
|
242
247
|
bill.errors << e.message
|
248
|
+
bill.backtrace = e.backtrace
|
243
249
|
end
|
244
250
|
bill
|
245
251
|
end
|
data/lib/snoopy_afip/version.rb
CHANGED
data/snoopy_afip.gemspec
CHANGED
@@ -8,9 +8,9 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = Snoopy::VERSION
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["g.edera
|
11
|
+
s.authors = ["g.edera"]
|
12
12
|
s.date = "2016-09-12"
|
13
|
-
s.description = "Adaptador para
|
13
|
+
s.description = "Adaptador para Web Service de Facturación Electrónica Argentina (AFIP)"
|
14
14
|
s.email = ["gab.edera@gmail.com"]
|
15
15
|
s.extra_rdoc_files = ["LICENSE.txt", "README.textile"]
|
16
16
|
s.files = [".document", "CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE.txt", "README.textile", "Rakefile", "VERSION", "autotest/discover.rb", "snoopy_afip.gemspec", "lib/snoopy_afip.rb", "lib/snoopy_afip/auth_data.rb", "lib/snoopy_afip/authorizer.rb", "lib/snoopy_afip/bill.rb", "lib/snoopy_afip/constants.rb", "lib/snoopy_afip/core_ext/float.rb", "lib/snoopy_afip/core_ext/hash.rb", "lib/snoopy_afip/core_ext/string.rb", "lib/snoopy_afip/version.rb", "spec/snoopy_afip/auth_data_spec.rb", "spec/snoopy_afip/authorizer_spec.rb", "spec/snoopy_afip/bill_spec.rb", "spec/spec_helper.rb", "wsaa-client.sh"]
|
@@ -21,48 +21,9 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.summary = "Adaptador AFIP wsfe."
|
22
22
|
s.test_files = ["spec/snoopy_afip/auth_data_spec.rb", "spec/snoopy_afip/authorizer_spec.rb", "spec/snoopy_afip/bill_spec.rb", "spec/spec_helper.rb"]
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6"])
|
30
|
-
s.add_runtime_dependency(%q<wasabi>, ["~> 3.2.3"])
|
31
|
-
s.add_runtime_dependency(%q<akami>, ["~> 1.1"])
|
32
|
-
s.add_runtime_dependency(%q<nori>, ["~> 2.3.0"])
|
33
|
-
# s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
34
|
-
# s.add_development_dependency(%q<ruby-debug-base19>, ["= 0.11.24"])
|
35
|
-
# s.add_development_dependency(%q<ruby-debug19>, ["= 0.11.6"])
|
36
|
-
# s.add_development_dependency(%q<rspec>, ["~> 2.4.0"])
|
37
|
-
# s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
38
|
-
# s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
39
|
-
# s.add_development_dependency(%q<rcov>, [">= 0"])
|
40
|
-
else
|
41
|
-
s.add_dependency(%q<savon>, ["= 2.4.0"])
|
42
|
-
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
43
|
-
s.add_dependency(%q<wasabi>, ["~> 3.2.3"])
|
44
|
-
s.add_dependency(%q<akami>, ["~> 1.1"])
|
45
|
-
s.add_dependency(%q<nori>, ["~> 2.3.0"])
|
46
|
-
# s.add_dependency(%q<ruby-debug>, [">= 0"])
|
47
|
-
# s.add_dependency(%q<ruby-debug-base19>, ["= 0.11.24"])
|
48
|
-
# s.add_dependency(%q<ruby-debug19>, ["= 0.11.6"])
|
49
|
-
# s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
50
|
-
# s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
-
# s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
52
|
-
# s.add_dependency(%q<rcov>, [">= 0"])
|
53
|
-
end
|
54
|
-
else
|
55
|
-
s.add_dependency(%q<savon>, ["= 2.4.0"])
|
56
|
-
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
57
|
-
s.add_dependency(%q<wasabi>, ["~> 3.2.3"])
|
58
|
-
s.add_dependency(%q<akami>, ["~> 1.1"])
|
59
|
-
s.add_dependency(%q<nori>, ["~> 2.3.0"])
|
60
|
-
# s.add_dependency(%q<ruby-debug>, [">= 0"])
|
61
|
-
# s.add_dependency(%q<ruby-debug-base19>, ["= 0.11.24"])
|
62
|
-
# s.add_dependency(%q<ruby-debug19>, ["= 0.11.6"])
|
63
|
-
# s.add_dependency(%q<rspec>, ["~> 2.4.0"])
|
64
|
-
# s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
65
|
-
# s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
66
|
-
# s.add_dependency(%q<rcov>, [">= 0"])
|
67
|
-
end
|
24
|
+
s.add_runtime_dependency('savon', ["~> 2.4.0"])
|
25
|
+
s.add_runtime_dependency('nokogiri', ["~> 1.6"])
|
26
|
+
s.add_runtime_dependency('wasabi', ["~> 3.2.3"])
|
27
|
+
s.add_runtime_dependency('akami', ["~> 1.2"])
|
28
|
+
s.add_runtime_dependency('nori', ["~> 2.3.0"])
|
68
29
|
end
|
metadata
CHANGED
@@ -1,113 +1,95 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: snoopy_afip
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 2.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
- g.edera
|
6
|
+
authors:
|
7
|
+
- g.edera
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: savon
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - "="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 31
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 4
|
33
|
-
- 0
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 2.4.0
|
35
20
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: nokogiri
|
39
21
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nokogiri
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
50
34
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: wasabi
|
54
35
|
prerelease: false
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: wasabi
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
65
47
|
version: 3.2.3
|
66
48
|
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: akami
|
70
49
|
prerelease: false
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.2.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: akami
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
81
62
|
type: :runtime
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: nori
|
85
63
|
prerelease: false
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nori
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
96
75
|
version: 2.3.0
|
97
76
|
type: :runtime
|
98
|
-
|
99
|
-
|
100
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.3.0
|
83
|
+
description: Adaptador para Web Service de Facturación Electrónica Argentina (AFIP)
|
84
|
+
email:
|
101
85
|
- gab.edera@gmail.com
|
102
86
|
executables: []
|
103
|
-
|
104
87
|
extensions: []
|
105
|
-
|
106
|
-
extra_rdoc_files:
|
88
|
+
extra_rdoc_files:
|
107
89
|
- LICENSE.txt
|
108
90
|
- README.textile
|
109
|
-
files:
|
110
|
-
- .document
|
91
|
+
files:
|
92
|
+
- ".document"
|
111
93
|
- CHANGELOG
|
112
94
|
- Gemfile
|
113
95
|
- Gemfile.lock
|
@@ -116,7 +98,6 @@ files:
|
|
116
98
|
- Rakefile
|
117
99
|
- VERSION
|
118
100
|
- autotest/discover.rb
|
119
|
-
- snoopy_afip.gemspec
|
120
101
|
- lib/snoopy_afip.rb
|
121
102
|
- lib/snoopy_afip/auth_data.rb
|
122
103
|
- lib/snoopy_afip/authorizer.rb
|
@@ -126,46 +107,37 @@ files:
|
|
126
107
|
- lib/snoopy_afip/core_ext/hash.rb
|
127
108
|
- lib/snoopy_afip/core_ext/string.rb
|
128
109
|
- lib/snoopy_afip/version.rb
|
110
|
+
- snoopy_afip.gemspec
|
129
111
|
- spec/snoopy_afip/auth_data_spec.rb
|
130
112
|
- spec/snoopy_afip/authorizer_spec.rb
|
131
113
|
- spec/snoopy_afip/bill_spec.rb
|
132
114
|
- spec/spec_helper.rb
|
133
115
|
- wsaa-client.sh
|
134
|
-
has_rdoc: true
|
135
116
|
homepage: https://github.com/gedera/snoopy_afip
|
136
|
-
licenses:
|
117
|
+
licenses:
|
137
118
|
- MIT
|
119
|
+
metadata: {}
|
138
120
|
post_install_message:
|
139
121
|
rdoc_options: []
|
140
|
-
|
141
|
-
require_paths:
|
122
|
+
require_paths:
|
142
123
|
- lib
|
143
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
-
|
145
|
-
requirements:
|
124
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
146
126
|
- - ">="
|
147
|
-
- !ruby/object:Gem::Version
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
version: "0"
|
152
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
|
-
requirements:
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
155
131
|
- - ">="
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
158
|
-
segments:
|
159
|
-
- 0
|
160
|
-
version: "0"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
161
134
|
requirements: []
|
162
|
-
|
163
135
|
rubyforge_project:
|
164
|
-
rubygems_version:
|
136
|
+
rubygems_version: 2.5.1
|
165
137
|
signing_key:
|
166
|
-
specification_version:
|
138
|
+
specification_version: 4
|
167
139
|
summary: Adaptador AFIP wsfe.
|
168
|
-
test_files:
|
140
|
+
test_files:
|
169
141
|
- spec/snoopy_afip/auth_data_spec.rb
|
170
142
|
- spec/snoopy_afip/authorizer_spec.rb
|
171
143
|
- spec/snoopy_afip/bill_spec.rb
|