Sha256: c406f132fe0d2b94d427950b3755eb00f525ae258ee5e67ee3b25595d9b29ac7

Contents?: true

Size: 1.28 KB

Versions: 9

Compression:

Stored size: 1.28 KB

Contents

module NetSuite
  module Records
    class JournalEntry
      include Support::Fields
      include Support::RecordRefs
      include Support::Records
      include Support::Actions
      include Namespaces::TranGeneral

      actions :get, :get_list, :add, :delete, :upsert

      fields :approved, :created_date, :exchange_rate, :last_modified_date, :reversal_date, :reversal_defer, :reversal_entry,
        :tran_date, :tran_id

      field :custom_field_list, CustomFieldList
      field :line_list,         JournalEntryLineList

      record_refs :created_from, :currency, :custom_form, :department, :klass, :location, :parent_expense_alloc,
        :posting_period, :subsidiary, :to_subsidiary

      attr_reader   :internal_id
      attr_accessor :external_id

        def initialize(attributes = {})
          @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
          @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
          initialize_from_attributes_hash(attributes)
        end

      def to_record
        rec = super
        if rec["#{record_namespace}:customFieldList"]
          rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList")
        end
        rec
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
netsuite-0.4.6 lib/netsuite/records/journal_entry.rb
netsuite-0.4.5 lib/netsuite/records/journal_entry.rb
netsuite-0.4.4 lib/netsuite/records/journal_entry.rb
netsuite-0.4.3 lib/netsuite/records/journal_entry.rb
netsuite-0.4.2 lib/netsuite/records/journal_entry.rb
netsuite-0.4.1 lib/netsuite/records/journal_entry.rb
netsuite-0.4.0 lib/netsuite/records/journal_entry.rb
netsuite-0.3.3 lib/netsuite/records/journal_entry.rb
netsuite-0.3.2 lib/netsuite/records/journal_entry.rb