Class: Account

Account

This class defines an Account of a Book.
It mantains a balance of all amount credited and debited in it by Transactions.
An Account has a lower level granularity control and can be grouped by Groups.

new Account()

See:

Methods

getBalance(strict) → {number}

Gets the balance based on credit nature of this Account
Parameters:
Name Type Argument Description
strict boolean <optional>
True to strict get the balance, no matter the credit nature of this Account.
Returns:
The balance of this Account
Type
number

getDescription() → {string}

Returns:
The description of this Account
Type
string

getId() → {number}

Returns:
The id of this Account
Type
number

getName() → {string}

Returns:
The name of this Account
Type
string

getNormalizedName() → {string}

Returns:
The name of this Account without spaces and special characters
Type
string

getUsedTags() → {array}

Returns:
The hashtags used with this Account
Type
array

isActive() → {boolean}

Returns:
Check if this account is active
Type
boolean

isCredit() → {boolean}

Tell if the account has a credit or debit nature.

Credit accounts are just for representation purposes. It increase or decrease the absolute balance. It doesn't affect the overall balance or the behavior of the system.

The absolute balance of credit accounts increase when it participate as a credit/origin in a transaction. Its usually for Accounts that increase the balance of the assets, like revenue accounts.

       Crediting a credit
Thus ---------------------> account increases its absolute balance
       Debiting a debit


       Debiting a credit
Thus ---------------------> account decreases its absolute balance
       Crediting a debit
  

As a rule of thumb, and for simple understanding, almost all accounts are Debit nature (NOT credit), except the ones that "offers" amount for the books, like revenue accounts.
Returns:
true if its a credit nature Account, false if its debit
Type
boolean

isInGroup(Group) → {boolean}

Tell if this account is in the Group
Parameters:
Name Type Description
Group string | number | Group The Group name, id or object
Returns:
Type
boolean

isPermanent() → {boolean}

Tell if the account is permanent.

Permanent Accounts are the ones which final balance is relevant and keep its balances over time. They are also called Real Accounts.

Usually represents assets or tangibles, capable of being perceived by the senses or the mind, like bank accounts, money, debts and so on.
See:
Returns:
True if its a permanent Account
Type
boolean