catalogos_sat 0.0.94 → 0.0.95

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/catalogos_sat.rb +44 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46e6fcaf87822145679847c6a270e893001e7e2c
4
- data.tar.gz: 8f7c6d018bfc706e8af59b637edbe8464ffa7f78
3
+ metadata.gz: 353e9ce35230f106a385bc6bc0f3cc28d41a1784
4
+ data.tar.gz: 95aef0d2deb37c6697cc85091d22a2c870bd26a4
5
5
  SHA512:
6
- metadata.gz: fb3fc8fee77c9930570f25af3ae7cceee860187355e6e0bc7f87414efceb683e9871638a5fdd966caff9ec979d316b3fd3db6929764462368403d081932b2e94
7
- data.tar.gz: 3c7383f9830750017794dfc90b5c261aa7c014bb2b379560edc59f8dc65c1d63a7b32909c7dd0893c8fdaca577194d05b29cae94cb9e0567d2aaafc41aa16037
6
+ metadata.gz: b2b6d0f125508ab5eeb7e1f117e45a2232b085efb59cd99dd3b0eb127ebdc3b466f6af2546197dc514de567a547c9be83056fafb7a84a04eaad10ba7c0c8689e
7
+ data.tar.gz: 4ee7bb344e9a849998746ba1bb4337e2f83e6b76943284f83e3c79995d060e5b90bf0e7b8eefad4b699b437ebb5fbb770de52a981ed75afa18f471f6ece41176
data/lib/catalogos_sat.rb CHANGED
@@ -189,6 +189,17 @@ class Catalogos
189
189
  # Si ya tenemos encabezados nos salimos
190
190
  next if encabezados.count > 0
191
191
  row.each do |col|
192
+
193
+ if hoja.name == "c_UsoCFDI"
194
+ col += " fisica" if col == "Aplica para tipo persona"
195
+ col = "Aplica para tipo persona moral" if col == nil
196
+ end
197
+
198
+ if hoja.name == "c_TipoDeComprobante"
199
+ col += " NS" if col == "Valor máximo"
200
+ col = "Valor máximo NdS" if col == nil
201
+ end
202
+
192
203
  # HACK: Para poder poner los valores correspondientes tomando en cuenta los encabezados
193
204
  if hoja.name == "c_TasaOCuota"
194
205
  col = "maximo" if col == nil
@@ -259,10 +270,43 @@ class Catalogos
259
270
  end
260
271
  end
261
272
 
273
+ #hack para poder construir nominas
274
+ if hoja.name == "c_TipoDeComprobante"
275
+ if k == 3 and valor == ""
276
+ valor = hash_renglon[encabezados[k-1]]
277
+ end
278
+ if k == 2 and valor == "NS"
279
+ mycolumns = hoja.column(k)
280
+ counter_col = 0
281
+ mycolumns.each{
282
+ |cell|
283
+ if counter_col == j
284
+ valor = cell
285
+ end
286
+ counter_col += 1
287
+
288
+ }
289
+ end
290
+ if k == 3 and valor == "NdS"
291
+ mycolumns = hoja.column(k)
292
+ counter_col = 0
293
+ mycolumns.each{
294
+ |cell|
295
+ if counter_col == j
296
+ valor = cell
297
+ end
298
+ counter_col += 1
299
+
300
+ }
301
+ end
302
+ end
262
303
  hash_renglon[encabezados[k]] = valor
263
304
  end
264
305
  renglones_json << hash_renglon
306
+
265
307
  end
308
+
309
+
266
310
  end
267
311
 
268
312
  # Guardamos el contenido JSON
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catalogos_sat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.94
4
+ version: 0.0.95
5
5
  platform: ruby
6
6
  authors:
7
7
  - BambuCode
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-24 00:00:00.000000000 Z
12
+ date: 2017-11-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-progressbar