Book
Extends
Book
Properties
payload
payload: Book;The underlying payload data for this resource
Inherited from
Bkper.Book.payloadMethods
addCollaborator()
addCollaborator(email, permission): void;Adds a collaborator to the Book.
Parameters
| Parameter | Type |
|---|---|
email | string |
permission | Permission |
Returns
void
Inherited from
Bkper.Book.addCollaboratoraudit()
audit(): void;Trigger Balances Audit async process.
Returns
void
Inherited from
Bkper.Book.auditbatchCheckTransactions()
batchCheckTransactions(transactions): void;Batch check [[Transactions]] on the Book.
Parameters
| Parameter | Type |
|---|---|
transactions | Transaction[] |
Returns
void
Inherited from
Bkper.Book.batchCheckTransactionsbatchCreateAccounts()
batchCreateAccounts(accounts): Account[];Create [[Accounts]] on the Book, in batch.
Parameters
| Parameter | Type |
|---|---|
accounts | Account[] |
Returns
Account[]
The Accounts created
Inherited from
Bkper.Book.batchCreateAccountsbatchCreateGroups()
batchCreateGroups(groups): Group[];Create [[Groups]] on the Book, in batch.
Parameters
| Parameter | Type |
|---|---|
groups | Group[] |
Returns
Group[]
The Groups created
Inherited from
Bkper.Book.batchCreateGroupsbatchCreateTransactions()
batchCreateTransactions(transactions): Transaction[];Batch create [[Transactions]] on the Book.
Parameters
| Parameter | Type |
|---|---|
transactions | Transaction[] |
Returns
Transaction[]
The Transactions created
Inherited from
Bkper.Book.batchCreateTransactionsbatchTrashTransactions()
batchTrashTransactions(transactions, trashChecked?): void;Batch trash [[Transactions]] on the Book.
Parameters
| Parameter | Type |
|---|---|
transactions | Transaction[] |
trashChecked? | boolean |
Returns
void
Inherited from
Bkper.Book.batchTrashTransactionsbatchUncheckTransactions()
batchUncheckTransactions(transactions): void;Batch uncheck [[Transactions]] on the Book.
Parameters
| Parameter | Type |
|---|---|
transactions | Transaction[] |
Returns
void
Inherited from
Bkper.Book.batchUncheckTransactionsbatchUpdateTransactions()
batchUpdateTransactions(transactions, updateChecked?): void;Batch update [[Transactions]] on the Book.
Parameters
| Parameter | Type |
|---|---|
transactions | Transaction[] |
updateChecked? | boolean |
Returns
void
Inherited from
Bkper.Book.batchUpdateTransactionscontinueTransactionIterator()
continueTransactionIterator(query, continuationToken): TransactionIterator;Resumes a transaction iteration using a continuation token from a previous iterator.
Parameters
| Parameter | Type |
|---|---|
query | string |
continuationToken | string |
Returns
TransactionIterator
a collection of transactions that remained in a previous iterator when the continuation token was generated
Inherited from
Bkper.Book.continueTransactionIteratorcountTransactions()
countTransactions(query?): number;Retrieve the number of transactions based on a query.
Parameters
| Parameter | Type |
|---|---|
query? | string |
Returns
number
The number of matching Transactions
Inherited from
Bkper.Book.countTransactionscreateAccount()
createAccount( name, group?, description?): Account;Create an [[Account]] in this book.
The type of account will be determined by the type of others Accounts in same group.
If not specified, the type ASSET (permanent=true/credit=false) will be set.
If all other accounts in same group is in another group, the account will also be added to the other group.
Parameters
| Parameter | Type |
|---|---|
name | string |
group? | string |
description? | string |
Returns
Account
The created Account object
Inherited from
Bkper.Book.createAccountcreateAccounts()
createAccounts(accounts): Account[];Create [[Accounts]] on the Book, in batch.
The first column of the matrix will be used as the [[Account]] name.
The other columns will be used to find a matching [[AccountType]].
Names matching existent accounts will be skipped.
Parameters
| Parameter | Type |
|---|---|
accounts | string[][] |
Returns
Account[]
Inherited from
Bkper.Book.createAccountscreateAccountsDataTable()
createAccountsDataTable(group?): AccountsDataTableBuilder;Create a [[AccountsDataTableBuilder]], to build two dimensional Array representations of [[Accounts]] dataset.
Parameters
| Parameter | Type |
|---|---|
group? | string |
Returns
AccountsDataTableBuilder
Accounts data table builder.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgPXjx7oKDA");
var accountsDataTable = book.createAccountsDataTable().build();
// Or filter by groupvar filteredDataTable = book.createAccountsDataTable("Revenue").build();Inherited from
Bkper.Book.createAccountsDataTablecreateBalancesDataTable()
createBalancesDataTable(query): BalancesDataTableBuilder;Create a [[BalancesDataTableBuilder]] based on a query, to create two dimensional Array representation of balances of [[Account]] or [[Group]]
See Query Guide to learn more
Parameters
| Parameter | Type |
|---|---|
query | string |
Returns
BalancesDataTableBuilder
The balances data table builder
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgPXjx7oKDA");
var balancesDataTable = book.createBalancesDataTable("account:'Credit card' after:7/2018 before:8/2018").build();Inherited from
Bkper.Book.createBalancesDataTablecreateGroups()
createGroups(groups): Group[];Create [[Groups]] on the Book, in batch.
Parameters
| Parameter | Type |
|---|---|
groups | string[] |
Returns
Group[]
Inherited from
Bkper.Book.createGroupscreateGroupsDataTable()
createGroupsDataTable(): GroupsDataTableBuilder;Create a [[GroupsDataTableBuilder]], to build two dimensional Array representations of [[Groups]] dataset.
Returns
GroupsDataTableBuilder
Groups data table builder.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgPXjx7oKDA");
var groupsDataTable = book.createGroupsDataTable().build();Inherited from
Bkper.Book.createGroupsDataTablecreateTransactionsDataTable()
createTransactionsDataTable(query?): TransactionsDataTableBuilder;Create a [[TransactionsDataTableBuilder]] based on a query, to build two dimensional Array representations of [[Transactions]] dataset.
See Query Guide to learn more
Parameters
| Parameter | Type |
|---|---|
query? | string |
Returns
TransactionsDataTableBuilder
Transactions data table builder.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgPXjx7oKDA");
var transactionsDataTable = book.createTransactionsDataTable("account:'Bank Account' before:1/2019").build();Inherited from
Bkper.Book.createTransactionsDataTabledeleteProperty()
deleteProperty(key): this;Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
this
Inherited from
Bkper.Book.deletePropertyformatAmount()
formatAmount(amount): string;Formats an amount according to [[DecimalSeparator]] and fraction digits of the Book.
Parameters
| Parameter | Type |
|---|---|
amount | Amount |
Returns
string
The value formated
Inherited from
Bkper.Book.formatAmountformatDate()
formatDate(date, timeZone?): string;Formats a date according to date pattern of the Book.
Parameters
| Parameter | Type |
|---|---|
date | Date |
timeZone? | string |
Returns
string
The date formated
Inherited from
Bkper.Book.formatDateformatValue()
formatValue(value): string;Formats a value according to [[DecimalSeparator]] and fraction digits of the Book.
Parameters
| Parameter | Type |
|---|---|
value | Amount |
Returns
string
The value formated
Inherited from
Bkper.Book.formatValuegetAccount()
getAccount(idOrName): Account;Gets an [[Account]] object
Parameters
| Parameter | Type |
|---|---|
idOrName | string |
Returns
Account
The matching Account object
Inherited from
Bkper.Book.getAccountgetAccounts()
getAccounts(group?): Account[];Parameters
| Parameter | Type |
|---|---|
group? | string |
Returns
Account[]
All [[Accounts]] of this Book, or filtered by group if specified
Inherited from
Bkper.Book.getAccountsgetApps()
getApps(): App[];Retrieve installed [[Apps]] for this Book
Returns
App[]
The Apps objects
Inherited from
Bkper.Book.getAppsgetBacklog()
getBacklog(): Backlog;Retrieve the pending events [[Backlog]] for this Book
Returns
Backlog
The Backlog object
Inherited from
Bkper.Book.getBackloggetBalancesReport()
getBalancesReport(query): BalancesReport;Create a [[BalancesReport]] based on query
Parameters
| Parameter | Type |
|---|---|
query | string |
Returns
BalancesReport
The balances report
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgPXjx7oKDA");
var balancesReport = book.getBalancesReport("group:'Equity' after:7/2018 before:8/2018");
var accountBalance = balancesReport.getBalancesContainer("Bank Account").getCumulativeBalance();Inherited from
Bkper.Book.getBalancesReportgetClosingDate()
getClosingDate(): string;Returns
string
The closing date of the Book in ISO format yyyy-MM-dd
Inherited from
Bkper.Book.getClosingDategetCollection()
getCollection(): Collection;Returns
Collection
The collection of this book
Inherited from
Bkper.Book.getCollectiongetDatePattern()
getDatePattern(): string;Returns
string
The date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
Inherited from
Bkper.Book.getDatePatterngetDecimalSeparator()
getDecimalSeparator(): DecimalSeparator;Returns
The decimal separator of the Book
Inherited from
Bkper.Book.getDecimalSeparatorgetEvents()
getEvents( afterDate?, beforeDate?, onError?, resource?): EventIterator;Get Book events based on search parameters.
Parameters
| Parameter | Type |
|---|---|
afterDate? | string |
beforeDate? | string |
onError? | boolean |
resource? | Account | Group | Transaction |
Returns
EventIterator
The Events result as an iterator.
Inherited from
Bkper.Book.getEventsgetFile()
getFile(id): File;Retrieve a [[File]] by id
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
File
The matching File object
Inherited from
Bkper.Book.getFilegetFractionDigits()
getFractionDigits(): number;Returns
number
The number of fraction digits (decimal places) supported by this Book
Inherited from
Bkper.Book.getFractionDigitsgetGroup()
getGroup(idOrName): Group;Gets a [[Group]] object
Parameters
| Parameter | Type |
|---|---|
idOrName | string |
Returns
Group
The matching Group object
Inherited from
Bkper.Book.getGroupgetGroups()
getGroups(): Group[];Returns
Group[]
All [[Groups]] of this Book
Inherited from
Bkper.Book.getGroupsgetId()
getId(): string;Same as bookId param
Returns
string
The id of this Book
Inherited from
Bkper.Book.getIdgetLastUpdateMs()
getLastUpdateMs(): number;Returns
number
The last update date of the book, in in milliseconds
Inherited from
Bkper.Book.getLastUpdateMsgetLockDate()
getLockDate(): string;Returns
string
The lock date of the Book in ISO format yyyy-MM-dd
Inherited from
Bkper.Book.getLockDategetName()
getName(): string;Returns
string
The name of this Book
Inherited from
Bkper.Book.getNamegetOwnerName()
getOwnerName(): string;Returns
string
The name of the owner of the Book
Inherited from
Bkper.Book.getOwnerNamegetPeriodStartMonth()
getPeriodStartMonth(): Month;Returns
The start month when YEAR period set
Inherited from
Bkper.Book.getPeriodStartMonthgetPermission()
getPermission(): Permission;Returns
The permission for the current user
Inherited from
Bkper.Book.getPermissiongetProperties()
getProperties(): object;Returns
object
Inherited from
Bkper.Book.getPropertiesgetProperty()
getProperty(...keys): string;Parameters
| Parameter | Type |
|---|---|
…keys | string[] |
Returns
string
Inherited from
Bkper.Book.getPropertygetPropertyKeys()
getPropertyKeys(): string[];Returns
string[]
Inherited from
Bkper.Book.getPropertyKeysgetSavedQueries()
getSavedQueries(): object[];Returns
object[]
All saved queries from this book
Inherited from
Bkper.Book.getSavedQueriesgetTimeZone()
getTimeZone(): string;Returns
string
The time zone of the Book
Inherited from
Bkper.Book.getTimeZonegetTimeZoneOffset()
getTimeZoneOffset(): number;Returns
number
The time zone offset of the book, in minutes
Inherited from
Bkper.Book.getTimeZoneOffsetgetTotalTransactions()
getTotalTransactions(): number;Returns
number
The total number of posted transactions
Inherited from
Bkper.Book.getTotalTransactionsgetTotalTransactionsCurrentMonth()
getTotalTransactionsCurrentMonth(): number;Returns
number
The total number of posted transactions on current month
Inherited from
Bkper.Book.getTotalTransactionsCurrentMonthgetTotalTransactionsCurrentYear()
getTotalTransactionsCurrentYear(): number;Returns
number
The total number of posted transactions on current year
Inherited from
Bkper.Book.getTotalTransactionsCurrentYeargetTransaction()
getTransaction(id): Transaction;Retrieve a [[Transaction]] by id
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Transaction
The matching Transaction object
Inherited from
Bkper.Book.getTransactiongetTransactions()
getTransactions(query?): TransactionIterator;Get Book transactions based on a query.
See Query Guide to learn more
Parameters
| Parameter | Type |
|---|---|
query? | string |
Returns
TransactionIterator
The Transactions result as an iterator.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
var transactions = book.getTransactions("account:CreditCard after:28/01/2013 before:29/01/2013");
while (transactions.hasNext()) { var transaction = transactions.next(); Logger.log(transaction.getDescription());}Inherited from
Bkper.Book.getTransactionsgetVisibleProperties()
getVisibleProperties(): object;Returns
object
Inherited from
Bkper.Book.getVisiblePropertiesjson()
json(): Book;Gets an immutable copy of the JSON payload for this resource.
Returns
Book
An immutable copy of the json payload
Inherited from
Bkper.Book.jsonnewAccount()
newAccount(): Account;Instantiate a new [[Account]]
Returns
Account
The new Account, for chainning.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
book.newAccount() .setName('Some New Account') .setType('INCOMING') .addGroup('Revenue').addGroup('Salary') .setProperties({prop_a: 'A', prop_b: 'B'}) .create();Inherited from
Bkper.Book.newAccountnewFile()
newFile(): File;Instantiate a new [[File]]
Returns
File
The new File, for chainning.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
book.newFile() .setBlob(UrlFetchApp.fetch('https://bkper.com/images/index/integrations4.png').getBlob()) .create();Inherited from
Bkper.Book.newFilenewGroup()
newGroup(): Group;Instantiate a new [[Group]]
Returns
Group
The new Group, for chainning.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
book.newGroup() .setName('Some New Group') .setProperty('key', 'value') .create();Inherited from
Bkper.Book.newGroupnewTransaction()
newTransaction(): Transaction;Instantiate a new [[Transaction]]
Returns
Transaction
The new Transaction, for chainning.
Example:
var book = BkperApp.getBook("agtzfmJrcGVyLWhyZHITCxIGTGVkZ2VyGICAgIDggqALDA");
book.newTransaction() .setDate('2013-01-25') .setDescription("Filling tank of my truck") .from('Credit Card') .to('Gas') .setAmount(126.50) .create();Inherited from
Bkper.Book.newTransactionparseAmount()
parseAmount(value): Amount;Parse an amount string according to [[DecimalSeparator]] and fraction digits of the Book.
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
Amount
The Amount parsed
Inherited from
Bkper.Book.parseAmountparseDate()
parseDate(date): Date;Parse a date string according to date pattern and timezone of the Book.
Also parse ISO yyyy-mm-dd format.
Parameters
| Parameter | Type |
|---|---|
date | string |
Returns
Date
The date parsed
Inherited from
Bkper.Book.parseDateparseValue()
parseValue(value): Amount;Parse a value string according to [[DecimalSeparator]] and fraction digits of the Book.
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
Amount
Inherited from
Bkper.Book.parseValuerecord()
record(transactions, timeZone?): void;Record [[Transactions]] on the Book.
The text is usually amount and description, but it can also can contain an informed Date in full format (dd/mm/yyyy - mm/dd/yyyy).
Example:
book.record("#gas 63.23");Parameters
| Parameter | Type |
|---|---|
transactions | string | any[] | any[][] |
timeZone? | string |
Returns
void
Inherited from
Bkper.Book.recordremoveCollaborator()
removeCollaborator(email): void;Removes a collaborator from the Book.
Parameters
| Parameter | Type |
|---|---|
email | string |
Returns
void
Inherited from
Bkper.Book.removeCollaboratorround()
round(amount): Amount;Rounds an amount according to the number of fraction digits of the Book
Parameters
| Parameter | Type |
|---|---|
amount | Amount |
Returns
Amount
The Amount rounded
Inherited from
Bkper.Book.roundsetClosingDate()
setClosingDate(closingDate): Book;Sets the closing date of the Book in ISO format yyyy-MM-dd.
Parameters
| Parameter | Type |
|---|---|
closingDate | string | null |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setClosingDatesetDatePattern()
setDatePattern(datePattern): Book;Sets the date pattern of the Book. Current: dd/MM/yyyy | MM/dd/yyyy | yyyy/MM/dd
Parameters
| Parameter | Type |
|---|---|
datePattern | string |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setDatePatternsetDecimalSeparator()
setDecimalSeparator(decimalSeparator): Book;Sets the decimal separator of the Book
Parameters
| Parameter | Type |
|---|---|
decimalSeparator | DecimalSeparator |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setDecimalSeparatorsetFractionDigits()
setFractionDigits(fractionDigits): Book;Sets the number of fraction digits (decimal places) supported by this Book
Parameters
| Parameter | Type |
|---|---|
fractionDigits | number |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setFractionDigitssetLockDate()
setLockDate(lockDate): Book;Sets the lock date of the Book in ISO format yyyy-MM-dd.
Parameters
| Parameter | Type |
|---|---|
lockDate | string | null |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setLockDatesetName()
setName(name): Book;Sets the name of the Book.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setNamesetPeriodStartMonth()
setPeriodStartMonth(month): Book;Sets the start month when YEAR period set
Parameters
| Parameter | Type |
|---|---|
month | Month |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setPeriodStartMonthsetProperties()
setProperties(properties): this;Parameters
| Parameter | Type |
|---|---|
properties | { [key: string]: string; } |
Returns
this
Inherited from
Bkper.Book.setPropertiessetProperty()
setProperty(key, value): this;Parameters
| Parameter | Type |
|---|---|
key | string |
value | string |
Returns
this
Inherited from
Bkper.Book.setPropertysetTimeZone()
setTimeZone(timeZone): Book;Sets the time zone of the Book
Parameters
| Parameter | Type |
|---|---|
timeZone | string |
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.setTimeZonesetVisibleProperties()
setVisibleProperties(properties): this;Parameters
| Parameter | Type |
|---|---|
properties | { [key: string]: string; } |
Returns
this
Inherited from
Bkper.Book.setVisiblePropertiessetVisibleProperty()
setVisibleProperty(key, value): this;Parameters
| Parameter | Type |
|---|---|
key | string |
value | string | null |
Returns
this
Inherited from
Bkper.Book.setVisiblePropertyupdate()
update(): Book;Perform update Book, applying pending changes.
Returns
Book
This Book, for chainning.
Inherited from
Bkper.Book.update