sw_fac 0.3.43 → 0.3.44
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/sw_fac/config.rb +11 -1
- data/lib/sw_fac/facturacion.rb +23 -7
- data/lib/sw_fac/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: 55da73f003247aaf20b2fb2f231ced2431f417d7a2aefe966511679abaabcefd
|
4
|
+
data.tar.gz: e3895553e9aec7e65f72d599fab08b1f8771f95f2265c9186c9b857bc09b2e77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef41cdc155bfb3abb3d1468bc326f9450d6e18128f614064a81594ca2411fa4d22bb8b5b84f90d6558ff958cc0467310b29027af8448f4c6939555f0b83116fb
|
7
|
+
data.tar.gz: 92b18915471ec8d4adc18a8ccfa51d9c2921071fff3f4a42a203a2a7efa21c247bca4ca49c50c302297c32c9f80c6ba08686db20a274566810aee453c355367c
|
data/lib/sw_fac/config.rb
CHANGED
@@ -60,7 +60,17 @@ module SwFac
|
|
60
60
|
UrlProduction = "http://services.sw.com.mx/"
|
61
61
|
UrlDev = "http://services.test.sw.com.mx/"
|
62
62
|
|
63
|
-
DocBase = %(<?xml version="1.0" encoding="utf-8"?><cfdi:Comprobante xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd" Version="3.3" xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cfdi:Emisor
|
63
|
+
DocBase = %(<?xml version="1.0" encoding="utf-8"?><cfdi:Comprobante xsi:schemaLocation="http://www.sat.gob.mx/cfd/3 http://www.sat.gob.mx/sitio_internet/cfd/3/cfdv33.xsd" Version="3.3" xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cfdi:Emisor />
|
64
|
+
<cfdi:Receptor /><cfdi:Conceptos></cfdi:Conceptos>
|
65
|
+
<cfdi:Impuestos>
|
66
|
+
<cfdi:Retenciones TotalImpuestosRetenidos="0.00">
|
67
|
+
<cfdi:Retencion Importe="0.00" Impuesto="002"/>
|
68
|
+
</cfdi:Retenciones>
|
69
|
+
<cfdi:Traslados>
|
70
|
+
<cfdi:Traslado Impuesto="002" TipoFactor="Tasa" TasaOCuota="0.160000" />
|
71
|
+
</cfdi:Traslados>
|
72
|
+
</cfdi:Impuestos>
|
73
|
+
</cfdi:Comprobante>)
|
64
74
|
|
65
75
|
Doc_concepto = %(<cfdi:Concepto ClaveProdServ="25172504" NoIdentificacion="COST37125R17" Cantidad="1" ClaveUnidad="H87" Unidad="Pieza" Descripcion="Producto de prueba" ValorUnitario="1000.00" Importe="1000.00"><cfdi:Impuestos><cfdi:Traslados><cfdi:Traslado Base="1000.00" Impuesto="002" TipoFactor="Tasa" TasaOCuota="0.160000" Importe="160.00" /></cfdi:Traslados></cfdi:Impuestos></cfdi:Concepto>)
|
66
76
|
|
data/lib/sw_fac/facturacion.rb
CHANGED
@@ -414,6 +414,7 @@ module SwFac
|
|
414
414
|
# receptor_rfc: '',
|
415
415
|
# uso_cfdi: 'G03',
|
416
416
|
# time: "%Y-%m-%dT%H:%M:%S",
|
417
|
+
# retencion_iva: false, <------ ######
|
417
418
|
# line_items: [
|
418
419
|
# {
|
419
420
|
# clave_prod_serv: '78181500',
|
@@ -463,6 +464,7 @@ module SwFac
|
|
463
464
|
impuestos = xml.at_xpath("//cfdi:Impuestos")
|
464
465
|
traslado = xml.at_xpath("//cfdi:Traslado")
|
465
466
|
|
467
|
+
|
466
468
|
puts '--- sw_fac time -----'
|
467
469
|
puts time
|
468
470
|
puts '--------'
|
@@ -540,16 +542,30 @@ module SwFac
|
|
540
542
|
|
541
543
|
end
|
542
544
|
|
543
|
-
puts '------ Line -----'
|
544
|
-
puts "Total suma = #{suma_total}"
|
545
|
-
|
546
|
-
|
545
|
+
# puts '------ Line -----'
|
546
|
+
# puts "Total suma = #{suma_total}"
|
547
|
+
# puts "SubTotal suma = #{subtotal}"
|
548
|
+
# puts "Suma iva = #{suma_iva}"
|
549
|
+
|
547
550
|
|
548
|
-
comprobante['SubTotal'] = subtotal.round(2).to_s
|
549
|
-
comprobante['Total'] = suma_total.round(2).to_s
|
550
551
|
comprobante['Moneda'] = params.fetch(:moneda, 'MXN')
|
552
|
+
comprobante['SubTotal'] = subtotal.round(2).to_s
|
553
|
+
impuestos['TotalImpuestosTrasladados'] = suma_iva.round(2).to_s
|
554
|
+
|
555
|
+
|
556
|
+
### en caso de retencion de IVA
|
557
|
+
if params[:retencion_iva]
|
558
|
+
retencion = xml.at_xpath("//cfdi:Retencion")
|
559
|
+
retencion['Importe'] = suma_iva.round(2).to_s
|
560
|
+
|
561
|
+
comprobante['Total'] = subtotal.round(2).to_s
|
562
|
+
impuestos['TotalImpuestosRetenidos'] = suma_iva.round(2).to_s
|
563
|
+
else
|
564
|
+
comprobante['Total'] = suma_total.round(2).to_s
|
565
|
+
end
|
566
|
+
|
567
|
+
# comprobante['Total'] = suma_total.round(2).to_s
|
551
568
|
|
552
|
-
impuestos['TotalImpuestosTrasladados'] = suma_iva.round(2).to_s
|
553
569
|
traslado['Importe'] = suma_iva.round(2).to_s
|
554
570
|
|
555
571
|
path = File.join(File.dirname(__FILE__), *%w[.. tmp])
|
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.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angel Padilla
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|