Account
Extends
Account
Properties
payload
payload: Account;The underlying payload data for this resource
Inherited from
Bkper.Account.payloadMethods
addGroup()
addGroup(group): Account;Add a group to the Account.
Parameters
| Parameter | Type |
|---|---|
group | string | Group |
Returns
Account
This Account, for chainning.
Inherited from
Bkper.Account.addGroupcreate()
create(): Account;Perform create new account.
Returns
Account
The created Account, for chainning.
Inherited from
Bkper.Account.createdeleteProperty()
deleteProperty(key): this;Deletes a custom property.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
this
This resource, for chaining
Inherited from
Bkper.Account.deletePropertygetBalance()
getBalance(): Amount;Gets the balance on the current month, based on the credit nature of this Account.
Returns
Amount
The balance of this account.
Inherited from
Bkper.Account.getBalancegetBalanceRaw()
getBalanceRaw(): Amount;Gets the raw balance on the current month, no matter the credit nature of this Account.
Returns
Amount
The balance of this account.
Inherited from
Bkper.Account.getBalanceRawgetDescription()
getDescription(): string;Gets the account description
Returns
string
Inherited from
Bkper.Account.getDescriptiongetGroups()
getGroups(): Group[];Get the [[Groups]] of this account.
Returns
Group[]
Inherited from
Bkper.Account.getGroupsgetId()
getId(): string;Gets the account internal id.
Returns
string
Inherited from
Bkper.Account.getIdgetName()
getName(): string;Gets the account name.
Returns
string
Inherited from
Bkper.Account.getNamegetNormalizedName()
getNormalizedName(): string;Returns
string
The name of this account without spaces or special characters.
Inherited from
Bkper.Account.getNormalizedNamegetProperties()
getProperties(): object;Gets the custom properties stored in this resource.
Returns
object
Object with key/value pair properties
Inherited from
Bkper.Account.getPropertiesgetProperty()
getProperty(...keys): string;Gets the property value for given keys. First property found will be retrieved.
Parameters
| Parameter | Type |
|---|---|
…keys | string[] |
Returns
string
The property value or null if not found
Inherited from
Bkper.Account.getPropertygetPropertyKeys()
getPropertyKeys(): string[];Gets the custom properties keys stored in this resource.
Returns
string[]
Array of property keys sorted alphabetically
Inherited from
Bkper.Account.getPropertyKeysgetType()
getType(): AccountType;Returns
The type for of this account.
Inherited from
Bkper.Account.getTypegetVisibleProperties()
getVisibleProperties(): object;Gets the visible custom properties stored in this resource. Hidden properties (those ending with ”_”) are excluded from the result.
Returns
object
Object with key/value pair properties, excluding hidden properties
Inherited from
Bkper.Account.getVisiblePropertieshasTransactionPosted()
hasTransactionPosted(): boolean;Tell if the Account has any transaction already posted.
Accounts with transaction posted, even with zero balance, can only be archived.
Returns
boolean
Inherited from
Bkper.Account.hasTransactionPostedisActive()
isActive(): boolean;Tell if this account is Active or otherwise Archived.
Returns
boolean
Inherited from
Bkper.Account.isActiveisArchived()
isArchived(): boolean;Tell if this account is archived.
Returns
boolean
Inherited from
Bkper.Account.isArchivedisCredit()
isCredit(): boolean;Tell if the account has a Credit nature or Debit otherwise
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 debitAs 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
boolean
Inherited from
Bkper.Account.isCreditisInGroup()
isInGroup(group): boolean;Tell if this account is in the [[Group]]
Parameters
| Parameter | Type |
|---|---|
group | string | Group |
Returns
boolean
Inherited from
Bkper.Account.isInGroupisPermanent()
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.
Returns
boolean
True if its a permanent Account
Inherited from
Bkper.Account.isPermanentjson()
json(): Account;Gets an immutable copy of the JSON payload for this resource.
Returns
Account
An immutable copy of the json payload
Inherited from
Bkper.Account.jsonremove()
remove(): Account;Perform delete account.
Returns
Account
Inherited from
Bkper.Account.removeremoveGroup()
removeGroup(group): Account;Remove a group from the Account.
Parameters
| Parameter | Type |
|---|---|
group | string | Group |
Returns
Account
Inherited from
Bkper.Account.removeGroupsetArchived()
setArchived(archived): Account;Set account archived/unarchived.
Parameters
| Parameter | Type |
|---|---|
archived | boolean |
Returns
Account
This Account, for chainning.
Inherited from
Bkper.Account.setArchivedsetGroups()
setGroups(groups): Account;Sets the groups of the Account.
Parameters
| Parameter | Type |
|---|---|
groups | Group[] | string[] |
Returns
Account
This Account, for chainning.
Inherited from
Bkper.Account.setGroupssetName()
setName(name): Account;Sets the name of the Account.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Account
This Account, for chainning.
Inherited from
Bkper.Account.setNamesetProperties()
setProperties(properties): this;Sets the custom properties of this resource.
Parameters
| Parameter | Type |
|---|---|
properties | { [key: string]: string; } |
Returns
this
This resource, for chaining
Inherited from
Bkper.Account.setPropertiessetProperty()
setProperty(key, value): this;Sets a custom property in this resource.
Parameters
| Parameter | Type |
|---|---|
key | string |
value | string |
Returns
this
This resource, for chaining
Inherited from
Bkper.Account.setPropertysetType()
setType(type): Account;Sets the type of the Account.
Parameters
| Parameter | Type |
|---|---|
type | AccountType |
Returns
Account
This Account, for chainning
Inherited from
Bkper.Account.setTypesetVisibleProperties()
setVisibleProperties(properties): this;Sets the custom properties of this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.
Parameters
| Parameter | Type |
|---|---|
properties | { [key: string]: string; } |
Returns
this
This resource, for chaining
Inherited from
Bkper.Account.setVisiblePropertiessetVisibleProperty()
setVisibleProperty(key, value): this;Sets a custom property in this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.
Parameters
| Parameter | Type |
|---|---|
key | string |
value | string | null |
Returns
this
This resource, for chaining
Inherited from
Bkper.Account.setVisiblePropertyupdate()
update(): Account;Perform update account, applying pending changes.
Returns
Account
Inherited from
Bkper.Account.update