Afip 1.4.6 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c07764d2ac36151ee8123d36a5c798ffced1b3b184d42c18d2d2988fc8ce72a3
4
- data.tar.gz: 8fd477544eed952a64312d0a86b1cfae6694d48a468054c6fa18d371192ceb09
3
+ metadata.gz: c67572f7bf760c810d922a48ee4cb8f59d604c196438b16f3493cfb3ad891825
4
+ data.tar.gz: be22a7e22df3be79f2c65aab15f3d9e9e984ad14e0337fa1f9b858258c98fc82
5
5
  SHA512:
6
- metadata.gz: 5e46c5dae7fed9d8fcb7465dbc6a3d23a920d70de0c5704f3f8e478cf424582b16659c23c91657a7a19d4888bae6395c72a5604f827cfdb52ed037fa927ede5e
7
- data.tar.gz: cf1ae128519b5ebaf1e1f6aff47c9de2102a9d92bb589667f42bc8f6f3da8250d3ee44ec08d8b11338519f81db74ecbb8675645d933ff9e655cf8f023a269bc0
6
+ metadata.gz: 7610c0b62ce35a555cdf305a48474e4072ec1cdd482e80d807fe24c9f169531eeadcf4dfc947c29fd1f36bea299c563a7ce20576a53c2c0ac535a5eeeb8d9202
7
+ data.tar.gz: cf2bbc4d6af356f55754f19ed4d1742c1070b61b88edf587f0f7b83d3594d36408ab2299836be6e443a6f7e9048b6a1f600913311c5440b0ecbe14a2e9bed3c6
Binary file
Binary file
Binary file
@@ -36,6 +36,6 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "savon"
37
37
  spec.add_dependency "httpi"
38
38
  spec.add_dependency "nokogiri", ">= 1.10.4"
39
- spec.add_development_dependency "bundler"
40
- spec.add_development_dependency "rake"
39
+ spec.add_development_dependency "bundler", "~> 1.16"
40
+ spec.add_development_dependency "rake", "~> 12.3.3"
41
41
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Afip (1.4.5)
4
+ Afip (1.5.3)
5
5
  httpi
6
6
  nokogiri (>= 1.10.4)
7
7
  savon
@@ -23,7 +23,7 @@ GEM
23
23
  mini_portile2 (~> 2.4.0)
24
24
  nori (2.6.0)
25
25
  rack (2.2.2)
26
- rake (10.5.0)
26
+ rake (12.3.3)
27
27
  savon (2.12.0)
28
28
  akami (~> 1.2)
29
29
  builder (>= 2.1.2)
@@ -42,8 +42,8 @@ PLATFORMS
42
42
 
43
43
  DEPENDENCIES
44
44
  Afip!
45
- bundler
46
- rake
45
+ bundler (~> 1.16)
46
+ rake (~> 12.3.3)
47
47
 
48
48
  BUNDLED WITH
49
49
  1.17.3
Binary file
Binary file
@@ -2,19 +2,19 @@ module Afip
2
2
  class Bill
3
3
  attr_reader :cbte_type, :body, :response, :fecha_emision, :total, :client
4
4
  attr_accessor :net, :doc_num, :iva_cond, :documento, :concepto, :moneda, :cbte_type,
5
- :due_date, :fch_serv_desde, :fch_serv_hasta, :fch_emision,
5
+ :due_date, :fch_serv_desde, :fch_serv_hasta, :fch_emision, :cbte_asoc,
6
6
  :ivas, :sale_point, :cant_reg, :no_gravado, :gravado, :exento, :otros_imp, :tributos, :opcionales
7
7
 
8
8
  def initialize(attrs={})
9
9
  @client = Bill.set_client
10
- @sale_point = attrs[:sale_point]
11
- @body = { "Auth" => Afip.auth_hash }
12
- @net = attrs[:net] || 0.0
10
+ @sale_point = attrs[:sale_point]
11
+ @body = { "Auth" => Afip.auth_hash }
12
+ @net = attrs[:net] || 0.0
13
13
  @documento = attrs[:documento] || Afip.default_documento
14
- @moneda = attrs[:moneda] || Afip.default_moneda
14
+ @moneda = attrs[:moneda] || Afip.default_moneda
15
15
  @iva_cond = attrs[:iva_cond]
16
16
  @concepto = attrs[:concepto] || Afip.default_concepto
17
- @ivas = attrs[:ivas] || Array.new # [ 1, 100.00, 10.50 ], [ 2, 100.00, 21.00 ]
17
+ @ivas = attrs[:ivas] || Array.new # [ 1, 100.00, 10.50 ], [ 2, 100.00, 21.00 ]
18
18
  @fecha_emision = attrs[:fch_emision] || Time.new
19
19
  @fch_serv_hasta = attrs[:fch_serv_hasta]
20
20
  @fch_serv_desde = attrs[:fch_serv_desde]
@@ -22,12 +22,13 @@ module Afip
22
22
  @cbte_type = attrs[:cbte_type]
23
23
  @cant_reg = attrs[:cant_reg] || 1
24
24
  @no_gravado = attrs[:no_gravado] || 0.0
25
- @gravado = attrs[:gravado] || 0.0
26
- @exento = attrs[:exento] || 0.0
25
+ @gravado = attrs[:gravado] || 0.0
26
+ @exento = attrs[:exento] || 0.0
27
27
  @otros_imp = attrs[:otros_imp] || 0.0
