Sha256: 71910aef621d5fd8acb3c62315e4ab76c69112254a0298e2399f962d260e22d9

Contents?: true

Size: 687 Bytes

Versions: 4

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

require_relative 'account'
require_relative 'department'
require_relative 'ledger_class'

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      class JournalEntryLineDetail < QuickBooksOnline::Resource
        TYPES = {
          'debit' => 'Debit',
          'credit' => 'Credit'
        }.freeze

        references_one :Account, to: Account
        references_one :Department, to: Department
        references_one :Class, to: LedgerClass
        attribute :PostingType, type: Type::StringFromSet.new(values: TYPES.keys)

        def name
          "#{self.PostingType} #{self.Account.try(:name)}"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.6.0 lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_detail.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_detail.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_detail.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/quickbooks_online/resources/journal_entry_line_detail.rb