Afip 0.9.4 → 0.9.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 +16 -16
- 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: f7abe798b5a18acd3ec59c483827b89dc9106117adf832ecc8585266229f96e8
|
4
|
+
data.tar.gz: 05d82eb34cb61ecdff0bf01cfd0b215eb87ce72cd9e037bfc85f35efe422fa16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf2fcddaf872c8338947de0c5b21dfe76d01e489ca1540ddac974ead66e347f5d8ac989a6eefdd07c4a6cfa0820a309894e7c420144dc3982ba38bff47939ce
|
7
|
+
data.tar.gz: f64cf6b1afa440775e5fafe34204aeed77cc113017431ed37b91e9b28eb8d0cb3f9662e211cc074b7b929f27be73b2d8eddf9c345d0231d15e57859b821b0529
|
data/Gemfile.lock
CHANGED
data/lib/Afip/bill.rb
CHANGED
@@ -9,7 +9,7 @@ module Afip
|
|
9
9
|
@client = Bill.set_client
|
10
10
|
@sale_point = attrs[:sale_point]
|
11
11
|
@body = { "Auth" => Afip.auth_hash }
|
12
|
-
@net = attrs[:net] || 0
|
12
|
+
@net = attrs[:net] || 0.0
|
13
13
|
@documento = attrs[:documento] || Afip.default_documento
|
14
14
|
@moneda = attrs[:moneda] || Afip.default_moneda
|
15
15
|
@iva_cond = attrs[:iva_cond]
|
@@ -20,13 +20,13 @@ module Afip
|
|
20
20
|
@fch_serv_desde = attrs[:fch_serv_desde]
|
21
21
|
@due_date = attrs[:due_date]
|
22
22
|
@cbte_type = Afip::BILL_TYPE[Afip.own_iva_cond][iva_cond]
|
23
|
-
@cant_reg = attrs[:cant_reg]
|
24
|
-
@no_gravado = attrs[:no_gravado]
|
25
|
-
@gravado = attrs[:gravado]
|
26
|
-
@exento = attrs[:exento]
|
27
|
-
@otros_imp = attrs[:otros_imp]
|
28
|
-
@total = net
|
29
|
-
@tributos = attrs[:tributos]
|
23
|
+
@cant_reg = attrs[:cant_reg] || 1
|
24
|
+
@no_gravado = attrs[:no_gravado] || 0.0
|
25
|
+
@gravado = attrs[:gravado] || 0.0
|
26
|
+
@exento = attrs[:exento] || 0.0
|
27
|
+
@otros_imp = attrs[:otros_imp] || 0.0
|
28
|
+
@total = net + iva_sum + exento + gravado + otros_imp
|
29
|
+
@tributos = attrs[:tributos] || []
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.get_ptos_vta
|
@@ -78,22 +78,22 @@ module Afip
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def setup_bill
|
81
|
-
array_ivas =
|
81
|
+
array_ivas = []
|
82
82
|
ivas.each{ |i|
|
83
83
|
array_ivas << {
|
84
84
|
"AlicIva" => {
|
85
|
-
"Id"
|
86
|
-
"BaseImp"
|
87
|
-
"Importe"
|
85
|
+
"Id" => i[0],
|
86
|
+
"BaseImp" => i[1].round(2),
|
87
|
+
"Importe" => i[2].round(2)
|
88
88
|
}
|
89
|
-
}
|
89
|
+
} unless ["01", "02"].include?(i[0])
|
90
90
|
}
|
91
91
|
|
92
|
-
array_tributos =
|
92
|
+
array_tributos = []
|
93
93
|
tributos.each{ |t|
|
94
94
|
array_tributos << {
|
95
95
|
"Tributo" => {
|
96
|
-
"
|
96
|
+
"Id" => t[0],
|
97
97
|
"Desc" => t[1],
|
98
98
|
"BaseImp" => t[2].to_f.round(2),
|
99
99
|
"Alic" => t[3].to_f.round(2),
|
@@ -116,7 +116,6 @@ module Afip
|
|
116
116
|
"MonId" => Afip::MONEDAS[moneda][:codigo],
|
117
117
|
"MonCotiz" => exchange_rate,
|
118
118
|
"ImpOpEx" => exento,
|
119
|
-
"ImpTrib" => otros_imp,
|
120
119
|
"ImpTotal" => (Afip.own_iva_cond == :responsable_monotributo ? net : total).to_f.round(2),
|
121
120
|
"CbteDesde" => next_bill_number,
|
122
121
|
"CbteHasta" => next_bill_number
|
@@ -133,6 +132,7 @@ module Afip
|
|
133
132
|
end
|
134
133
|
|
135
134
|
if !tributos.empty?
|
135
|
+
detail["ImpTrib"] = otros_imp
|
136
136
|
detail["Tributos"] = array_tributos
|
137
137
|
end
|
138
138
|
|
data/lib/Afip/version.rb
CHANGED