Skip to content

BalancesDataTableBuilder

A BalancesDataTableBuilder is used to setup and build two-dimensional arrays containing balance information.

Implements

  • BalancesDataTableBuilder

Constructors

Constructor

new BalancesDataTableBuilder(
book,
balancesContainers,
periodicity): BalancesDataTableBuilder;

Parameters

ParameterType
bookBook
balancesContainersBalancesContainer[]
periodicityPeriodicity

Returns

BalancesDataTableBuilder

Methods

build()

build(): any[][];

Builds an two-dimensional array with the balances.

Returns

any[][]

Implementation of

BalancesDataTableBuilder.build

expanded()

expanded(expanded): BalancesDataTableBuilder;

Defines whether Groups should expand its child accounts.

true to expand itself -1 to expand all subgroups -2 to expand all accounts 0 to expand nothing 1 to expand itself and its first level of children 2 to expand itself and its first two levels of children etc.

Parameters

ParameterType
expandednumber | boolean

Returns

BalancesDataTableBuilder

This builder with respective expanded option, for chaining.

Implementation of

BalancesDataTableBuilder.expanded

formatDates()

formatDates(format): BalancesDataTableBuilder;

Defines whether the dates should be ISO formatted YYYY-MM-DD. E.g. 2025-01-01

Parameters

ParameterType
formatboolean

Returns

BalancesDataTableBuilder

This builder with respective formatting option, for chaining.

Implementation of

BalancesDataTableBuilder.formatDates

formatValues()

formatValues(format): BalancesDataTableBuilder;

Defines whether the value should be formatted based on decimal separator of the [[Book]].

Parameters

ParameterType
formatboolean

Returns

BalancesDataTableBuilder

This builder with respective formatting option, for chaining.

Implementation of

BalancesDataTableBuilder.formatValues

hiddenProperties()

hiddenProperties(include): BalancesDataTableBuilder;

Defines whether to include hidden properties (keys ending with underscore ”_”). Only relevant when properties is enabled. Default is false — hidden properties are excluded.

Parameters

ParameterTypeDescription
includebooleanWhether to include hidden properties

Returns

BalancesDataTableBuilder

This builder with respective option, for chaining.

Implementation of

BalancesDataTableBuilder.hiddenProperties

hideDates()

hideDates(hide): BalancesDataTableBuilder;

Defines whether the dates should be hidden for PERIOD or CUMULATIVE [[BalanceType]].

Parameters

ParameterType
hideboolean

Returns

BalancesDataTableBuilder

This builder with respective hide dates option, for chaining.

Implementation of

BalancesDataTableBuilder.hideDates

hideNames()

hideNames(hide): BalancesDataTableBuilder;

Defines whether the [[Accounts]] and [[Groups]] names should be hidden.

Parameters

ParameterType
hideboolean

Returns

BalancesDataTableBuilder

This builder with respective hide names option, for chaining.

Implementation of

BalancesDataTableBuilder.hideNames

period()

period(period): BalancesDataTableBuilder;

Defines whether should force use of period balances for TOTAL [[BalanceType]].

Parameters

ParameterType
periodboolean

Returns

BalancesDataTableBuilder

This builder with respective trial option, for chaining.

Implementation of

BalancesDataTableBuilder.period

properties()

properties(include): BalancesDataTableBuilder;

Defines whether include custom [[Accounts]] and [[Groups]] properties.

Parameters

ParameterType
includeboolean

Returns

BalancesDataTableBuilder

This builder with respective include properties option, for chaining.

Implementation of

BalancesDataTableBuilder.properties

raw()

raw(raw): BalancesDataTableBuilder;

Defines whether should show raw balances, no matter the credit nature of the Account or Group.

Parameters

ParameterType
rawboolean

Returns

BalancesDataTableBuilder

This builder with respective trial option, for chaining.

Implementation of

BalancesDataTableBuilder.raw

transposed()

transposed(transposed): BalancesDataTableBuilder;

Defines whether should rows and columns should be transposed.

For TOTAL [[BalanceType]], the transposed table looks like:

_____________________________
| Expenses | Income | ... |
| -4568.23 | 5678.93 | ... |
|___________|_________|_______|

Two rows, and each [[Account]] or [[Group]] per column.

For PERIOD or CUMULATIVE [[BalanceType]], the transposed table will be a time table, and the format looks like:

_______________________________________________________________
| | Expenses | Income | ... | ... |
| 15/01/2014 | -2345.23 | 3452.93 | ... | ... |
| 15/02/2014 | -2345.93 | 3456.46 | ... | ... |
| 15/03/2014 | -2456.45 | 3567.87 | ... | ... |
| ... | ... | ... | ... | ... |
|____________|____________|____________|____________|___________|

First column will be each Date, and one column for each [[Account]] or [[Group]].

Parameters

ParameterType
transposedboolean

Returns

BalancesDataTableBuilder

This builder with respective transposed option, for chaining.

Implementation of

BalancesDataTableBuilder.transposed

trial()

trial(trial): BalancesDataTableBuilder;

Defines whether should split TOTAL [[BalanceType]] into debit and credit.

Parameters

ParameterType
trialboolean

Returns

BalancesDataTableBuilder

This builder with respective trial option, for chaining.

Implementation of

BalancesDataTableBuilder.trial

type()

type(type): BalancesDataTableBuilder;

Fluent method to set the [[BalanceType]] for the builder.

Parameters

ParameterTypeDescription
typeBalanceTypeThe type of balance for this data table For TOTAL [[BalanceType]], the table format looks like: `_____________________

Returns

BalancesDataTableBuilder

This builder with respective balance type, for chaining.

Implementation of

BalancesDataTableBuilder.type