cfdi40 0.2.0 → 0.2.1
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/Gemfile.lock +1 -1
- data/lib/cfdi40/concepto.rb +6 -4
- data/lib/cfdi40/impuestos.rb +2 -2
- data/lib/cfdi40/traslado.rb +2 -2
- data/lib/cfdi40/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: ecf98bb6f090122a8deb1fd4efdcc536452a130971dde09b6edcfb78fe4edc85
|
4
|
+
data.tar.gz: 940ed9335fd2c541476f287b577a40574d2a07734278b730392533302755ad94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 796605c919c80f6e2de32b7055da870e46b8af0df71b4a5775943948f11be9b73c356a748d21615527a00aa2e4c6ba85ca5599e2105081e946a24d73755381fe
|
7
|
+
data.tar.gz: f858dcd68742d342fdaa1790beaeafbcc8122f5f54a7f4d2bcbed70b74def6ad3108e3000d35eec221bafb5056d9e7e9347fbc86383b96ea458cfa05dee95b2a
|
data/Gemfile.lock
CHANGED
data/lib/cfdi40/concepto.rb
CHANGED
@@ -89,9 +89,11 @@ module Cfdi40
|
|
89
89
|
|
90
90
|
def calculate_from_net_price
|
91
91
|
set_defaults
|
92
|
-
@precio_neto = @precio_neto.round(
|
93
|
-
@precio_bruto = (@precio_neto / ((1 + tasa_iva.to_f) * (1 + tasa_ieps.to_f)))
|
92
|
+
@precio_neto = @precio_neto.round(6)
|
93
|
+
@precio_bruto = (@precio_neto / ((1 + tasa_iva.to_f) * (1 + tasa_ieps.to_f)))
|
94
94
|
calculate_taxes
|
95
|
+
|
96
|
+
@precio_bruto = (((@precio_neto * cantidad.to_f) - @iva - @ieps) / cantidad.to_f.round(6)).round(6)
|
95
97
|
update_xml_attributes
|
96
98
|
end
|
97
99
|
|
@@ -106,9 +108,9 @@ module Cfdi40
|
|
106
108
|
|
107
109
|
def calculate_taxes
|
108
110
|
@base_ieps = (@precio_bruto * cantidad.to_f).round(6)
|
109
|
-
@ieps = (@base_ieps * tasa_ieps.to_f).round(
|
111
|
+
@ieps = (@base_ieps * tasa_ieps.to_f).round(6)
|
110
112
|
@base_iva = (@base_ieps + @ieps).round(6)
|
111
|
-
@iva = (@base_iva * tasa_iva.to_f).round(
|
113
|
+
@iva = (@base_iva * tasa_iva.to_f).round(6)
|
112
114
|
@importe_bruto = @base_ieps
|
113
115
|
@importe_neto = (@base_iva + @iva).round(2)
|
114
116
|
end
|
data/lib/cfdi40/impuestos.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# /cfdi:Comprobante/cfdi:Impuestos
|
4
4
|
module Cfdi40
|
5
5
|
class Impuestos < Node
|
6
|
-
define_attribute :total_impuestos_retenidos, xml_attribute: "TotalImpuestosRetenidos", format: :
|
7
|
-
define_attribute :total_impuestos_trasladados, xml_attribute: "TotalImpuestosTrasladados", format: :
|
6
|
+
define_attribute :total_impuestos_retenidos, xml_attribute: "TotalImpuestosRetenidos", format: :t_ImporteMXN
|
7
|
+
define_attribute :total_impuestos_trasladados, xml_attribute: "TotalImpuestosTrasladados", format: :t_ImporteMXN
|
8
8
|
|
9
9
|
def traslados
|
10
10
|
return @traslados if defined?(@traslados)
|
data/lib/cfdi40/traslado.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# /cfdi:Comprobante/cfdi:Impuestos/cfdi:Traslados/cfdi:Traslado
|
4
4
|
module Cfdi40
|
5
5
|
class Traslado < Node
|
6
|
-
define_attribute :base, xml_attribute: "Base", format: :
|
6
|
+
define_attribute :base, xml_attribute: "Base", format: :t_ImporteMXN
|
7
7
|
define_attribute :impuesto, xml_attribute: "Impuesto"
|
8
8
|
define_attribute :tipo_factor, xml_attribute: "TipoFactor", default: "Tasa"
|
9
9
|
define_attribute :tasa_o_cuota, xml_attribute: "TasaOCuota", format: :t_Importe
|
10
|
-
define_attribute :importe, xml_attribute: "Importe", format: :
|
10
|
+
define_attribute :importe, xml_attribute: "Importe", format: :t_ImporteMXN
|
11
11
|
end
|
12
12
|
end
|
data/lib/cfdi40/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfdi40
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Israel Benítez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|