An account-centric transactions report.
An account transactions report represents transactions affecting a
particular account (or possibly several accounts, but we don't use
that). It is used eg by hledger-ui's and hledger-web's register view,
and hledger's aregister report, where we want to show one row per
transaction, in the context of the current account. Report items
- the transaction, unmodified
- the transaction as seen in the context of the current account and
query, which means:
- the transaction date is set to the "transaction context date",
which can be different from the transaction's general date: if
postings to the current account (and matched by the report query) have
their own dates, it's the earliest of these dates.
- the transaction's postings are filtered, excluding any which are
not matched by the report query
- a text description of the other account(s) posted to/from
- a flag indicating whether there's more than one other account
- the total increase/decrease to the current account
- the report transactions' running total after this transaction; or
if historical balance is requested (-H), the historical running total.
The historical running total includes transactions from before the
report start date if one is specified, filtered by the report query.
The historical running total may or may not be the account's
historical running balance, depending on the report query.
Items are sorted by transaction register date (the earliest date the
transaction posts to the current account), most recent first.
Reporting intervals are currently ignored.
Generate transactions report items from a list of transactions, using
the provided user-specified report query, a query specifying which
account to use as the focus, a starting balance, a sign-setting
function and a balance-summing function. Or with a None current
account query, this can also be used for the transactionsReport.