Sha256: bb17bb6cb9f86051e247fda04837e5d722992991cfe87a915a63e5f643ff7b86

Contents?: true

Size: 800 Bytes

Versions: 12

Compression:

Stored size: 800 Bytes

Contents

module BrDanfe
  module DanfeLib
    module NfceLib
      class NfceIdentification
        def initialize(pdf, xml)
          @pdf = pdf
          @xml = xml
        end

        def render
          emitted_at = BrDanfe::Helper.format_datetime(@xml['ide/dhEmi'])
          identification = "NFC-e nº #{@xml['ide/nNF']} Série #{@xml['ide/serie']} #{emitted_at}"

          @pdf.render_blank_line
          @pdf.text identification, size: 7, align: :center, style: :bold
          @pdf.text "<b>Protocolo de autorização:</b> #{@xml['infProt/nProt']}", size: 7, align: :center, inline_format: true
          @pdf.text "<b>Data de autorização: </b> #{BrDanfe::Helper.format_datetime(@xml['infProt/dhRecbto'])}", size: 7, align: :center, inline_format: true
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
br_danfe-0.16.0 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.15.1 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.15.0 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.14.5 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.14.4 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.14.3 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.14.2 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.14.0 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.13.3 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.13.2 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.13.1 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb
br_danfe-0.13.0 lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb