Transaction
Extends
Transaction
Properties
payload
payload: Transaction;The underlying payload data for this resource
Inherited from
Bkper.Transaction.payloadMethods
addFile()
addFile(file): Transaction;Add a File attachment to the Transaction.
Files not previously created in the Book will be automatically created when the Transaction is persisted.
Parameters
| Parameter | Type |
|---|---|
file | File | Blob |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.addFileaddRemoteId()
addRemoteId(remoteId): Transaction;Add a remote id to the Transaction.
Parameters
| Parameter | Type |
|---|---|
remoteId | string |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.addRemoteIdaddUrl()
addUrl(url): Transaction;Add a url to the Transaction. Url starts with https://
Parameters
| Parameter | Type |
|---|---|
url | string |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.addUrlcheck()
check(): Transaction;Perform check transaction.
Returns
Transaction
Inherited from
Bkper.Transaction.checkcreate()
create(): Transaction;Perform create new draft transaction.
Returns
Transaction
Inherited from
Bkper.Transaction.createdeleteProperty()
deleteProperty(key): this;Deletes a custom property.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
this
This resource, for chaining
Inherited from
Bkper.Transaction.deletePropertyfrom()
from(account): Transaction;Set the credit/origin Account of the Transaction. Same as setCreditAccount().
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.fromgetAccountBalance()
getAccountBalance(raw?): Amount;Gets the balance that the [[Account]] has at that day, when listing transactions of that Account.
Evolved balances is returned when searching for transactions of a permanent [[Account]].
Only comes with the last posted transaction of the day.
Parameters
| Parameter | Type |
|---|---|
raw? | boolean |
Returns
Amount
Inherited from
Bkper.Transaction.getAccountBalancegetAgentId()
getAgentId(): string;Returns
string
The id of the agent that created this transaction
Inherited from
Bkper.Transaction.getAgentIdgetAmount()
getAmount(): Amount;Returns
Amount
The amount of the transaction.
Inherited from
Bkper.Transaction.getAmountgetCreatedAt()
getCreatedAt(): Date;Returns
Date
The date the transaction was created.
Inherited from
Bkper.Transaction.getCreatedAtgetCreatedAtFormatted()
getCreatedAtFormatted(): string;Returns
string
The date the transaction was created, formatted according to the date pattern of [[Book]].
Inherited from
Bkper.Transaction.getCreatedAtFormattedgetCreditAccount()
getCreditAccount(): Account;Returns
Account
The credit account. The same as origin account.
Inherited from
Bkper.Transaction.getCreditAccountgetCreditAccountName()
getCreditAccountName(): string;Returns
string
The credit account name.
Inherited from
Bkper.Transaction.getCreditAccountNamegetCreditAmount()
getCreditAmount(account): Amount;Get the absolute amount of this transaction if the given account is at the credit side, else null.
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Amount
Inherited from
Bkper.Transaction.getCreditAmountgetDate()
getDate(): string;Returns
string
The Transaction date, in ISO format yyyy-MM-dd.
Inherited from
Bkper.Transaction.getDategetDateFormatted()
getDateFormatted(): string;Returns
string
The Transaction date, formatted on the date pattern of the [[Book]].
Inherited from
Bkper.Transaction.getDateFormattedgetDateObject()
getDateObject(): Date;Returns
Date
The Transaction Date object, on the time zone of the [[Book]].
Inherited from
Bkper.Transaction.getDateObjectgetDateValue()
getDateValue(): number;Returns
number
The Transaction date number, in format YYYYMMDD.
Inherited from
Bkper.Transaction.getDateValuegetDebitAccount()
getDebitAccount(): Account;Returns
Account
The debit account. The same as destination account.
Inherited from
Bkper.Transaction.getDebitAccountgetDebitAccountName()
getDebitAccountName(): string;Returns
string
The debit account name.
Inherited from
Bkper.Transaction.getDebitAccountNamegetDebitAmount()
getDebitAmount(account): Amount;Gets the absolute amount of this transaction if the given account is at the debit side, else null.
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Amount
Inherited from
Bkper.Transaction.getDebitAmountgetDescription()
getDescription(): string;Returns
string
The description of this transaction.
Inherited from
Bkper.Transaction.getDescriptiongetFiles()
getFiles(): File[];Returns
File[]
The files attached to the transaction.
Inherited from
Bkper.Transaction.getFilesgetId()
getId(): string;Returns
string
The id of the Transaction.
Inherited from
Bkper.Transaction.getIdgetInformedDate()
getInformedDate(): Date;Returns
Date
The date the user informed for this transaction, adjusted to book’s time zone.
Inherited from
Bkper.Transaction.getInformedDategetInformedDateText()
getInformedDateText(): string;Returns
string
The date the user informed for this transaction, formatted according to the date pattern of [[Book]].
Inherited from
Bkper.Transaction.getInformedDateTextgetInformedDateValue()
getInformedDateValue(): number;Returns
number
The date numbe. The number format is YYYYMMDD.
Inherited from
Bkper.Transaction.getInformedDateValuegetOtherAccount()
getOtherAccount(account): Account;Gets the [[Account]] at the other side of the transaction given the one in one side.
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Account
Inherited from
Bkper.Transaction.getOtherAccountgetOtherAccountName()
getOtherAccountName(account): string;The account name at the other side of the transaction given the one in one side.
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
string
Inherited from
Bkper.Transaction.getOtherAccountNamegetPostDate()
getPostDate(): Date;Returns
Date
The date time user has recorded/posted this transaction.
Inherited from
Bkper.Transaction.getPostDategetPostDateText()
getPostDateText(): string;Returns
string
The date time user has recorded/posted this transaction, formatted according to the date pattern of [[Book]].
Inherited from
Bkper.Transaction.getPostDateTextgetProperties()
getProperties(): object;Gets the custom properties stored in this resource.
Returns
object
Object with key/value pair properties
Inherited from
Bkper.Transaction.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.Transaction.getPropertygetPropertyKeys()
getPropertyKeys(): string[];Gets the custom properties keys stored in this resource.
Returns
string[]
Array of property keys sorted alphabetically
Inherited from
Bkper.Transaction.getPropertyKeysgetRemoteIds()
getRemoteIds(): string[];Remote ids are used to avoid duplication.
Returns
string[]
The remote ids of the Transaction.
Inherited from
Bkper.Transaction.getRemoteIdsgetStatus()
getStatus(): TransactionStatus;Gets the status of the transaction.
The status is determined by precedence: TRASHED > DRAFT > CHECKED/UNCHECKED
Returns
The transaction status.
Inherited from
Bkper.Transaction.getStatusgetTags()
getTags(): string[];Returns
string[]
All #hashtags used on the transaction.
Inherited from
Bkper.Transaction.getTagsgetUrls()
getUrls(): string[];Returns
string[]
All urls of the transaction.
Inherited from
Bkper.Transaction.getUrlsgetVisibleProperties()
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.Transaction.getVisiblePropertieshasTag()
hasTag(tag): boolean;Check if the transaction has the specified tag.
Parameters
| Parameter | Type |
|---|---|
tag | string |
Returns
boolean
Inherited from
Bkper.Transaction.hasTagisChecked()
isChecked(): boolean;Returns
boolean
True if transaction is checked.
Inherited from
Bkper.Transaction.isCheckedisCredit()
isCredit(account): boolean;Tell if the given account is credit on the transaction
Parameters
| Parameter | Type |
|---|---|
account | Account |
Returns
boolean
Inherited from
Bkper.Transaction.isCreditisDebit()
isDebit(account): boolean;Tell if the given account is debit on the transaction
Parameters
| Parameter | Type |
|---|---|
account | Account |
Returns
boolean
Inherited from
Bkper.Transaction.isDebitisLocked()
isLocked(): boolean;Returns
boolean
True if a transaction is locked by the book lock/closing date
Inherited from
Bkper.Transaction.isLockedisPosted()
isPosted(): boolean;Returns
boolean
True if transaction was already posted to the accounts. False if is still a Draft.
Inherited from
Bkper.Transaction.isPostedisTrashed()
isTrashed(): boolean;Returns
boolean
True if transaction is in trash.
Inherited from
Bkper.Transaction.isTrashedjson()
json(): Transaction;Gets an immutable copy of the JSON payload for this resource.
Returns
Transaction
An immutable copy of the json payload
Inherited from
Bkper.Transaction.jsonpost()
post(): Transaction;Perform post transaction, changing credit and debit [[Account]] balances.
Returns
Transaction
Inherited from
Bkper.Transaction.postremove()
remove(): Transaction;Remove the transaction, sending to trash.
Returns
Transaction
Inherited from
Bkper.Transaction.removerestore()
restore(): Transaction;Restore the transaction from trash.
Returns
Transaction
Inherited from
Bkper.Transaction.restoresetAmount()
setAmount(amount): Transaction;Set the amount of the Transaction.
Parameters
| Parameter | Type |
|---|---|
amount | string | number | Amount |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setAmountsetChecked()
setChecked(checked): Transaction;Set the check state of the Transaction.
Parameters
| Parameter | Type |
|---|---|
checked | boolean |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setCheckedsetCreditAccount()
setCreditAccount(account): Transaction;Set the credit/origin Account of the Transaction. Same as from().
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setCreditAccountsetDate()
setDate(date): Transaction;Set the date of the Transaction.
Parameters
| Parameter | Type |
|---|---|
date | string | Date |
Returns
Transaction
This Transaction, for chainning
Inherited from
Bkper.Transaction.setDatesetDebitAccount()
setDebitAccount(account): Transaction;Set the debit/destination Account of the Transaction. Same as to().
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setDebitAccountsetDescription()
setDescription(description): Transaction;Set the description of the Transaction.
Parameters
| Parameter | Type |
|---|---|
description | string |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setDescriptionsetProperties()
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.Transaction.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.Transaction.setPropertysetUrls()
setUrls(urls): Transaction;Set the Transaction urls. Url starts with https://
Parameters
| Parameter | Type |
|---|---|
urls | string[] |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.setUrlssetVisibleProperties()
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.Transaction.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.Transaction.setVisiblePropertyto()
to(account): Transaction;Set the debit/destination Account of the Transaction. Same as setDebitAccount().
Parameters
| Parameter | Type |
|---|---|
account | string | Account |
Returns
Transaction
This Transaction, for chainning.
Inherited from
Bkper.Transaction.totrash()
trash(): Transaction;Perform trash transaction.
Returns
Transaction
Inherited from
Bkper.Transaction.trashuncheck()
uncheck(): Transaction;Perform uncheck transaction.
Returns
Transaction
Inherited from
Bkper.Transaction.uncheckuntrash()
untrash(): Transaction;Perform untrash transaction.
Returns
Transaction
Inherited from
Bkper.Transaction.untrashupdate()
update(): Transaction;Upddate transaction, applying pending changes.
Returns
Transaction
Inherited from
Bkper.Transaction.update