Skip to content

Account

Extends

  • Account

Properties

payload

payload: Account;

The underlying payload data for this resource

Inherited from

Bkper.Account.payload

Methods

addGroup()

addGroup(group): Account;

Add a group to the Account.

Parameters

ParameterType
groupstring | Group

Returns

Account

This Account, for chainning.

Inherited from

Bkper.Account.addGroup

create()

create(): Account;

Perform create new account.

Returns

Account

The created Account, for chainning.

Inherited from

Bkper.Account.create

deleteProperty()

deleteProperty(key): this;

Deletes a custom property.

Parameters

ParameterType
keystring

Returns

this

This resource, for chaining

Inherited from

Bkper.Account.deleteProperty

getBalance()

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.getBalance

getBalanceRaw()

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.getBalanceRaw

getDescription()

getDescription(): string;

Gets the account description

Returns

string

Inherited from

Bkper.Account.getDescription

getGroups()

getGroups(): Group[];

Get the [[Groups]] of this account.

Returns

Group[]

Inherited from

Bkper.Account.getGroups

getId()

getId(): string;

Gets the account internal id.

Returns

string

Inherited from

Bkper.Account.getId

getName()

getName(): string;

Gets the account name.

Returns

string

Inherited from

Bkper.Account.getName

getNormalizedName()

getNormalizedName(): string;

Returns

string

The name of this account without spaces or special characters.

Inherited from

Bkper.Account.getNormalizedName

getProperties()

getProperties(): object;

Gets the custom properties stored in this resource.

Returns

object

Object with key/value pair properties

Inherited from

Bkper.Account.getProperties

getProperty()

getProperty(...keys): string;

Gets the property value for given keys. First property found will be retrieved.

Parameters

ParameterType
keysstring[]

Returns

string

The property value or null if not found

Inherited from

Bkper.Account.getProperty

getPropertyKeys()

getPropertyKeys(): string[];

Gets the custom properties keys stored in this resource.

Returns

string[]

Array of property keys sorted alphabetically

Inherited from

Bkper.Account.getPropertyKeys

getType()

getType(): AccountType;

Returns

AccountType

The type for of this account.

Inherited from

Bkper.Account.getType

getVisibleProperties()

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.getVisibleProperties

hasTransactionPosted()

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.hasTransactionPosted

isActive()

isActive(): boolean;

Tell if this account is Active or otherwise Archived.

Returns

boolean

Inherited from

Bkper.Account.isActive

isArchived()

isArchived(): boolean;

Tell if this account is archived.

Returns

boolean

Inherited from

Bkper.Account.isArchived

isCredit()

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 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

boolean

Inherited from

Bkper.Account.isCredit

isInGroup()

isInGroup(group): boolean;

Tell if this account is in the [[Group]]

Parameters

ParameterType
groupstring | Group

Returns

boolean

Inherited from

Bkper.Account.isInGroup

isPermanent()

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.isPermanent

json()

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.json

remove()

remove(): Account;

Perform delete account.

Returns

Account

Inherited from

Bkper.Account.remove

removeGroup()

removeGroup(group): Account;

Remove a group from the Account.

Parameters

ParameterType
groupstring | Group

Returns

Account

Inherited from

Bkper.Account.removeGroup

setArchived()

setArchived(archived): Account;

Set account archived/unarchived.

Parameters

ParameterType
archivedboolean

Returns

Account

This Account, for chainning.

Inherited from

Bkper.Account.setArchived

setGroups()

setGroups(groups): Account;

Sets the groups of the Account.

Parameters

ParameterType
groupsGroup[] | string[]

Returns

Account

This Account, for chainning.

Inherited from

Bkper.Account.setGroups

setName()

setName(name): Account;

Sets the name of the Account.

Parameters

ParameterType
namestring

Returns

Account

This Account, for chainning.

Inherited from

Bkper.Account.setName

setProperties()

setProperties(properties): this;

Sets the custom properties of this resource.

Parameters

ParameterType
properties{ [key: string]: string; }

Returns

this

This resource, for chaining

Inherited from

Bkper.Account.setProperties

setProperty()

setProperty(key, value): this;

Sets a custom property in this resource.

Parameters

ParameterType
keystring
valuestring

Returns

this

This resource, for chaining

Inherited from

Bkper.Account.setProperty

setType()

setType(type): Account;

Sets the type of the Account.

Parameters

ParameterType
typeAccountType

Returns

Account

This Account, for chainning

Inherited from

Bkper.Account.setType

setVisibleProperties()

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

ParameterType
properties{ [key: string]: string; }

Returns

this

This resource, for chaining

Inherited from

Bkper.Account.setVisibleProperties

setVisibleProperty()

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

ParameterType
keystring
valuestring | null

Returns

this

This resource, for chaining

Inherited from

Bkper.Account.setVisibleProperty

update()

update(): Account;

Perform update account, applying pending changes.

Returns

Account

Inherited from

Bkper.Account.update