Sha256: 54e55301a7c127d06e997a2a193a260861c60412efde250752ce8f7c885e3fac

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

module BrDanfe
  module DanfeLib
    Y = 18.81 + SPACE_BETWEEN_GROUPS

    class DetHeader
      def initialize(pdf)
        @pdf = pdf

        @ltitle = Y - 0.42
        @l1 = Y
      end

      def render
        @pdf.ititle 0.42, 10.00, 0.75, @ltitle, "det.title"

        column(1.60, 0.75, "prod.cProd")
        column(6.10, 2.35, "prod.xProd")
        column(1.05, 8.45, "prod.NCM")
        column(0.60, 9.50, "ICMS.CST")
        column(0.70, 10.10, "prod.CFOP")
        column(1.05, 10.80, "prod.uCom")
        column(1.20, 11.85, "prod.qCom")
        column(1.20, 13.05, "prod.vUnCom")
        column(1.20, 14.25, "prod.vProd")
        column(1.20, 15.45, "ICMS.vBC")
        column(1.00, 16.65, "ICMS.vICMS")
        column(1.00, 17.65, "IPI.vIPI")
        column(0.90, 18.65, "ICMS.pICMS")
        column(0.76, 19.55, "IPI.pIPI")

        @pdf.horizontal_line 0.75.cm, 20.31.cm, at: Helper.invert(19.59.cm)
      end

      private
      def column(w, x, title)
        @pdf.ibox 6.40, w, x, @l1, I18n.t("danfe.det.#{title}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
br_danfe-0.6.1 lib/br_danfe/danfe_lib/det_header.rb