hledger/hledger/Hledger/Cli/Commands/Aregister.md
2021-01-27 12:53:49 -08:00

2.7 KiB
Raw Blame History

aregister, areg

Show the transactions and running historical balance in an account, with each line item representing one transaction.

_FLAGS

aregister shows the transactions affecting a particular account and its subaccounts, with each line item representing a whole transaction - as in bank statements, hledger-ui, hledger-web and other accounting apps.

Note this is unlike the register command, which shows individual postings and does not always show a single account or a historical balance.

A reminder, “historical” balances include any balance from transactions before the report start date, so (if opening balances are recorded correctly) aregister will show the real-world balances of an account, as you would see in a bank statement.

As a quick rule of thumb, use aregister for reconciling real-world asset/liability accounts and register for reviewing detailed revenues/expenses.

An account must be specified as the first argument. This can be a full account name or an account pattern (regular expression).

Any additional arguments form a query which will filter the transactions shown.

Each aregister line item shows:

  • the transactions date (or the relevant postings date if different, see below)
  • the names of all the other account(s) involved in this transaction (probably abbreviated)
  • the total change to this accounts balance from this transaction
  • the accounts historical running balance after this transaction.

Transactions making a net change of zero are not shown by default; add the -E/--empty flag to show them.

aregister ignores a depth limit, so its final total will always match a balance report with similar arguments.

This command also supports the output destination and output format options The output formats supported are txt, csv, and json.

aregister and custom posting dates

Transactions whose date is outside the report period can still be shown, if they have a posting to this account dated inside the report period. (And in this case its the posting date that is shown.) This ensures that aregister can show an accurate historical running balance, matching the one shown by register -H with the same arguments.

To filter strictly by transaction date instead, add the --txn-dates flag. If you use this flag and some of your postings have custom dates, its probably best to assume the running balance is wrong.

Examples:

Show all transactions and historical running balance in the first account whose name contains “checking”:

$ hledger areg checking

Show transactions and historical running balance in all asset accounts during july:

$ hledger areg assets date:jul