br_invoices_pdf 0.2.16 → 0.2.17

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
  SHA1:
3
- metadata.gz: ad84095afafa8f87baa4f4222c486c35342c55a4
4
- data.tar.gz: ec313b7dba542551522eddf00c78fec0df48026d
3
+ metadata.gz: 1d45379de04929664e29c5758ae0d6e29c9dd1b9
4
+ data.tar.gz: 94ce8c18b8e1f1e8d987305844e603ebd4e2b46b
5
5
  SHA512:
6
- metadata.gz: 1e920fe9fccf9c1eba4bf61db797fabc86787d259fead942c0054b17fa318b9a5416f9a3f61b1fc5535bb9f2ab5bdbf465f13573b19cb61fac5e6015cd69a0aa
7
- data.tar.gz: 5257778ff4d1d3c46c2da56188d9b4c4b9ca0c08bc60e7ec83e33cd3a16eba84007cbbf311195fcb4684d6f2ed7afb44901db9e5ae9890234af2395eca7f78f6
6
+ metadata.gz: b01f9e71bf7e7ce2405fbe7bdbff9ca0a5925aa76f00ee7893b36442e7bc3c9c6c6513e9554bd84e342de09aa5555fc182eea71d46639873299dd15562eca76a
7
+ data.tar.gz: a7aa5a0d5cd109c3f17a61b376dfaa29c4ffd292196037cbb1f3f84fad1dfb93c66b4bb7187bc153dbf114d35a6aeab60e645a2419599755bcfb91429ef1d729
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## CHANGELOG
4
4
 
5
+ ## 0.2.17 [2018-08-24]
6
+ - [Corrigido] casos de caracteres especiais em documentos fiscais
7
+
5
8
  ## 0.2.16 [2018-07-16]
6
9
  - [Adicionado] Mensagem do procon
7
10
 
@@ -26,9 +26,10 @@ module BrInvoicesPdf
26
26
  private_class_method :products_params
27
27
 
28
28
  def product_by(element)
29
- FIELDS
30
- .map { |(key, field)| [key, node_locate(element, field).force_encoding('WINDOWS-1252').encode('UTF-8')] }
31
- .to_h
29
+ FIELDS.map do |(key, field)|
30
+ [key, node_locate(element, field).encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
31
+ .force_encoding('WINDOWS-1252').encode('UTF-8')]
32
+ end.to_h
32
33
  end
33
34
  private_class_method :product_by
34
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrInvoicesPdf
4
- VERSION = '0.2.16'
4
+ VERSION = '0.2.17'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_invoices_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.16
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Ribeiro
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-07-17 00:00:00.000000000 Z
12
+ date: 2018-08-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: barby
@@ -227,7 +227,6 @@ files:
227
227
  - LICENSE.txt
228
228
  - README.md
229
229
  - Rakefile
230
- - arquivo.xml
231
230
  - bin/console
232
231
  - bin/setup
233
232
  - br_invoices_pdf.gemspec
