Sha256: e435b0941d9397d8ef1c3722493eda5957a01a9d2f7a60ffa90d0b63f08143bc

Contents?: true

Size: 675 Bytes

Versions: 23

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

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

        module_function

        def execute(xml)
          {
            approximate_value_of_taxes: locate_element(xml, 'infCFe/total/vCFeLei12741'),
            total: locate_element(xml, 'infCFe/total/vCFe'),
            discount: locate_element(xml, 'infCFe/total/ICMSTot/vDesc'),
            total_price: locate_element(xml, 'infCFe/total/ICMSTot/vProd'),
            cashback: locate_element(xml, 'infCFe/pgto/vTroco'),
            paid: locate_element(xml, 'infCFe/pgto/MP/vMP')
          }
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.24 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.23 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.22 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.21 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.20 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.19 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.18 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.17 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.16 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.15 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.14 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.14.alpha.23 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.13 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.13.alpha.22 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.12.alpha.21 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.12.alpha.20 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.12 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.11 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.10 lib/br_invoices_pdf/cfe/parser/payment.rb
br_invoices_pdf-0.2.9 lib/br_invoices_pdf/cfe/parser/payment.rb