Sha256: d15f534b34b36497fb0b7585325271ac6200e4dccefb9471fbb14d50d754436d

Contents?: true

Size: 801 Bytes

Versions: 23

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Cfe
    module Parser
      module Sat
        extend Util::XmlLocate

        module_function

        AVAILABLE_UF = { '35' => 'São Paulo' }.freeze

        def execute(xml)
          {
            pos_number: locate_element(xml, 'infCFe/ide/numeroCaixa'),
            ncfe_number: locate_element(xml, 'infCFe/ide/nCFe'),
            uf: AVAILABLE_UF[locate_element(xml, 'infCFe/ide/cUF')],
            sat_number: locate_element(xml, 'infCFe/ide/nserieSAT'),
            emission_date: locate_element(xml, 'infCFe/ide/dEmi'),
            emission_hour: locate_element(xml, 'infCFe/ide/hEmi'),
            document_qr_code_signature: locate_element(xml, 'infCFe/ide/assinaturaQRCODE')
          }
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.8 lib/br_invoices_pdf/cfe/parser/sat.rb
br_invoices_pdf-0.2.7 lib/br_invoices_pdf/cfe/parser/sat.rb
br_invoices_pdf-0.2.6.alpha.19 lib/br_invoices_pdf/cfe/parser/sat.rb