scrub.orphans
Put splits with no account into an Orphan-<CUR> account, balancing each transaction changed.
Puts splits that have no account (or an account the book does not contain) into an Orphan-<CUR> account, made if
missing, and balances each transaction it changed. Scope it with transaction, or account and subaccounts; with
neither it covers the whole book. A clean book gives an empty repairs list.
Examples
Example: with a copy of the gnucash/taxreport example book open as book.gnucash.
JSON-RPC
Request:
{"jsonrpc":"2.0","id":1,"method":"scrub.orphans","params":{}}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"repairs": []
}
}
Command line
red-ale exec --book book.gnucash scrub.orphans
It prints:
{
"repairs": []
}
MCP tool call
Tool call:
{"name":"scrub.orphans","arguments":{}}
Result:
{
"structuredContent": {
"repairs": []
}
}
Effect: destructive, on the Book.
Params
Params of the scrubs. Give a transaction, or an account (with or without its sub-accounts); give neither for the whole book.
transaction(Guid or null): Scrub this transaction only.account(AccountRef or null): Scrub the transactions with a split in this account.subaccounts(boolean): Withaccount: its sub-accounts too.
Result
What a scrub did.
repairs(array of RepairWire, required): Every change, in the order made. Empty when there was nothing to repair.