Class: Plutus::Equity

Inherits:
Account
  • Object
show all
Defined in:
app/models/plutus/equity.rb

Overview

The Equity class is an account type used to represents owners rights to the assets.

Normal Balance

The normal balance on Equity accounts is a Credit.

See Also:

Author:

  • Michael Bulat

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Account

#credits_balance, #debits_balance, trial_balance, types

Class Method Details

.balance(options = {}) ⇒ BigDecimal

This class method is used to return the balance of all Equity accounts.

Contra accounts are automatically subtracted from the balance.

Takes an optional hash specifying :from_date and :to_date for calculating balances during periods. :from_date and :to_date may be strings of the form “yyyy-mm-dd” or Ruby Date objects

Examples:

>> Plutus::Equity.balance({:from_date => "2000-01-01", :to_date => Date.today})
=> #<BigDecimal:103259bb8,'0.1E4',4(12)>
>> Plutus::Equity.balance
=> #<BigDecimal:1030fcc98,'0.82875E5',8(20)>

Returns:

  • (BigDecimal)

    The decimal value balance



52
53
54
# File 'app/models/plutus/equity.rb', line 52

def self.balance(options={})
  super
end

Instance Method Details

#balance(options = {}) ⇒ BigDecimal

The balance of the account.

Equity accounts have normal credit balances, so the debits are subtracted from the credits unless this is a contra account, in which credits are subtracted from debits

Takes an optional hash specifying :from_date and :to_date for calculating balances during periods. :from_date and :to_date may be strings of the form “yyyy-mm-dd” or Ruby Date objects

Examples:

>> equity.balance({:from_date => "2000-01-01", :to_date => Date.today})
=> #<BigDecimal:103259bb8,'0.1E4',4(12)>
>> equity.balance
=> #<BigDecimal:103259bb8,'0.2E4',4(12)>

Returns:

  • (BigDecimal)

    The decimal value balance



31
32
33
# File 'app/models/plutus/equity.rb', line 31

def balance(options={})
  super
end