br_invoices_pdf 0.2.15 → 0.2.16

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: 34d08c034ae8a529faf5658815cb00f5d478c1ff
4
- data.tar.gz: 4d4dfd8e1c611458cdfd2a4fd0c698ce1ba0fb0b
3
+ metadata.gz: ad84095afafa8f87baa4f4222c486c35342c55a4
4
+ data.tar.gz: ec313b7dba542551522eddf00c78fec0df48026d
5
5
  SHA512:
6
- metadata.gz: c8dcea3db07431ceb91b20646578489aa3fb3c5609d5d0260d81c1af1af8f354aa8603f6e6b9370687fe63e2e8289024ac43d158e71d6987ea981b5e8989b3ba
7
- data.tar.gz: 55fd667a3807ca5dae264604b355e3b05fba9d550d892fd90ae27277f616fe735b7ac9f253fc3d0e08ca0cccf14ec479d364c2a47cda66395cae5c20d56fe317
6
+ metadata.gz: 1e920fe9fccf9c1eba4bf61db797fabc86787d259fead942c0054b17fa318b9a5416f9a3f61b1fc5535bb9f2ab5bdbf465f13573b19cb61fac5e6015cd69a0aa
7
+ data.tar.gz: 5257778ff4d1d3c46c2da56188d9b4c4b9ca0c08bc60e7ec83e33cd3a16eba84007cbbf311195fcb4684d6f2ed7afb44901db9e5ae9890234af2395eca7f78f6
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## CHANGELOG
4
4
 
5
+ ## 0.2.16 [2018-07-16]
6
+ - [Adicionado] Mensagem do procon
7
+
5
8
  ## 0.2.15 [2018-07-10]
6
9
  - [Corrigido] Tributos na NFCE
7
10
 
@@ -0,0 +1 @@
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>MIIHuDCCBaCgAwIBAgIIWRpAu80M1xQwDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMCQlIxEzARBgNVBAoMCklDUC1CcmFzaWwxNjA0BgNVBAsMLVNlY3JldGFyaWEgZGEgUmVjZWl0YSBGZWRlcmFsIGRvIEJyYXNpbCAtIFJGQjEZMBcGA1UEAwwQQUMgU0VSQVNBIF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dEKVKWObRpIITKsfM0kS0SllpZ5fp+AN3mCknRzoChyX5fGumJN9yPfDbdgMqfO/QNHI+y2F9T/49G4g38fCOQ9er2UoJfUQ/pNcHIZY4QWL3Y6PMiEFdyGYfVUsmaBzl8iK4ef4oEOB+R/ANA/N8w8KmfO6CofUe3Vslx0O6i9ZuyXjA/VtEieoyfnLBmsULrvSksiERQVZj2Zi/NYKn+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>
@@ -7,6 +7,7 @@ require 'br_invoices_pdf/nfce/renderer/product_table'
7
7
  require 'br_invoices_pdf/nfce/renderer/totals'
8
8
  require 'br_invoices_pdf/nfce/renderer/payment_forms'
9
9
  require 'br_invoices_pdf/nfce/renderer/taxes_info'
10
+ require 'br_invoices_pdf/nfce/renderer/procon_info'
10
11
  require 'br_invoices_pdf/nfce/renderer/fiscal_message'
11
12
  require 'br_invoices_pdf/nfce/renderer/qr_code'
12
13
 
@@ -24,6 +25,7 @@ module BrInvoicesPdf
24
25
  Totals,
25
26
  PaymentForms,
26
27
  TaxesInfo,
28
+ ProconInfo,
27
29
  FiscalMessage,
28
30
  CustomerIdentification,
29
31
  QrCode
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrInvoicesPdf
4
+ module Nfce
5
+ module Renderer
6
+ module ProconInfo
7
+ extend Util::BaseRenderer
8
+ extend BaseRenderer
9
+
10
+ module_function
11
+
12
+ def execute(pdf, data)
13
+ procon_message = data[:additional_variables][:procon_message]
14
+
15
+ return if ['', nil].include? procon_message
16
+ box(pdf, [0, pdf.cursor], page_content_width(pdf)) do
17
+ procon_message(pdf, procon_message)
18
+ end
19
+ end
20
+
21
+ # :reek:FeatureEnvy
22
+ def procon_message(pdf, message)
23
+ pdf.text("Mensagem de Interesse do Contribuente:\n\n", style: :italic)
24
+ text = "#{message}\n\n"
25
+ pdf.text(text, align: :center)
26
+ end
27
+ private_class_method :procon_message
28
+ end
29
+ end
30
+ end
31
+ end
@@ -13,6 +13,8 @@ module BrInvoicesPdf
13
13
  def generate_pdf(data, options, renderers)
14
14
  page_width = Util::BaseRenderer.page_paper_width(options[:page_size])
15
15
 
16
+ data[:additional_variables] = options[:additional_variables] || {}
17
+
16
18
  Prawn::Document.new(options.merge(page_size: [page_width, AUTO_HEIGHT_MOCK])) do |pdf|
17
19
  pdf_content(pdf, data, page_width: page_width, renderers: renderers)
18
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrInvoicesPdf
4
- VERSION = '0.2.15'
4
+ VERSION = '0.2.16'
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.15
4
+ version: 0.2.16
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-10 00:00:00.000000000 Z
12
+ date: 2018-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: barby
@@ -227,6 +227,7 @@ files:
227
227
  - LICENSE.txt
228
228
  - README.md
229
229
  - Rakefile
230
+ - arquivo.xml
230
231
  - bin/console
231
232
  - bin/setup
232
233
  - br_invoices_pdf.gemspec
@@ -271,6 +272,7 @@ files:
271
272
  - lib/br_invoices_pdf/nfce/renderer/fiscal_message.rb
272
273
  - lib/br_invoices_pdf/nfce/renderer/header.rb
273
274
  - lib/br_invoices_pdf/nfce/renderer/payment_forms.rb
275
+ - lib/br_invoices_pdf/nfce/renderer/procon_info.rb
274
276
  - lib/br_invoices_pdf/nfce/renderer/product_table.rb
275
277
  - lib/br_invoices_pdf/nfce/renderer/qr_code.rb
276
278
  - lib/br_invoices_pdf/nfce/renderer/taxes_info.rb