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 +4 -4
- data/lib/fdis2/facturacion.rb +11 -11
- data/lib/fdis2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676119356ceecc9f727a6e99e6daee680ec0c4f200fcaabd2700690fd0fc0456
|
4
|
+
data.tar.gz: 949b9517ab867bc1cd1277ba6dd09e9b50023800a6a192270136c5b63c6553e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b868ee678cc5c94568ea8ded15f2dbfa6308db95f667de757abe1c62e0928fe5a4300418eeb173e89ea14dbb6ad3fe2985fb971e51dd7efd542969d0a743e1
|
7
|
+
data.tar.gz: a5ea26e407571945017f27595b0b383b4a654300c132e8f815b8ea12e37ebc678e3c9bc3914ca7f9dcf8b1ad50ae82af6b18fbdaf2f35a4c6a1ebc6a719d53ed
|
data/lib/fdis2/facturacion.rb
CHANGED
@@ -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
|
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(
|
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(
|
134
|
-
pago_totales['TotalTrasladosImpuestoIVA0'] = iva.round(
|
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(
|
141
|
-
pago_totales['TotalTrasladosImpuestoIVA16'] = iva.round(
|
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(
|
184
|
-
traslado['ImporteDR'] = iva.round(
|
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(
|
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(
|
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
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.
|
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.
|
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
|