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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/Afip/bill.rb +17 -2
- data/lib/Afip/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a16f5e1fe31aec4c6a6b7aa9c81c5c115b809684c48a2d769a766d3a3d887f90
|
4
|
+
data.tar.gz: edf8ffa1667723f46ea81d43311ebea302f1240ff25e8469337d32a637716063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39e518232fff36a448f01a1337ed12049b70bff7b60ec59c5ea6ca7d61f94b60a3aa28e7083d271e01108e63d3da04ded6b6bca7317c27dc36472e5cbcfd47c9
|
7
|
+
data.tar.gz: efaef41d078352f4bbfd56f6b04f6f92018d116f2641cddd9e658827a0144a8da5602a6b37e52ff5eb3cf80c84919793d8068be96146bf81a0eee102d0389717
|
data/Gemfile.lock
CHANGED
data/lib/Afip/bill.rb
CHANGED
@@ -7,7 +7,7 @@ module Afip
|
|
7
7
|
|
8
8
|
def initialize(attrs={})
|
9
9
|
set_client
|
10
|
-
@sale_point = attrs[:sale_point]
|
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]
|
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(
|
data/lib/Afip/version.rb
CHANGED