fdis2 0.1.41 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10edc18a3f26753f2c97b888b11394ba9b0c578a036941c01de815ea0bc20646
4
- data.tar.gz: 20dfad14c6840890e9c4d4458f2081f08f0e61fb09e5bcd0a88b3c8517dec8a4
3
+ metadata.gz: 676119356ceecc9f727a6e99e6daee680ec0c4f200fcaabd2700690fd0fc0456
4
+ data.tar.gz: 949b9517ab867bc1cd1277ba6dd09e9b50023800a6a192270136c5b63c6553e1
5
5
  SHA512:
6
- metadata.gz: 6126ffc62202c8e4c5a58db3ad884de8e679cc18c950170883a2b3837ebd9d9e7a22fc4a00d02bca4c21460154caf6735fbdc75ef20b24d62afec4b63795337d
7
- data.tar.gz: 6dc29fd8d454c63e68907df0eea5a3107db9777c7c6c2e969c6b7d8abb11edbdea3a6a8d6de4fa8a6ae411b6d93bec0adf7df3a14b236526a15afdac3dd69e2e
6
+ metadata.gz: 92b868ee678cc5c94568ea8ded15f2dbfa6308db95f667de757abe1c62e0928fe5a4300418eeb173e89ea14dbb6ad3fe2985fb971e51dd7efd542969d0a743e1
7
+ data.tar.gz: a5ea26e407571945017f27595b0b383b4a654300c132e8f815b8ea12e37ebc678e3c9bc3914ca7f9dcf8b1ad50ae82af6b18fbdaf2f35a4c6a1ebc6a719d53ed
@@ -39,7 +39,7 @@ module Fdis2
39
39
  end
40
40
  lines_total = params[:line_items].inject(0) {|sum, x| sum + x[:monto].to_f}
41
41
 
42
- puts "--- Fdis: Suma de line_items: #{lines_total}"
42
+ puts "--- Fdis: Suma de lineas: #{lines_total}"
43
43
 
44
44
  if (lines_total > params[:total].to_f)
45
45
  raise 'Error Fdis - la suma de los complementos de pago es mayor al total de la venta'
@@ -117,11 +117,11 @@ module Fdis2
117
117
 
118
118
 
119
119
  # totales
120
- total = params[:monto_pago].to_f
120
+ total = params[:monto_pago].to_f.abs
121
121
  iva_id = params.fetch(:tasa_iva, 16)
122
122
 
123
123
  pago_totales = xml.at_xpath("//pago20:Totales")
124
- pago_totales['MontoTotalPagos'] = total.round(4).to_s # total
124
+ pago_totales['MontoTotalPagos'] = total.round(2).to_s # total
125
125
 
126
126
 
127
127
 
@@ -130,15 +130,15 @@ module Fdis2
130
130
  subtotal = total
131
131
  iva = 0.00
132
132
 
133
- pago_totales['TotalTrasladosBaseIVA0'] = subtotal.round(4).to_s # subtotal
134
- pago_totales['TotalTrasladosImpuestoIVA0'] = iva.round(4).to_s # iva
133
+ pago_totales['TotalTrasladosBaseIVA0'] = subtotal.round(2).to_s # subtotal
134
+ pago_totales['TotalTrasladosImpuestoIVA0'] = iva.round(2).to_s # iva
135
135
 
136
136
  else
137
137
  subtotal = total / 1.16
138
138
  iva = total - subtotal
139
139
 
140
- pago_totales['TotalTrasladosBaseIVA16'] = subtotal.round(4).to_s # subtotal
141
- pago_totales['TotalTrasladosImpuestoIVA16'] = iva.round(4).to_s # iva
140
+ pago_totales['TotalTrasladosBaseIVA16'] = subtotal.round(2).to_s # subtotal
141
+ pago_totales['TotalTrasladosImpuestoIVA16'] = iva.round(2).to_s # iva
142
142
  end
143
143
 
144
144
 
@@ -180,13 +180,13 @@ module Fdis2
180
180
  traslado['TipoFactorDR'] = 'Tasa'
181
181
  traslado['ImpuestoDR'] = '002'
182
182
 
183
- traslado['BaseDR'] = subtotal.round(4).to_s #subtotal
184
- traslado['ImporteDR'] = iva.round(4).to_s # tax
183
+ traslado['BaseDR'] = subtotal.round(2).to_s #subtotal
184
+ traslado['ImporteDR'] = iva.round(2).to_s # tax
185
185
 
186
- traslado_p['BaseP'] = subtotal.round(4).to_s
186
+ traslado_p['BaseP'] = subtotal.round(2).to_s
187
187
  traslado_p['ImpuestoP'] = '002'
188
188
  traslado_p['TipoFactorP'] = 'Tasa'
189
- traslado_p['ImporteP'] = iva.round(4).to_s # tax
189
+ traslado_p['ImporteP'] = iva.round(2).to_s # tax
190
190
 
191
191
  if iva_id == 16
192
192
  traslado['TasaOCuotaDR'] = '0.160000'
data/lib/fdis2/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fdis2
2
- VERSION = "0.1.41"
2
+ VERSION = "0.1.43"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdis2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.41
4
+ version: 0.1.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel Padilla
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubygems_version: 3.4.6
140
+ rubygems_version: 3.0.1
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Gem used to fetch the CFDIS Web API