Sha256: 39efc2e1d833d70354f5e0817f688710dfb7d2483c88300c8f1efe94471aa3f7

Contents?: true

Size: 1.6 KB

Versions: 24

Compression:

Stored size: 1.6 KB

Contents

module Einvoice
  module Tradevan
    module Model
      class IssueItem < Base
        VALID_OPTIONS_KEYS = [
          :saleIdentifier, # Same as invoice.saleIdentifier
          :serialNumber,
          :invoiceNumber,
          :invoiceDate,
          :invoiceTime,
          :productCode,
          :productName,
          :qty,
          :price,
          :tax,
          :itemExclude,
          :itemTotal,
          :taxType,
          :description
        ]

        attr_accessor *VALID_OPTIONS_KEYS

        validates :saleIdentifier, presence: true, length: { maximum: 100 }
        validates :serialNumber, presence: true, length: { is: 4 }, numericality: true
        validates :invoiceNumber, allow_blank: true, length: { is: 10 }
        validates :invoiceDate, allow_blank: true, length: { is: 8 }, numericality: true
        validates :invoiceTime, allow_blank: true, length: { is: 8 }, format: { with: /\Ad{2}\:\d{2}\:\d{2}\Z/ }
        validates :productCode, allow_blank: true, length: { maximum: 30 }
        validates :productName, presence: true, length: { maximum: 300 }
        validates :qty, presence: true, length: { maximum: 20 }
        validates :price, presence: true, length: { maximum: 20 }
        validates :tax, allow_blank: true, length: { maximum: 20 }
        validates :itemExclude, allow_blank: true, length: { maximum: 20 }
        validates :itemTotal, allow_blank: true, length: { maximum: 20 }
        validates :taxType, allow_blank: true, length: { is: 1 }, inclusion: { in: %w(T O Z) }
        validates :description, allow_blank: true, length: { maximum: 300 }
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
einvoice-1.2.22 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.21 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.20 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.19 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.18 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.17 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.16 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.15 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.14 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.13 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.12 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.11 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.10 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.9 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.8 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.7 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.6 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.5 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.4 lib/einvoice/tradevan/model/issue_item.rb
einvoice-1.2.3 lib/einvoice/tradevan/model/issue_item.rb