View Source SoftBank.Account (soft_bank v1.1.3)
An Account represents accounts in the system which are of asset, liability, or equity types, in accordance with the "accounting equation".
Each account must be set to one of the following types:
TYPE | NORMAL BALANCE | DESCRIPTION |
---|---|---|
asset | Debit | Resources owned by the Business Entity |
liability | Credit | Debts owed to outsiders |
equity | Credit | Owners rights to the Assets |
Each account can also be marked as a Contra Account. A contra account will have it's normal balance swapped. For example, to remove equity, a "Drawing" account may be created as a contra equity account as follows:
account = %Fuentes.Account{name: "Drawing", type: "asset", contra: true}
At all times the balance of all accounts should conform to the "accounting equation"
Assets = Liabilities + Owner's Equity
Each account type acts as it's own ledger.
For more details see:
Wikipedia - Accounting Equation Wikipedia - Debits, Credits, and Contra Accounts
Summary
Functions
Computes the account balance for a given SoftBank.Account
in a given
Ecto.Repo when provided with a map of dates in the format
%{from_date: from_date, to_date: to_date}
.
Returns Decimal type.
Builds a changeset based on the struct
and params
.
Fetch the Account from the Repo.
Create new account with default ledgers
Computes a test balance for all accounts in the provided Ecto.Repo. Returns Money type.
Types
@type t() :: %SoftBank.Account{ __meta__: term(), account_number: String.t(), amounts: [SoftBank.Amount], balance: term(), contra: Boolean.t(), default_currency: String.t(), entry: term(), hash: String.t(), id: term(), inserted_at: term(), name: String.t(), type: String.t(), updated_at: term() }
An Account type.
Functions
account_balance(repo \\ Config.repo(), account_or_account_list, dates \\ nil)
View SourceComputes the account balance for a given SoftBank.Account
in a given
Ecto.Repo when provided with a map of dates in the format
%{from_date: from_date, to_date: to_date}
.
Returns Decimal type.
Builds a changeset based on the struct
and params
.
Fetch the Account from the Repo.
Create new account with default ledgers
Computes a test balance for all accounts in the provided Ecto.Repo. Returns Money type.