Sha256: b5bff63b63fead6f89edea19259e004ee7c93ffebfdd312bf18403fb65ae59cc

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

module BrInvoicesPdf
  module Cfe
    module Renderer
      # :reek:DataClump
      module CompanyIdentification
        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

10 entries across 10 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.6 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.6.alpha.18 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.5.alpha.17 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.5 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.5.alpha.16 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.4 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.4.alpha.15 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.4.alpha.14 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.3 lib/br_invoices_pdf/cfe/renderer/company_identification.rb
br_invoices_pdf-0.2.2 lib/br_invoices_pdf/cfe/renderer/company_identification.rb