sw_fac 0.3.51 → 0.3.56
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sw_fac/facturacion.rb +12 -11
- data/lib/sw_fac/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84574e598775ba54312d593c9657fc84d703d5ac5466b411771df0f4d45b4803
|
4
|
+
data.tar.gz: 7089b3ab0dbe3984cb750838b708a5cf4074663e9d7da5228df2aa62cb824811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 519b791710dd626a4295df217855757cbc37f3ed7e5c899dddfac935a0a1fffb10f912b182140883903c1df4d5bd3c8643d7a4e9f2addfecdeb06affe90fefe1
|
7
|
+
data.tar.gz: 7b73a3a8d9b0b441a610135a75cf62c3f6ce7a7196c0eb7f980128a232a74d583a24d4be2d427a2a3aa109ad74026f1836f4dfa4523bb259bb864a574bb91bca
|
data/lib/sw_fac/facturacion.rb
CHANGED
@@ -79,7 +79,7 @@ module SwFac
|
|
79
79
|
child_pago['MonedaP'] = params.fetch(:moneda, 'MXN')
|
80
80
|
child_pago['Monto'] = params[:total].round(2).to_s
|
81
81
|
|
82
|
-
saldo_anterior = params[:total]
|
82
|
+
saldo_anterior = params[:total]
|
83
83
|
|
84
84
|
params[:line_items].each_with_index do |line, index|
|
85
85
|
monto = line[:monto].to_f
|
@@ -89,9 +89,9 @@ module SwFac
|
|
89
89
|
child_pago_relacionado['MetodoDePagoDR'] = 'PPD'
|
90
90
|
child_pago_relacionado['NumParcialidad'] = (index + 1).to_s
|
91
91
|
|
92
|
-
child_pago_relacionado['ImpSaldoAnt'] = (saldo_anterior).to_s
|
92
|
+
child_pago_relacionado['ImpSaldoAnt'] = (saldo_anterior).round(2).to_s
|
93
93
|
child_pago_relacionado['ImpPagado'] = monto.round(2).to_s
|
94
|
-
child_pago_relacionado['ImpSaldoInsoluto'] = (saldo_anterior - monto).to_s
|
94
|
+
child_pago_relacionado['ImpSaldoInsoluto'] = (saldo_anterior - monto).round(2).to_s
|
95
95
|
saldo_anterior -= monto
|
96
96
|
|
97
97
|
child_pago.add_child(child_pago_relacionado)
|
@@ -513,6 +513,7 @@ module SwFac
|
|
513
513
|
suma_iva += importe_iva
|
514
514
|
suma_total += total_acumulator
|
515
515
|
|
516
|
+
puts "--- 01"
|
516
517
|
## calculando retencion de IVA en caso de tener
|
517
518
|
if ret_iva > 0
|
518
519
|
if ret_iva == 6
|
@@ -523,7 +524,7 @@ module SwFac
|
|
523
524
|
else
|
524
525
|
importe_ret_linea = 0
|
525
526
|
end
|
526
|
-
puts "---
|
527
|
+
puts "--- 02"
|
527
528
|
suma_ret += importe_ret_linea
|
528
529
|
|
529
530
|
|
@@ -535,8 +536,8 @@ module SwFac
|
|
535
536
|
child_concepto['Unidad'] = line[:unidad].to_s
|
536
537
|
child_concepto['Descripcion'] = line[:descripcion].to_s
|
537
538
|
child_concepto['Cantidad'] = cantidad.to_s
|
538
|
-
child_concepto['ValorUnitario'] = valor_unitario.round(
|
539
|
-
child_concepto['Importe'] = total_line.round(
|
539
|
+
child_concepto['ValorUnitario'] = valor_unitario.round(4).to_s
|
540
|
+
child_concepto['Importe'] = total_line.round(4).to_s
|
540
541
|
# child_concepto['Descuento'] = line.fetch(:descuento, 0.00).round(6).to_s
|
541
542
|
|
542
543
|
|
@@ -546,11 +547,11 @@ module SwFac
|
|
546
547
|
## Creando cfdi:Traslados para cada linea
|
547
548
|
child_traslados = Nokogiri::XML::Node.new "cfdi:Traslados", xml
|
548
549
|
child_traslado = Nokogiri::XML::Node.new "cfdi:Traslado", xml
|
549
|
-
child_traslado['Base'] = total_line.round(
|
550
|
+
child_traslado['Base'] = total_line.round(4).to_s
|
550
551
|
child_traslado['Impuesto'] = '002'
|
551
552
|
child_traslado['TipoFactor'] = "Tasa"
|
552
553
|
child_traslado['TasaOCuota'] = '0.160000'
|
553
|
-
child_traslado['Importe'] = importe_iva.round(
|
554
|
+
child_traslado['Importe'] = importe_iva.round(4).to_s
|
554
555
|
|
555
556
|
# if line[:tipo_impuesto] == '004'
|
556
557
|
# child_traslado['TasaOCuota'] = '0.000000'
|
@@ -568,7 +569,7 @@ module SwFac
|
|
568
569
|
if ret_iva > 0
|
569
570
|
child_retenciones = Nokogiri::XML::Node.new "cfdi:Retenciones", xml
|
570
571
|
child_retencion = Nokogiri::XML::Node.new "cfdi:Retencion", xml
|
571
|
-
child_retencion['Base'] = total_line.round(
|
572
|
+
child_retencion['Base'] = total_line.round(4).to_s
|
572
573
|
child_retencion['Impuesto'] = '002'
|
573
574
|
child_retencion['TipoFactor'] = "Tasa"
|
574
575
|
|
@@ -578,7 +579,7 @@ module SwFac
|
|
578
579
|
child_retencion['TasaOCuota'] = "0.160000"
|
579
580
|
end
|
580
581
|
|
581
|
-
child_retencion['Importe'] = importe_ret_linea.round(
|
582
|
+
child_retencion['Importe'] = importe_ret_linea.round(4).to_s
|
582
583
|
|
583
584
|
child_retenciones.add_child(child_retencion)
|
584
585
|
child_impuestos.add_child(child_retenciones)
|
@@ -617,7 +618,7 @@ module SwFac
|
|
617
618
|
comprobante['Total'] = suma_total.round(2).to_s
|
618
619
|
end
|
619
620
|
|
620
|
-
|
621
|
+
|
621
622
|
## filling traslado info
|
622
623
|
traslado_child = Nokogiri::XML::Node.new "cfdi:Traslado", xml
|
623
624
|
traslado_child['Impuesto'] = '002'
|
data/lib/sw_fac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sw_fac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angel Padilla
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.10.
|
61
|
+
version: 1.10.9
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.10.
|
68
|
+
version: 1.10.9
|
69
69
|
description: Gem used to fetch the Smarter Web API for the mexican billing system
|
70
70
|
(SAT), this gem was builted and is currently used by the team at www.mfactura.ml
|
71
71
|
email:
|