Module: BrInvoicesPdf::Cfe::Parser::ProductsData

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

Constant Summary collapse

FIELDS =
{ code: 'cProd', description: 'xProd', cfop: 'CFOP',
quantity: 'qCom', unit_label: 'uCom', total_value: 'vProd',
unit_value: 'vUnCom', item_value: 'vItem' }.freeze

Class Method Summary collapse

Methods included from Util::XmlLocate

locate_element, node_locate, root_path

Class Method Details

.execute(xml) ⇒ Object



15
16
17
18
# File 'lib/br_invoices_pdf/cfe/parser/products_data.rb', line 15

def execute(xml)
  node_products = xml.locate('infCFe/det')
  products_params(node_products) if node_products
end