Sha256: dfabd11551408ec8ae1d0da7d62a998e6c51c9ff8c1cc50eb76096b1aae39c29

Contents?: true

Size: 1.11 KB

Versions: 23

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Cfe
    module Renderer
      # :reek:DataClump
      module CompanyIdentification
        extend Util::BaseRenderer
        extend BaseRenderer

        module_function

        def execute(pdf, data)
          attributes = data[:company_attributes]
          pdf_setup(pdf) do
            company_params(pdf, attributes)
          end
        end

        # :reek:FeatureEnvy
        def company_params(pdf, data)
          pdf.text(data[:trading_name], align: :center)
          pdf.text(data[:company_name], align: :center)
          pdf.text(format_address(data[:address]), align: :center)
          insert_fiscal_numbers(pdf, data)
        end
        private_class_method :company_params

        # :reek:FeatureEnvy
        def insert_fiscal_numbers(pdf, data)
          pdf.text("CNPJ: #{format_cnpj(data[:cnpj])}", align: :center)
          pdf.text("Inscrição Estadual: #{data[:ie]}", align: :center)
          pdf.text("Inscrição Municipal: #{data[:im]}", align: :center)
        end
        private_class_method :insert_fiscal_numbers
      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/renderer/company_identification.rb
br_invoices_pdf-0.2.23 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.22 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.21 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.20 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.19 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.18 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.17 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.16 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.15 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.14 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.14.alpha.23 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.13 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.13.alpha.22 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.12.alpha.21 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.12.alpha.20 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.12 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.11 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.10 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.9 lib/br_invoices_pdf/cfe/renderer/company_identification.rb