Module: BrInvoicesPdf::Cfe::Parser::Sat

Extended by:
Util::XmlLocate
Defined in:
lib/br_invoices_pdf/cfe/parser/sat.rb

Constant Summary collapse

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

Class Method Summary collapse

Methods included from Util::XmlLocate

locate_element, node_locate, root_path

Class Method Details

.execute(xml) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/br_invoices_pdf/cfe/parser/sat.rb', line 13

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