28
- @total = net.to_f + iva_sum.to_f + exento.to_f + no_gravado.to_f + otros_imp.to_f
28
+ @total = net.to_f + iva_sum.to_f + exento.to_f + no_gravado.to_f + otros_imp.to_f
29
29
  @tributos = attrs[:tributos] || []
30
- @opcionales = attrs[:opcionales] || []
30
+ @opcionales = attrs[:opcionales] || []
31
+ @cbte_asoc = attrs[:cbte_asoc]
31
32
  end
32
33
 
33
34
  def self.get_ptos_vta
@@ -107,14 +108,23 @@ module Afip
107
108
  }
108
109
  end
109
110
  }
110
-
111
+
111
112
  array_opcionales = {}
112
113
  array_opcionales["Opcional"] = opcionales.map{ |t|
113
- {
114
- "Id" => t[:id],
115
- "Valor" => t[:valor]
116
- }
117
- }
114
+ {
115
+ "Id" => t[:id],
116
+ "Valor" => t[:valor]
117
+ }
118
+ }
119
+
120
+ array_associados = {}
121
+ array_associados["CbteAsoc"] = cbte_asoc.map{ |b|
122
+ {
123
+ "Tipo" => b[:cbte_tipo],
124
+ "PtoVta" => b[:sale_point]
125
+ "Nro" => b[:cbte_num]
126
+ }
127
+ }
118
128
 
119
129
 
120
130
  fecaereq = {
@@ -124,10 +134,10 @@ module Afip
124
134
  "FECAEDetRequest" => {
125
135
  "Concepto" => Afip::CONCEPTOS[concepto],
126
136
  "DocTipo" => Afip::DOCUMENTOS[documento],
127
- "DocNro" => doc_num,
137
+ "DocNro" => doc_num,
128
138
  "CbteFch" => fecha_emision.strftime('%Y%m%d'),
129
139
  "ImpTotConc" => no_gravado,
130
- "ImpNeto" => net.to_f,
140
+ "ImpNeto" => net.to_f,
131
141
  "MonId" => Afip::MONEDAS[moneda][:codigo],
132
142
  "MonCotiz" => exchange_rate,
133
143
  "ImpOpEx" => exento,
@@ -153,7 +163,11 @@ module Afip
153
163
 
154
164
  if !opcionales.empty?
155
165
  detail["Opcionales"] = array_opcionales
156
- end
166
+ end
167
+
168
+ if !cbte_asoc.empty?
169
+ detaill["CbtesAsoc"] = array_associados
170
+ end
157
171
 
158
172
  unless concepto == "Productos" # En "Productos" ("01"), si se mandan estos parámetros la afip rechaza.
159
173
  detail.merge!({"FchServDesde" => fch_serv_desde.strftime("%Y%m%d"),
@@ -200,7 +214,7 @@ module Afip
200
214
 
201
215
  def setup_response(response)
202
216
  # TODO: turn this into an all-purpose Response class
203
- pp response
217
+ pp response
204
218
  result = response[:fecae_solicitar_response][:fecae_solicitar_result]
205
219
 
206
220
  if not result[:fe_det_resp] or not result[:fe_cab_resp] then
@@ -258,7 +272,7 @@ module Afip
258
272
 
259
273
  def self.comp_consultar(cbte_tipo, cbte_nro, pto_venta)
260
274
  client = set_client
261
-
275
+
262
276
  body = {
263
277
  "Auth" => Afip.auth_hash,
264
278
  "FeCompConsReq" => {
@@ -1,3 +1,3 @@
1
1
  module Afip
2
- VERSION = "1.4.6"
2
+ VERSION = "1.5.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Afip
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo A. Díaz Martínez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon
@@ -56,30 +56,30 @@ dependencies:
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.16'
62
62
  type: :development
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: '0'
68
+ version: '1.16'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 12.3.3
76
76
  type: :development
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: '0'
82
+ version: 12.3.3
83
83
  description: Gema para la comunicacion con los Web Services de AFIP.
84
84
  email:
85
85
  - facundo_diaz_martinez@hotmail.com
@@ -87,9 +87,11 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".DS_Store"
90
91
  - ".gitignore"
91
92
  - Afip-1.2.1.gem
92
- - Afip-1.4.gem
93
+ - Afip-1.4.9.gem
94
+ - Afip-1.5.gem
93
95
  - Afip.gemspec
94
96
  - Gemfile
95
97
  - Gemfile.lock
@@ -98,7 +100,9 @@ files:
98
100
  - Rakefile
99
101
  - bin/console
100
102
  - bin/setup
103
+ - lib/.DS_Store
101
104
  - lib/Afip.rb
105
+ - lib/Afip/.DS_Store
102
106
  - lib/Afip/auth_data.rb
103
107
  - lib/Afip/authorizer.rb
104
108
  - lib/Afip/bill.rb
@@ -130,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
134
  - !ruby/object:Gem::Version
131
135
  version: '0'
132
136
  requirements: []
133
- rubygems_version: 3.0.3
137
+ rubygems_version: 3.1.2
134
138
  signing_key:
135
139
  specification_version: 4
136
140
  summary: Comunicacion con AFIP
Binary file