Afip 1.1.9 → 1.2.0

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: a90cea190ffbcede28ca5e0d41b36dc7dce3b9d7364bb0a3a556156edb5c3791
4
- data.tar.gz: 1e4159d8b2e60450a9afdf2acb6d9097bf27d3f7cf7edad947ebfed4d073b91d
3
+ metadata.gz: 7d3220014f6e0c9d516e67e4d3837004c9fe41ecc10aa345b2329a579505ec0d
4
+ data.tar.gz: 3f2fdb7ab15a54f81d8353ed28b6cb488b62b51394278a2a710f55b0db5aa508
5
5
  SHA512:
6
- metadata.gz: 2ab2e5722d6dfff96c2127d8365b7de22aed6c1ac0fcdc5ee25bf19d8b8c063e38b59daefb34473dee58528658a845ede62576562622c097a087c598a6a24a78
7
- data.tar.gz: a9a4d2cb32ea92110b933c114e1af9619e3f82ea7a5958293f3a0fe42d7776841eeff932ec7cc161e3d01b6b8080771d0f08e511f09288d7efbd4afc334beb97
6
+ metadata.gz: 76016c8e31265e90d25113ead0038dc50082e36ab29c6f4315d6239c23e2a85038e3c38ef407f339f8db9bef2d845e0314c54c51868cf3069d1428d862fe03cc
7
+ data.tar.gz: e23bd4f2545293f231daa06b052952236b5d06fe09a4b29c719a143c80ea5d4f1c461b3da0eea0413b83db4d98fc0637f29c33930242aeb2c2682344aaf18f3c
@@ -64,7 +64,7 @@ module Afip
64
64
  # @return [String]
65
65
  #
66
66
  def todays_data_file_name
67
- "#{Rails.root}/afip/#{environment.to_s}_Afip_#{ Afip.cuit }_#{ Time.new.strftime('%Y_%m_%d') }.yml"
67
+ "/tmp/#{environment.to_s}_Afip_#{ Afip.cuit }_#{ Time.new.strftime('%Y_%m_%d') }.yml"
68
68
  end
69
69
  end
70
70
  end
data/lib/Afip/padron.rb CHANGED
@@ -49,11 +49,9 @@ module Afip
49
49
  end
50
50
 
51
51
  def set_data
52
- pp data.body
53
52
  if not data.body[:get_persona_response][:persona_return][:persona][:actividad].nil?
54
53
  {
55
- :last_name => data.body[:get_persona_response][:persona_return][:persona][:apellido],
56
- :first_name => data.body[:get_persona_response][:persona_return][:persona][:nombre],
54
+ :name => set_name(data),
57
55
  :cuit => data.body[:get_persona_response][:persona_return][:persona][:id_persona],
58
56
  :cp => data.body[:get_persona_response][:persona_return][:persona][:domicilio].last[:cod_postal],
59
57
  :address => data.body[:get_persona_response][:persona_return][:persona][:domicilio].last[:direccion],
@@ -64,8 +62,7 @@ module Afip
64
62
  }
65
63
  else
66
64
  {
67
- :last_name => Padron.divide_name(data.body[:get_persona_response][:persona_return][:persona][:apellido])[0],
68
- :first_name => Padron.divide_name(data.body[:get_persona_response][:persona_return][:persona][:apellido])[1],
65
+ :name => data.body[:get_persona_response][:persona_return][:persona][:apellido])
69
66
  :cuit => data.body[:get_persona_response][:persona_return][:persona][:id_persona],
70
67
  :cp => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :cod_postal),
71
68
  :address => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :direccion),
@@ -77,6 +74,10 @@ module Afip
77
74
  end
78
75
  end
79
76
 
77
+ def set_name(data)
78
+ return data.body[:get_persona_response][:persona_return][:persona][:nombre] + data.body[:get_persona_response][:persona_return][:persona][:apellido]
79
+ end
80
+
80
81
  def self.divide_name(full_name)
81
82
  full_name = full_name.strip.split(/\s+/)
82
83
  last_name = ''
data/lib/Afip/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Afip
2
- VERSION = "1.1.9"
2
+ VERSION = "1.2.0"
3
3
  end
data/lib/Afip/wsaa.rb CHANGED
@@ -87,7 +87,7 @@ XML
87
87
  token: #{certs[0]}
88
88
  sign: #{certs[1]}
89
89
  YML
90
- `echo '#{ yml }' > #{Rails.root}/afip/#{Afip::AuthData.environment.to_s}_Afip_#{ Afip.cuit }_#{ Time.new.strftime('%Y_%m_%d') }.yml`
90
+ `echo '#{ yml }' > /tmp/#{Afip::AuthData.environment.to_s}_Afip_#{ Afip.cuit }_#{ Time.new.strftime('%Y_%m_%d') }.yml`
91
91
  end
92
92
 
93
93
  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.1.9
4
+ version: 1.2.0
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-01-20 00:00:00.000000000 Z
11
+ date: 2020-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon