book.options
The book's num field source, auto read-only threshold (with today's threshold date), trading accounts option, default budget, business options and default invoice report.
Reads the book's options from GnuCash's File > Properties dialog: whether the Num field of a transaction shows the
split action instead (splitActionForNum), the auto read-only threshold in days (autoReadOnlyDays) with the
readOnlyThreshold date it means today, whether the book uses trading accounts, the default budget, your company's
details from the Business and Tax tabs, which the Printable Invoice prints, and the
Default Invoice Report (defaultInvoiceReport).
Examples
Example: with a copy of the reports/test-data example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"book.options","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"splitActionForNum": false,
"autoReadOnlyDays": 0,
"useTradingAccounts": false,
"defaultBudget": null,
"companyName": "",
"companyAddress": "",
"companyContactPerson": "",
"companyPhoneNumber": "",
"companyFaxNumber": "",
"companyEmailAddress": "",
"companyWebsiteUrl": "",
"companyId": "",
"taxNumber": "",
"defaultInvoiceReport": null
}
}
Command line
red-ale exec --book book.gnucash book.options
It prints:
{
"splitActionForNum": false,
"autoReadOnlyDays": 0,
"useTradingAccounts": false,
"defaultBudget": null,
"companyName": "",
"companyAddress": "",
"companyContactPerson": "",
"companyPhoneNumber": "",
"companyFaxNumber": "",
"companyEmailAddress": "",
"companyWebsiteUrl": "",
"companyId": "",
"taxNumber": "",
"defaultInvoiceReport": null
}
MCP tool call
Tool call:
{"name":"book.options","arguments":{}}
Result:
{
"structuredContent": {
"splitActionForNum": false,
"autoReadOnlyDays": 0,
"useTradingAccounts": false,
"defaultBudget": null,
"companyName": "",
"companyAddress": "",
"companyContactPerson": "",
"companyPhoneNumber": "",
"companyFaxNumber": "",
"companyEmailAddress": "",
"companyWebsiteUrl": "",
"companyId": "",
"taxNumber": "",
"defaultInvoiceReport": null
}
}
Effect: read.
Params
Params for methods that take none.
Type: NoParams.
Result
The book options, as book.options and book.setOptions return them.
splitActionForNum(boolean, required): "Use Split Action Field for Number": a split's Number is its action, and the transaction's num is the T-Num.autoReadOnlyDays(integer (int64), required): "Day Threshold for Read-Only Transactions (red line)": 0 when off.readOnlyThreshold(Date or null): Today minus the threshold's days: transactions posted before it are read-only. Absent when the threshold is off.useTradingAccounts(boolean, required): "Use Trading Accounts": every commit keeps the trading splits of multi-commodity transactions.defaultBudget(Guid or null): "Default Budget": the GUID the option holds, or null when it is unset. A GUID naming no budget is returned as stored;budget.listgives the default in effect.companyName(string, required): The Business tab's "Company Name";""when unset (v0.6).companyAddress(string, required): "Company Address": lines separated by newlines (v0.6).companyContactPerson(string, required): "Company Contact Person" (v0.6).companyPhoneNumber(string, required): "Company Phone Number" (v0.6).companyFaxNumber(string, required): "Company Fax Number" (v0.6).companyEmailAddress(string, required): "Company Email Address" (v0.6).companyWebsiteUrl(string, required): "Company Website URL" (v0.6).companyId(string, required): "Company ID", such as a tax ID (v0.6).taxNumber(string, required): The Tax tab's "Tax Number" (v0.6).defaultInvoiceReport(InvoiceReport or null): "Default Invoice Report": the report GnuCash's Print Invoice runs, as GnuCash parses the slot; null when unset or unreadable. The GUID is returned as stored and may name no report red-ale has (v0.6).