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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 977376bb89d71d048763861461ff4f8e90ff9473192b0729df9565483ee2a2b2
4
- data.tar.gz: 7d5d231ad5e5440967e419b2026f45431faf211d73538b9e313b2a326b6665fc
3
+ metadata.gz: f7abe798b5a18acd3ec59c483827b89dc9106117adf832ecc8585266229f96e8
4
+ data.tar.gz: 05d82eb34cb61ecdff0bf01cfd0b215eb87ce72cd9e037bfc85f35efe422fa16
5
5
  SHA512:
6
- metadata.gz: 206ce0b988ffe7c7afe8c250eefe489bc45eaca004db504c8e2a790ff9e832021a684b32419a5be400d5b49a98dc14313788fd0e5f1a110c2af72662a6186781
7
- data.tar.gz: d5a070d8c17d2d7620470845f7d1603fa1ec290cbf7e0ac94878c7a7c8e94af75bab9de22b14f9aff7678c3dc2f3f9acb8a8028995dfb050b609da4ecf2d2070
6
+ metadata.gz: dcf2fcddaf872c8338947de0c5b21dfe76d01e489ca1540ddac974ead66e347f5d8ac989a6eefdd07c4a6cfa0820a309894e7c420144dc3982ba38bff47939ce
7
+ data.tar.gz: f64cf6b1afa440775e5fafe34204aeed77cc113017431ed37b91e9b28eb8d0cb3f9662e211cc074b7b929f27be73b2d8eddf9c345d0231d15e57859b821b0529
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Afip (0.9.3)
4
+ Afip (0.9.4)
5
5
  httpi
6
6
  savon
7
7
 
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] || 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.zero? ? 0 : net + iva_sum
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 = Array.new
81
+ array_ivas = []
82
82
  ivas.each{ |i|
83
83
  array_ivas << {
84
84
  "AlicIva" => {
85
- "Id" => i[0],
86
- "BaseImp" => i[1].round(2),
87
- "Importe" => i[2].round(2)
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 = Array.new
92
+ array_tributos = []
93
93
  tributos.each{ |t|
94
94
  array_tributos << {
95
95
  "Tributo" => {
96
- "id" => t[0],
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
@@ -1,3 +1,3 @@
1
1
  module Afip
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.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.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo A. Díaz Martínez