Sha256: 36b171c86e3dc08e494a57d0f5cc7c4df4066c5857fc9058d2e30806c896bce7

Contents?: true

Size: 921 Bytes

Versions: 9

Compression:

Stored size: 921 Bytes

Contents

module Riif::DSL
  class Trns < Base
    HEADER_COLUMNS = [
      :trnsid,
      :trnstype,
      :date,
      :accnt,
      :name,
      :class,
      :amount,
      :docnum,
      :memo,
      :clear,
      :toprint,
      :addr1,
      :addr2,
      :addr3,
      :addr4,
      :addr5,
      :saddr1,
      :saddr2,
      :saddr3,
      :saddr4,
      :saddr5,
      :duedate,
      :terms,
      :paid,
      :paymeth,
      :shipdate,
      :rep,
      :ponum,
      :invtitle,
      :invmemo
    ]
    START_COLUMN = 'TRNS'
    END_COLUMN = 'ENDTRNS'

    def headers
      [
        ["!#{START_COLUMN}"].concat(HEADER_COLUMNS.map(&:upcase)),
        ["!SPL"].concat(Spl::HEADER_COLUMNS.map(&:upcase)),
        ["!#{END_COLUMN}"]
      ]
    end

    def rows
      @rows << [END_COLUMN]
    end

    def spl(&block)
      Spl.new.build(&block)[:rows].each do |row|
        @rows << row
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
riif-1.1.0 lib/riif/dsl/trns.rb
riif-1.0.0 lib/riif/dsl/trns.rb
riif-0.9.0 lib/riif/dsl/trns.rb
riif-0.8.0 lib/riif/dsl/trns.rb
riif-0.7.0 lib/riif/dsl/trns.rb
iif-0.6.1 lib/riif/dsl/trns.rb
riif-0.6.0 lib/riif/dsl/trns.rb
riif-0.5.0 lib/riif/dsl/trns.rb
riif-0.4.0 lib/riif/dsl/trns.rb