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 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
@@ -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
- { "Id" => Snoopy::ALIC_IVA[aliciva[:id]],
104
- "BaseImp" => aliciva[:base_imp],
105
- "Importe" => aliciva[:importe] }
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
@@ -69,6 +69,7 @@ module Snoopy
69
69
  :oro => { :codigo => '049', :nombre => 'Gramos de Oro Fino' } }
70
70
 
71
71
  ALIC_IVA = { 0 => '3',
72
+ 0.0 => '3',
72
73
  0.025 => '9',
73
74
  0.05 => '8',
74
75
  0.105 => '4',
@@ -1,3 +1,3 @@
1
1
  module Snoopy
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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, eserdio"]
11
+ s.authors = ["g.edera"]
12
12
  s.date = "2016-09-12"
13
- s.description = "Adaptador para el Web Service de Facturacion Electronica de AFIP"
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
- if s.respond_to? :specification_version then
25
- s.specification_version = 3
26
-
27
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
28
- s.add_runtime_dependency(%q<savon>, ["= 2.4.0"])
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
- hash: 11
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, eserdio
6
+ authors:
7
+ - g.edera
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2016-09-12 00:00:00 -03:00
19
- default_executable:
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
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
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
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 1
48
- - 6
49
- version: "1.6"
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
- requirement: &id003 !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 9
61
- segments:
62
- - 3
63
- - 2
64
- - 3
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
- requirement: &id004 !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ~>
75
- - !ruby/object:Gem::Version
76
- hash: 13
77
- segments:
78
- - 1
79
- - 1
80
- version: "1.1"
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
- requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
89
- - - ~>
90
- - !ruby/object:Gem::Version
91
- hash: 3
92
- segments:
93
- - 2
94
- - 3
95
- - 0
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
- version_requirements: *id005
99
- description: Adaptador para el Web Service de Facturacion Electronica de AFIP
100
- email:
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
- none: false
145
- requirements:
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
146
126
  - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: 3
149
- segments:
150
- - 0
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
- hash: 3
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: 1.6.2
136
+ rubygems_version: 2.5.1
165
137
  signing_key:
166
- specification_version: 3
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