data/arquivo.xml DELETED
@@ -1 +0,0 @@
1
- <nfeProc versao="3.10" xmlns="http://www.portalfiscal.inf.br/nfe"><NFe xmlns="http://www.portalfiscal.inf.br/nfe"><infNFe Id="NFe35180109071370000194650010000001431171025444" versao="3.10"><ide><cUF>35</cUF><cNF>17102544</cNF><natOp>Venda</natOp><indPag>0</indPag><mod>65</mod><serie>1</serie><nNF>143</nNF><dhEmi>2018-01-25T20:20:27-02:00</dhEmi><tpNF>1</tpNF><idDest>1</idDest><cMunFG>3550308</cMunFG><tpImp>4</tpImp><tpEmis>1</tpEmis><cDV>4</cDV><tpAmb>1</tpAmb><finNFe>1</finNFe><indFinal>1</indFinal><indPres>1</indPres><procEmi>0</procEmi><verProc>1.0</verProc></ide><emit><CNPJ>09071370000194</CNPJ><xNome>TATU COLOR</xNome><enderEmit><xLgr>comercial</xLgr><nro>S/N</nro><xBairro>VILA CAMPANELA</xBairro><cMun>3550308</cMun><xMun>SAO PAULO</xMun><UF>SP</UF><CEP>08220900</CEP></enderEmit><IE>149808518114</IE><CRT>1</CRT></emit><det nItem="1"><prod><cProd>402</cProd><cEAN></cEAN><xProd>4 - Bubbles Maca Verde</xProd><NCM>21012010</NCM><CEST>1710800</CEST><CFOP>5102</CFOP><uCom>BUBBL</uCom><qCom>3</qCom><vUnCom>0.01</vUnCom><vProd>0.03</vProd><cEANTrib></cEANTrib><uTrib>BUBBL</uTrib><qTrib>3</qTrib><vUnTrib>0.01</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS></imposto></det><det nItem="2"><prod><cProd>310</cProd><cEAN></cEAN><xProd>3 - Frutose Manga</xProd><NCM>21012010</NCM><CEST>1710800</CEST><CFOP>5102</CFOP><uCom>FRUTO</uCom><qCom>3</qCom><vUnCom>0.01</vUnCom><vProd>0.03</vProd><cEANTrib></cEANTrib><uTrib>FRUTO</uTrib><qTrib>3</qTrib><vUnTrib>0.01</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS></imposto></det><det nItem="3"><prod><cProd>205</cProd><cEAN></cEAN><xProd>2 - Hibisco</xProd><NCM>21012010</NCM><CEST>1710800</CEST><CFOP>5102</CFOP><uCom>BASE</uCom><qCom>3</qCom><vUnCom>0.01</vUnCom><vProd>0.03</vProd><cEANTrib></cEANTrib><uTrib>BASE</uTrib><qTrib>3</qTrib><vUnTrib>0.01</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS></imposto></det><det nItem="4"><prod><cProd>101</cProd><cEAN></cEAN><xProd>1 - Copo 500ml</xProd><NCM>21012010</NCM><CEST>1710800</CEST><CFOP>5102</CFOP><uCom>UND</uCom><qCom>1</qCom><vUnCom>11.97</vUnCom><vProd>11.97</vProd><cEANTrib></cEANTrib><uTrib>UND</uTrib><qTrib>1</qTrib><vUnTrib>11.97</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS></imposto></det><det nItem="5"><prod><cProd>102</cProd><cEAN></cEAN><xProd>1 - Copo 700ml</xProd><NCM>21012010</NCM><CEST>1710800</CEST><CFOP>5102</CFOP><uCom>UND</uCom><qCom>2</qCom><vUnCom>14.97</vUnCom><vProd>29.94</vProd><cEANTrib></cEANTrib><uTrib>UND</uTrib><qTrib>2</qTrib><vUnTrib>14.97</vUnTrib><indTot>1</indTot></prod><imposto><ICMS><ICMSSN102><orig>0</orig><CSOSN>102</CSOSN></ICMSSN102></ICMS></imposto></det><total><ICMSTot><vBC>0.00</vBC><vICMS>0.00</vICMS><vICMSDeson>0.00</vICMSDeson><vBCST>0.00</vBCST><vST>0.00</vST><vProd>42.00</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0.00</vII><vIPI>0.00</vIPI><vPIS>0.00</vPIS><vCOFINS>0.00</vCOFINS><vOutro>0.00</vOutro><vNF>42.00</vNF></ICMSTot></total><transp><modFrete>9</modFrete></transp><pag><tPag>04</tPag><vPag>42.00</vPag></pag></infNFe><infNFeSupl><qrCode><![CDATA[https://www.nfce.fazenda.sp.gov.br/NFCeConsultaPublica/Paginas/ConsultaQRCode.aspx?chNFe=35180109071370000194650010000001431171025444&nVersao=100&tpAmb=1&dhEmi=323031382d30312d32355432303a32303a32372d30323a3030&vNF=42.00&vICMS=0.00&digVal=58615435306a4a2b454e62354e546f45656c3662506161563064413d&cIdToken=000001&cHashQRCode=5879F4DCBB4EFDA1EECF8CBF4FBD44E5E3206561]]></qrCode></infNFeSupl><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI="#NFe35180109071370000194650010000001431171025444"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>XaT50jJ+ENb5NToEel6bPaaV0dA=</DigestValue></Reference></SignedInfo><SignatureValue>EHacA4Dkaj4WRFVnwZZvagqmoUEOwqStyeNfcBKL3K6dwX4GIR6vt0i+i0XnkivjnZA27CzdGV+sPBeCY9P1Kcw2Bbds8QbuCvFV0R5Fb7oGw7nnXkPchVPNG06lMAvUTNOdAOBof1XXdv1AIkySRggS3Xs4VH/yiRx8H7YwlvqpdVTRLgpdaOKpkwfHJKEr+ZYEbMCSvTzIu8o4FkAOljoUCT1tgdbOw+Xcz7q9FupvK2zO7GAagjy1M3iYcpLj42k/hfk/sG9eJXFQ4kPe9GqoHsrIKE8KGsHROuFCmxxkYhBI7OguyhnmerlpUYiIepqorJc/9sE9tZNLsLZkgA==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIHuDCCBaCgAwIBAgIIWRpAu80M1xQwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCQlIxEzARBgNVBAoMCklDUC1CcmFzaWwxNjA0BgNVBAsMLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFsIGRvIEJyYXNpbCAtIFJGQjEZMBcGA1UEAwwQQUMgU0VSQVNBIFJGQiB2NTAeFw0xNzA4MTAyMDA2MDBaFw0xODA4MTAyMDA2MDBaMIHtMQswCQYDVQQGEwJCUjELMAkGA1UECAwCU1AxEjAQBgNVBAcMCVNBTyBQQVVMTzETMBEGA1UECgwKSUNQLUJyYXNpbDE2MDQGA1UECwwtU2VjcmV0YXJpYSBkYSBSZWNlaXRhIEZlZGVyYWwgZG8gQnJhc2lsI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n+bMdyTouQvaTSO5IPXTcXvVbEh2tb3VQxhPsQb95/regmz9UEFPSPpm0ZXuBCCmvgNacM2rC+wulmSEsjdkT6leBH3JMQWQrqG5XqkJ6EYhzcoQWGlqv</X509Certificate></X509Data></KeyInfo></Signature></NFe><protNFe versao="3.10"><infProt><tpAmb>1</tpAmb><verAplic>SP_NFCE_PL_008i2</verAplic><chNFe>35180109071370000194650010000001431171025444</chNFe><dhRecbto>2018-01-25T20:20:27-02:00</dhRecbto><nProt>135180012446205</nProt><digVal>XaT50jJ+ENb5NToEel6bPaaV0dA=</digVal><cStat>100</cStat><xMotivo>Autorizado o uso da NF-e</xMotivo></infProt></protNFe></nfeProc>