Afip 0.7.4 → 0.7.5

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: f5df08bf706ffec43ce7b065fadeb7fbd50250657b57c0f258a170e734bc14ae
4
- data.tar.gz: 9d37a53bff986343c9e068b4a3db792cafbc443b3a77dd4ce7c640352d4a9040
3
+ metadata.gz: a16f5e1fe31aec4c6a6b7aa9c81c5c115b809684c48a2d769a766d3a3d887f90
4
+ data.tar.gz: edf8ffa1667723f46ea81d43311ebea302f1240ff25e8469337d32a637716063
5
5
  SHA512:
6
- metadata.gz: b45c473d573dc8f065376c29b7c760c41a85c801950b49ecad491894a8ac2caf8f33f691bd2a2e599f0dea1418edf49e3753d997935fdd5ff36f285c2b17905f
7
- data.tar.gz: dc75a7607a496c6f3145739040b831c2fae1083cc61a48af23568cce6757769386183b719fcf1263acbb21bc91b66fe1530bce32af2833dd2445437ac986f262
6
+ metadata.gz: 39e518232fff36a448f01a1337ed12049b70bff7b60ec59c5ea6ca7d61f94b60a3aa28e7083d271e01108e63d3da04ded6b6bca7317c27dc36472e5cbcfd47c9
7
+ data.tar.gz: efaef41d078352f4bbfd56f6b04f6f92018d116f2641cddd9e658827a0144a8da5602a6b37e52ff5eb3cf80c84919793d8068be96146bf81a0eee102d0389717
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Afip (0.7.3)
4
+ Afip (0.7.4)
5
5
  httpi
6
6
  savon
7
7
 
@@ -7,7 +7,7 @@ module Afip
7
7
 
8
8
  def initialize(attrs={})
9
9
  set_client
10
- @sale_point = attrs[:sale_point] || raise(NullOrInvalidAttribute.new, "Punto de venta inválido.")
10
+ @sale_point = attrs[:sale_point]
11
11
  @body = { "Auth" => Afip.auth_hash }
12
12
  @net = attrs[:net] || 0
13
13
  @documento = attrs[:documento] || Afip.default_documento
@@ -16,10 +16,25 @@ module Afip
16
16
  @concepto = attrs[:concepto] || Afip.default_concepto
17
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
- @cbte_type = Afip::BILL_TYPE[Afip.own_iva_cond][iva_cond] || raise(NullOrInvalidAttribute.new, "Tipo de documento inválido.")
19
+ @cbte_type = Afip::BILL_TYPE[Afip.own_iva_cond][iva_cond]
20
20
  @total = net.zero? ? 0 : net + iva_sum
21
21
  end
22
22
 
23
+ def self.get_ptos_vta
24
+ client = set_client
25
+ body = { "Auth" => Afip.auth_hash }
26
+ response = client.call(:fe_param_get_ptos_venta, message: bill.body)
27
+ if response.body[:fe_param_get_ptos_venta_response][:fe_param_get_ptos_venta_result][:errors].any?
28
+ []
29
+ else
30
+ if response.body[:fe_param_get_ptos_venta_response][:fe_param_get_ptos_venta_result][:result_get][:pto_venta].is_a?(Hash)
31
+ response.body[:fe_param_get_ptos_venta_response][:fe_param_get_ptos_venta_result][:result_get][:pto_venta][:nro]
32
+ else
33
+ response.body[:fe_param_get_ptos_venta_response][:fe_param_get_ptos_venta_result][:result_get][:pto_venta].map{|r| r[:nro]}
34
+ end
35
+ end
36
+ end
37
+
23
38
  def set_client
24
39
  Afip::AuthData.fetch
25
40
  @client = Savon.client(
@@ -1,3 +1,3 @@
1
1
  module Afip
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Afip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo A. Díaz Martínez