Sha256: 16aab030165a19342145db5fe974548585cdffec9576aa96e4001ae1c547fe62

Contents?: true

Size: 601 Bytes

Versions: 7

Compression:

Stored size: 601 Bytes

Contents

module Pacioli
  class Transaction < ActiveRecord::Base
    belongs_to :journal_entry, foreign_key: :pacioli_journal_entry_id
    belongs_to :account, foreign_key: :pacioli_account_id
    belongs_to :party, foreign_key: :pacioli_party_id

    def self.before(date=Time.now)
      where("dated < :q", q: date.to_time.end_of_day)
    end

    def self.between(start_date, end_date)
      where("dated >= :s AND dated <= :e", {s: start_date.to_time.beginning_of_day, e: end_date.to_time.end_of_day}).order(:dated)
    end

    def debit?
      false
    end

    def credit?
      false
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pacioli-0.0.22 lib/pacioli/transaction.rb
pacioli-0.0.21 lib/pacioli/transaction.rb
pacioli-0.0.20 lib/pacioli/transaction.rb
pacioli-0.0.19 lib/pacioli/transaction.rb
pacioli-0.0.18 lib/pacioli/transaction.rb
pacioli-0.0.17 lib/pacioli/transaction.rb
pacioli-0.0.16 lib/pacioli/transaction.rb