Sha256: c63fe81a44638571b868bb7769db2fc1a1877600e0ca0f5313b813298182e7aa

Contents?: true

Size: 598 Bytes

Versions: 12

Compression:

Stored size: 598 Bytes

Contents

module BrDanfe
  module MdfeLib
    class FiscoControl
      def initialize(pdf, xml)
        @pdf = pdf
        @nfe_key = xml['mdfeProc > protMDFe > infProt > chMDFe']
      end

      def generate
        @pdf.text_box('CONTROLE DO FISCO', size: 9, align: :left, at: [250, 600])

        return if @nfe_key.blank?

        Barby::Code128C.new(@nfe_key).annotate_pdf(@pdf, x: 250, y: 530, height: 50)

        @pdf.text_box('Chave de Acesso', size: 9, align: :left, style: :bold, at: [250, 510])
        @pdf.text_box(@nfe_key, size: 11, align: :left, at: [250, 500])
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
br_danfe-1.0.0 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.20.0 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.19.0 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.18.0 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.8 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.7 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.6 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.5 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.4 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.3 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.2 lib/br_danfe/mdfe_lib/fisco_control.rb
br_danfe-0.17.1 lib/br_danfe/mdfe_lib/fisco_control.rb