Sha256: 2d5f474ed6e30928475e9c4b5f835b2a367ce5f86bba0257b2d1f890b5d4d69f

Contents?: true

Size: 925 Bytes

Versions: 13

Compression:

Stored size: 925 Bytes

Contents

module BrDanfe
  module DanfeLib
    class Issqn
      Y_POSITION = 25.72 + SPACE_BETWEEN_GROUPS

      def initialize(pdf, xml)
        @pdf = pdf
        @xml = xml

        @title = Y_POSITION - 0.42
        @y_position = Y_POSITION

        @serv = "total/ISSQNtot/vServ"
        @bc = "total/ISSQNtot/vBC"
        @iss = "total/ISSQNtot/vISS"
      end

      def render
        if can_render?
          @pdf.ititle 0.42, 10.00, 0.75, @title, "issqn.title"
          @pdf.lbox LINE_HEIGHT, 4.64, 0.75, @y_position, @xml, "emit/IM"
          @pdf.lnumeric LINE_HEIGHT, 5.14, 5.39, @y_position, @xml, @serv
          @pdf.lnumeric LINE_HEIGHT, 5.14, 10.53, @y_position, @xml, @bc
          @pdf.lnumeric LINE_HEIGHT, 4.64, 15.67, @y_position, @xml, @iss
        end
      end

      private

      def can_render?
        (@xml[@serv].to_i > 0) || (@xml[@bc].to_i > 0) || (@xml[@iss].to_i > 0)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
br_danfe-0.11.1 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.11.0 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.10.1 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.10.0 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.8.0 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.7 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.6 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.5 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.4 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.3 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.2 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.1 lib/br_danfe/danfe_lib/issqn.rb
br_danfe-0.7.0 lib/br_danfe/danfe_lib/issqn.rb