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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a4d7499aec20e1f0fcbebe1daf7ca9f6ac4cadc6b3162c7429efc11369cc48c
4
- data.tar.gz: a6cda025cc360aa35f20887b78ca42e1e8325d12185cfce84f2133b0556a2d8a
3
+ metadata.gz: 520a75ea98b3981ce2ad784b6f16c4aa3e71717518a6cf10d8e4ef566066a9d5
4
+ data.tar.gz: a960ff084bf1772a6551a43feb53df6a532de1ec5366dedd1dfeb8f358e973f8
5
5
  SHA512:
6
- metadata.gz: 40818994252d22471ca584b427d57fd66bd246d9b4194ba4874f6d143d0067dcf4f0f344b01615d0d269797c21cf899c0865f5d4b9d503a9cf9094110b138d08
7
- data.tar.gz: 7180812acb9da3d31b4bb7baa7ecba3640673a03a971e3671b6336d0159b50a4b3c16450588e0cefeac46666cd935cfaae71066d5f4f203a19c7ecbac9d0b5b1
6
+ metadata.gz: 59651fa191b4ff31782182e63957b042318a86fb7b4a3544336bef385c6d92554f49dce21cee6c277c02748ec3de726e3066dd13f66bd3a5d422e965185bd693
7
+ data.tar.gz: aadfb046bd81828b4aca783a9f34687b12ba4eeebcefb58a101a32c15d76f024ecef8b6cedd7f4f5593d46d37049cad2655d1d1406dc313050b07d3dab03a4cf
@@ -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
- # timbre = decoded_xml.at_xpath("//cfdi:Complemento").children[1]
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
- receptor['UsoCFDI'] = params.fetch(:uso_cfdi, 'G03')
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: #{json_response.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
- # timbre = decoded_xml.at_xpath("//cfdi:Complemento").children[1]
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
@@ -1,3 +1,3 @@
1
1
  module Fdis
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel Padilla