sw_fac 0.3.44 → 0.3.45

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55da73f003247aaf20b2fb2f231ced2431f417d7a2aefe966511679abaabcefd
4
- data.tar.gz: e3895553e9aec7e65f72d599fab08b1f8771f95f2265c9186c9b857bc09b2e77
3
+ metadata.gz: 2eea41bdba37ef2f3ce75347eb8b3ebd00cc43d1f567ef8eb303f967c966493d
4
+ data.tar.gz: 2f17be162ce59e857ffb6d3d96a35a16f8aefd9e1407330d2572211477feb792
5
5
  SHA512:
6
- metadata.gz: ef41cdc155bfb3abb3d1468bc326f9450d6e18128f614064a81594ca2411fa4d22bb8b5b84f90d6558ff958cc0467310b29027af8448f4c6939555f0b83116fb
7
- data.tar.gz: 92b18915471ec8d4adc18a8ccfa51d9c2921071fff3f4a42a203a2a7efa21c247bca4ca49c50c302297c32c9f80c6ba08686db20a274566810aee453c355367c
6
+ metadata.gz: 57232fff97ecfeea4de8b6a0dac722f90330a38bfee01c86f4df10aa420cad7e620f83b6e63ce2f6072cb54aa98678d2d39d749b6e26dd2ed32271cc3a01bf00
7
+ data.tar.gz: 0fcd1ac24871aecb53a5c95e2b34a52cd2555754e0f82acc51386ec857a88ef56183493a154da11cee1d27e8f48bdf54e6522d0ed157c90cd65d28e151669d4d
data/lib/sw_fac/config.rb CHANGED
@@ -62,15 +62,7 @@ module SwFac
62
62
 
63
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
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>)
65
+ <cfdi:Impuestos><cfdi:Traslados><cfdi:Traslado Impuesto="002" TipoFactor="Tasa" TasaOCuota="0.160000" /></cfdi:Traslados></cfdi:Impuestos></cfdi:Comprobante>)
74
66
 
75
67
  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>)
76
68
 
@@ -555,11 +555,19 @@ module SwFac
555
555
 
556
556
  ### en caso de retencion de IVA
557
557
  if params[:retencion_iva]
558
- retencion = xml.at_xpath("//cfdi:Retencion")
559
- retencion['Importe'] = suma_iva.round(2).to_s
558
+ retencion = Nokogiri::XML::Node.new "cfdi:Retenciones", xml
559
+ retencion_child = Nokogiri::XML::Node.new "cfdi:Retencion", xml
560
+
561
+ # retencion = xml.at_xpath("//cfdi:Retencion")
562
+ retencion_child['Impuesto'] = "002"
563
+ retencion_child['Importe'] = suma_iva.round(2).to_s
560
564
 
561
565
  comprobante['Total'] = subtotal.round(2).to_s
562
566
  impuestos['TotalImpuestosRetenidos'] = suma_iva.round(2).to_s
567
+
568
+
569
+ retencion.add_child(retencion_child)
570
+ impuestos.add_child(retencion)
563
571
  else
564
572
  comprobante['Total'] = suma_total.round(2).to_s
565
573
  end
@@ -585,9 +593,9 @@ module SwFac
585
593
  File.delete("#{xml_path}")
586
594
  File.delete("#{key_pem_url}")
587
595
 
588
- # puts '---- comprobante sin timbrar------'
589
- # puts xml.to_xml
590
- # puts '-------------------------'
596
+ puts '---- SW GEM comprobante sin timbrar ------'
597
+ puts xml.to_xml
598
+ puts '-------------------------'
591
599
 
592
600
  base64_xml = Base64.encode64(xml.to_xml)
593
601
  request = Net::HTTP::Post.new(uri)
@@ -1,3 +1,3 @@
1
1
  module SwFac
2
- VERSION = "0.3.44"
2
+ VERSION = "0.3.45"
3
3
  end
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.44
4
+ version: 0.3.45
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-07-04 00:00:00.000000000 Z
11
+ date: 2019-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler