fdis 0.1.8 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fdis/facturacion.rb +9 -6
- data/lib/fdis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 520a75ea98b3981ce2ad784b6f16c4aa3e71717518a6cf10d8e4ef566066a9d5
|
4
|
+
data.tar.gz: a960ff084bf1772a6551a43feb53df6a532de1ec5366dedd1dfeb8f358e973f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59651fa191b4ff31782182e63957b042318a86fb7b4a3544336bef385c6d92554f49dce21cee6c277c02748ec3de726e3066dd13f66bd3a5d422e965185bd693
|
7
|
+
data.tar.gz: aadfb046bd81828b4aca783a9f34687b12ba4eeebcefb58a101a32c15d76f024ecef8b6cedd7f4f5593d46d37049cad2655d1d1406dc313050b07d3dab03a4cf
|
data/lib/fdis/facturacion.rb
CHANGED
@@ -213,8 +213,7 @@ module Fdis
|
|
213
213
|
when Net::HTTPSuccess, Net::HTTPRedirection
|
214
214
|
if response['success'] == true
|
215
215
|
decoded_xml = Nokogiri::XML(Base64.decode64(response['base64XmlFile']))
|
216
|
-
|
217
|
-
timbre = decoded_xml.at_xpath("//tfd:TimbreFiscalDigital")
|
216
|
+
timbre = decoded_xml.at_xpath("//cfdi:Complemento").children[0]
|
218
217
|
response = {
|
219
218
|
status: 200,
|
220
219
|
message_error: '',
|
@@ -557,7 +556,11 @@ module Fdis
|
|
557
556
|
receptor['Rfc'] = params.fetch(:receptor_rfc, '')
|
558
557
|
receptor['Nombre'] = params.fetch(:receptor_razon, '')
|
559
558
|
receptor['DomicilioFiscalReceptor'] = params.fetch(:receptor_cp, '47180')
|
560
|
-
|
559
|
+
if params[:receptor_razon] == 'XAXX010101000'
|
560
|
+
receptor['UsoCFDI'] = 'S01'
|
561
|
+
else
|
562
|
+
receptor['UsoCFDI'] = params.fetch(:uso_cfdi, 'G03')
|
563
|
+
end
|
561
564
|
receptor['RegimenFiscalReceptor'] = params.fetch(:receptor_regimen, '616')
|
562
565
|
|
563
566
|
# retencion_iva = params.fetch(:retencion_iva, 0)
|
@@ -783,7 +786,8 @@ module Fdis
|
|
783
786
|
puts "---- Fdis: Respuesta"
|
784
787
|
puts "-- Codigo: #{json_response.code} --"
|
785
788
|
puts "-- Mensaje: #{json_response.message} --"
|
786
|
-
puts "-- Body:
|
789
|
+
puts "-- Body: "
|
790
|
+
p json_response.body
|
787
791
|
|
788
792
|
response = JSON.parse(json_response.body)
|
789
793
|
|
@@ -791,8 +795,7 @@ module Fdis
|
|
791
795
|
when Net::HTTPSuccess, Net::HTTPRedirection
|
792
796
|
if response['success'] == true
|
793
797
|
decoded_xml = Nokogiri::XML(Base64.decode64(response['base64XmlFile']))
|
794
|
-
|
795
|
-
timbre = decoded_xml.at_xpath("//tfd:TimbreFiscalDigital")
|
798
|
+
timbre = decoded_xml.at_xpath("//cfdi:Complemento").children[0]
|
796
799
|
response = {
|
797
800
|
status: 200,
|
798
801
|
message_error: '',
|
data/lib/fdis/version.rb
CHANGED