diff --git a/hledger/hledger.1 b/hledger/hledger.1 index 137d2e06e..5200354a4 100644 --- a/hledger/hledger.1 +++ b/hledger/hledger.1 @@ -7993,6 +7993,7 @@ otherwise the latest transaction date in the journal, otherwise today. a flag (-D/-W/-M/-Q/-Y) or period expression that activates the report\[aq]s multi-period mode (whether showing one or many subperiods). .SH PART 4: COMMANDS +.SS Commands overview .PP Here are the built-in commands: .SS DATA ENTRY @@ -8000,17 +8001,17 @@ Here are the built-in commands: These data entry commands are the only ones which can modify your journal file. .IP \[bu] 2 -add - add transactions using guided prompts +add - add transactions using terminal prompts .IP \[bu] 2 -import - add any new transactions from other files (eg csv) +import - add new transactions from other files, eg CSV files .SS DATA CREATION .IP \[bu] 2 -close - generate balance-resetting transactions +close - generate balance-zeroing/restoring transactions .IP \[bu] 2 -rewrite - generate extra postings, similar to print --auto +rewrite - generate auto postings, like print --auto .SS DATA MANAGEMENT .IP \[bu] 2 -check - check for various kinds of issue in the data +check - check for various kinds of error in the data .IP \[bu] 2 diff - compare account transactions in two journal files .SS REPORTS, FINANCIAL @@ -8026,10 +8027,9 @@ cashflow (cf) - show changes in liquid assets incomestatement (is) - show revenues and expenses .SS REPORTS, VERSATILE .IP \[bu] 2 -balance (bal) - show balance changes/end balances/budgets in any -accounts +balance (bal) - show balance changes, end balances, budgets, gains.. .IP \[bu] 2 -print - show transactions (journal entries) +print - show transactions or export journal data .IP \[bu] 2 register (reg) - show postings in one or more accounts & running total .IP \[bu] 2 @@ -8038,21 +8038,21 @@ roi - show return on investments .IP \[bu] 2 accounts - show account names .IP \[bu] 2 -activity - show postings-per-interval bar charts +activity - show bar charts of posting counts per period .IP \[bu] 2 codes - show transaction codes .IP \[bu] 2 commodities - show commodity/currency symbols .IP \[bu] 2 -descriptions - show unique transaction descriptions +descriptions - show transaction descriptions .IP \[bu] 2 files - show input file paths .IP \[bu] 2 -notes - show unique note segments of transaction descriptions +notes - show note parts of transaction descriptions .IP \[bu] 2 -payees - show unique payee segments of transaction descriptions +payees - show payee parts of transaction descriptions .IP \[bu] 2 -prices - show market price records +prices - show market prices .IP \[bu] 2 stats - show journal statistics .IP \[bu] 2 @@ -8061,7 +8061,7 @@ tags - show tag names test - run self tests .SS HELP .IP \[bu] 2 -help - show hledger user manuals in several formats +help - show the hledger manual with info/man/pager .PP .SS ADD-ONS .PP @@ -8069,16 +8069,15 @@ And here are some typical add-on commands. Some of these are installed by the hledger-install script. If installed, they will appear in hledger\[aq]s commands list: .IP \[bu] 2 -ui - hledger\[aq]s official terminal UI +ui - run hledger\[aq]s terminal UI .IP \[bu] 2 -web - hledger\[aq]s official web UI +web - run hledger\[aq]s web UI .IP \[bu] 2 -iadd - an alternative to hledger\[aq]s \f[V]add\f[R] command (currently -hard to build) +iadd - add transactions using a TUI (currently hard to build) .IP \[bu] 2 -interest - generates interest transactions +interest - generate interest transactions .IP \[bu] 2 -stockquotes - downloads market prices +stockquotes - download market prices from AlphaVantage .IP \[bu] 2 Scripts and add-ons - check-fancyassertions, edit, fifo, git, move, pijul, plot, and more.. diff --git a/hledger/hledger.info b/hledger/hledger.info index 71a2ec353..7a9627bfe 100644 --- a/hledger/hledger.info +++ b/hledger/hledger.info @@ -6866,18 +6866,9 @@ File: hledger.info, Node: PART 4 COMMANDS, Next: PART 5 COMMON TASKS, Prev: V 24 PART 4: COMMANDS ******************* -Here are the built-in commands: - * Menu: -* DATA ENTRY:: -* DATA CREATION:: -* DATA MANAGEMENT:: -* REPORTS FINANCIAL:: -* REPORTS VERSATILE:: -* REPORTS BASIC:: -* HELP:: -* ADD-ONS:: +* Commands overview:: * accounts:: * activity:: * add:: @@ -6908,40 +6899,59 @@ Here are the built-in commands: * test::  -File: hledger.info, Node: DATA ENTRY, Next: DATA CREATION, Up: PART 4 COMMANDS +File: hledger.info, Node: Commands overview, Next: accounts, Up: PART 4 COMMANDS -24.1 DATA ENTRY -=============== +24.1 Commands overview +====================== + +Here are the built-in commands: + +* Menu: + +* DATA ENTRY:: +* DATA CREATION:: +* DATA MANAGEMENT:: +* REPORTS FINANCIAL:: +* REPORTS VERSATILE:: +* REPORTS BASIC:: +* HELP:: +* ADD-ONS:: + + +File: hledger.info, Node: DATA ENTRY, Next: DATA CREATION, Up: Commands overview + +24.1.1 DATA ENTRY +----------------- These data entry commands are the only ones which can modify your journal file. - • add - add transactions using guided prompts - • import - add any new transactions from other files (eg csv) + • add - add transactions using terminal prompts + • import - add new transactions from other files, eg CSV files  -File: hledger.info, Node: DATA CREATION, Next: DATA MANAGEMENT, Prev: DATA ENTRY, Up: PART 4 COMMANDS +File: hledger.info, Node: DATA CREATION, Next: DATA MANAGEMENT, Prev: DATA ENTRY, Up: Commands overview -24.2 DATA CREATION -================== +24.1.2 DATA CREATION +-------------------- - • close - generate balance-resetting transactions - • rewrite - generate extra postings, similar to print –auto + • close - generate balance-zeroing/restoring transactions + • rewrite - generate auto postings, like print –auto  -File: hledger.info, Node: DATA MANAGEMENT, Next: REPORTS FINANCIAL, Prev: DATA CREATION, Up: PART 4 COMMANDS +File: hledger.info, Node: DATA MANAGEMENT, Next: REPORTS FINANCIAL, Prev: DATA CREATION, Up: Commands overview -24.3 DATA MANAGEMENT -==================== +24.1.3 DATA MANAGEMENT +---------------------- - • check - check for various kinds of issue in the data + • check - check for various kinds of error in the data • diff - compare account transactions in two journal files  -File: hledger.info, Node: REPORTS FINANCIAL, Next: REPORTS VERSATILE, Prev: DATA MANAGEMENT, Up: PART 4 COMMANDS +File: hledger.info, Node: REPORTS FINANCIAL, Next: REPORTS VERSATILE, Prev: DATA MANAGEMENT, Up: Commands overview -24.4 REPORTS, FINANCIAL -======================= +24.1.4 REPORTS, FINANCIAL +------------------------- • aregister (areg) - show transactions in a particular account • balancesheet (bs) - show assets, liabilities and net worth @@ -6950,70 +6960,69 @@ File: hledger.info, Node: REPORTS FINANCIAL, Next: REPORTS VERSATILE, Prev: D • incomestatement (is) - show revenues and expenses  -File: hledger.info, Node: REPORTS VERSATILE, Next: REPORTS BASIC, Prev: REPORTS FINANCIAL, Up: PART 4 COMMANDS +File: hledger.info, Node: REPORTS VERSATILE, Next: REPORTS BASIC, Prev: REPORTS FINANCIAL, Up: Commands overview -24.5 REPORTS, VERSATILE -======================= +24.1.5 REPORTS, VERSATILE +------------------------- - • balance (bal) - show balance changes/end balances/budgets in any - accounts - • print - show transactions (journal entries) + • balance (bal) - show balance changes, end balances, budgets, + gains.. + • print - show transactions or export journal data • register (reg) - show postings in one or more accounts & running total • roi - show return on investments  -File: hledger.info, Node: REPORTS BASIC, Next: HELP, Prev: REPORTS VERSATILE, Up: PART 4 COMMANDS +File: hledger.info, Node: REPORTS BASIC, Next: HELP, Prev: REPORTS VERSATILE, Up: Commands overview -24.6 REPORTS, BASIC -=================== +24.1.6 REPORTS, BASIC +--------------------- • accounts - show account names - • activity - show postings-per-interval bar charts + • activity - show bar charts of posting counts per period • codes - show transaction codes • commodities - show commodity/currency symbols - • descriptions - show unique transaction descriptions + • descriptions - show transaction descriptions • files - show input file paths - • notes - show unique note segments of transaction descriptions - • payees - show unique payee segments of transaction descriptions - • prices - show market price records + • notes - show note parts of transaction descriptions + • payees - show payee parts of transaction descriptions + • prices - show market prices • stats - show journal statistics • tags - show tag names • test - run self tests  -File: hledger.info, Node: HELP, Next: ADD-ONS, Prev: REPORTS BASIC, Up: PART 4 COMMANDS +File: hledger.info, Node: HELP, Next: ADD-ONS, Prev: REPORTS BASIC, Up: Commands overview -24.7 HELP -========= +24.1.7 HELP +----------- - • help - show hledger user manuals in several formats + • help - show the hledger manual with info/man/pager  -File: hledger.info, Node: ADD-ONS, Next: accounts, Prev: HELP, Up: PART 4 COMMANDS +File: hledger.info, Node: ADD-ONS, Prev: HELP, Up: Commands overview -24.8 ADD-ONS -============ +24.1.8 ADD-ONS +-------------- And here are some typical add-on commands. Some of these are installed by the hledger-install script. If installed, they will appear in hledger’s commands list: - • ui - hledger’s official terminal UI - • web - hledger’s official web UI - • iadd - an alternative to hledger’s ‘add’ command (currently hard to - build) - • interest - generates interest transactions - • stockquotes - downloads market prices + • ui - run hledger’s terminal UI + • web - run hledger’s web UI + • iadd - add transactions using a TUI (currently hard to build) + • interest - generate interest transactions + • stockquotes - download market prices from AlphaVantage • Scripts and add-ons - check-fancyassertions, edit, fifo, git, move, pijul, plot, and more.. Next, each command is described in detail, in alphabetical order.  -File: hledger.info, Node: accounts, Next: activity, Prev: ADD-ONS, Up: PART 4 COMMANDS +File: hledger.info, Node: accounts, Next: activity, Prev: Commands overview, Up: PART 4 COMMANDS -24.9 accounts +24.2 accounts ============= Show account names. @@ -7070,8 +7079,8 @@ $ hledger check accounts  File: hledger.info, Node: activity, Next: add, Prev: accounts, Up: PART 4 COMMANDS -24.10 activity -============== +24.3 activity +============= Show an ascii barchart of posting counts per interval. @@ -7090,8 +7099,8 @@ $ hledger activity --quarterly  File: hledger.info, Node: add, Next: aregister, Prev: activity, Up: PART 4 COMMANDS -24.11 add -========= +24.4 add +======== Prompt for transactions and add them to the journal. Any arguments will be used as default inputs for the first N prompts. @@ -7160,8 +7169,8 @@ file path ends with a period, as that would cause problems (#1056).  File: hledger.info, Node: aregister, Next: balance, Prev: add, Up: PART 4 COMMANDS -24.12 aregister -=============== +24.5 aregister +============== (areg) @@ -7235,8 +7244,8 @@ options. The output formats supported are ‘txt’, ‘csv’, and ‘json’.  File: hledger.info, Node: aregister and custom posting dates, Up: aregister -24.12.1 aregister and custom posting dates ------------------------------------------- +24.5.1 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. @@ -7251,8 +7260,8 @@ it’s probably best to assume the running balance is wrong.  File: hledger.info, Node: balance, Next: balancesheet, Prev: aregister, Up: PART 4 COMMANDS -24.13 balance -============= +24.6 balance +============ (bal) @@ -7290,8 +7299,8 @@ more control, then use ‘balance’.  File: hledger.info, Node: balance features, Next: Simple balance report, Up: balance -24.13.1 balance features ------------------------- +24.6.1 balance features +----------------------- Here’s a quick overview of the ‘balance’ command’s features, followed by more detailed descriptions and examples. Many of these work with the @@ -7352,8 +7361,8 @@ in the transactions of the postings which would normally be shown.  File: hledger.info, Node: Simple balance report, Next: Balance report line format, Prev: balance features, Up: balance -24.13.2 Simple balance report ------------------------------ +24.6.2 Simple balance report +---------------------------- With no arguments, ‘balance’ shows a list of all accounts and their change of balance - ie, the sum of posting amounts, both inflows and @@ -7401,8 +7410,8 @@ $ hledger -f examples/sample.journal bal -E  File: hledger.info, Node: Balance report line format, Next: Filtered balance report, Prev: Simple balance report, Up: balance -24.13.3 Balance report line format ----------------------------------- +24.6.3 Balance report line format +--------------------------------- For single-period balance reports displayed in the terminal (only), you can use ‘--format FMT’ to customise the format and content of each line. @@ -7464,8 +7473,8 @@ may be needed to get pleasing results.  File: hledger.info, Node: Filtered balance report, Next: List or tree mode, Prev: Balance report line format, Up: balance -24.13.4 Filtered balance report -------------------------------- +24.6.4 Filtered balance report +------------------------------ You can show fewer accounts, a different time period, totals from cleared transactions only, etc. by using query arguments or options to @@ -7479,8 +7488,8 @@ $ hledger -f examples/sample.journal bal --cleared assets date:200806  File: hledger.info, Node: List or tree mode, Next: Depth limiting, Prev: Filtered balance report, Up: balance -24.13.5 List or tree mode -------------------------- +24.6.5 List or tree mode +------------------------ By default, or with ‘-l/--flat’, accounts are shown as a flat list with their full names visible, as in the examples above. @@ -7522,8 +7531,8 @@ $ hledger -f examples/sample.journal balance  File: hledger.info, Node: Depth limiting, Next: Dropping top-level accounts, Prev: List or tree mode, Up: balance -24.13.6 Depth limiting ----------------------- +24.6.6 Depth limiting +--------------------- With a ‘depth:NUM’ query, or ‘--depth NUM’ option, or just ‘-NUM’ (eg: ‘-3’) balance reports will show accounts only to the specified depth, @@ -7544,8 +7553,8 @@ $ hledger -f examples/sample.journal balance -1  File: hledger.info, Node: Dropping top-level accounts, Next: Showing declared accounts, Prev: Depth limiting, Up: balance -24.13.7 Dropping top-level accounts ------------------------------------ +24.6.7 Dropping top-level accounts +---------------------------------- You can also hide one or more top-level account name parts, using ‘--drop NUM’. This can be useful for hiding repetitive top-level @@ -7560,8 +7569,8 @@ $ hledger -f examples/sample.journal bal expenses --drop 1  File: hledger.info, Node: Showing declared accounts, Next: Sorting by amount, Prev: Dropping top-level accounts, Up: balance -24.13.8 Showing declared accounts ---------------------------------- +24.6.8 Showing declared accounts +-------------------------------- With ‘--declared’, accounts which have been declared with an account directive will be included in the balance report, even if they have no @@ -7578,8 +7587,8 @@ accounts yet.  File: hledger.info, Node: Sorting by amount, Next: Percentages, Prev: Showing declared accounts, Up: balance -24.13.9 Sorting by amount -------------------------- +24.6.9 Sorting by amount +------------------------ With ‘-S/--sort-amount’, accounts with the largest (most positive) balances are shown first. Eg: ‘hledger bal expenses -MAS’ shows your @@ -7596,8 +7605,8 @@ which flip the sign automatically. Eg: ‘hledger incomestatement -MAS’).  File: hledger.info, Node: Percentages, Next: Multi-period balance report, Prev: Sorting by amount, Up: balance -24.13.10 Percentages --------------------- +24.6.10 Percentages +------------------- With ‘-%/--percent’, balance reports show each account’s value expressed as a percentage of the (column) total. @@ -7619,8 +7628,8 @@ $ hledger bal -% cur:€  File: hledger.info, Node: Multi-period balance report, Next: Balance change end balance, Prev: Percentages, Up: balance -24.13.11 Multi-period balance report ------------------------------------- +24.6.11 Multi-period balance report +----------------------------------- With a report interval (set by the ‘-D/--daily’, ‘-W/--weekly’, ‘-M/--monthly’, ‘-Q/--quarterly’, ‘-Y/--yearly’, or ‘-p/--period’ flag), @@ -7674,8 +7683,8 @@ viewing in the terminal. Here are some ways to handle that:  File: hledger.info, Node: Balance change end balance, Next: Balance report types, Prev: Multi-period balance report, Up: balance -24.13.12 Balance change, end balance ------------------------------------- +24.6.12 Balance change, end balance +----------------------------------- It’s important to be clear on the meaning of the numbers shown in balance reports. Here is some terminology we use: @@ -7711,8 +7720,8 @@ historical end balances:  File: hledger.info, Node: Balance report types, Next: Budget report, Prev: Balance change end balance, Up: balance -24.13.13 Balance report types ------------------------------ +24.6.13 Balance report types +---------------------------- The balance command is quite flexible; here is the full detail on how to control what it reports. If the following seems complicated, don’t @@ -7734,8 +7743,8 @@ time and experimentation to get clear on all these report modes.  File: hledger.info, Node: Calculation type, Next: Accumulation type, Up: Balance report types -24.13.13.1 Calculation type -........................... +24.6.13.1 Calculation type +.......................... The basic calculation to perform for each table cell. It is one of: @@ -7751,8 +7760,8 @@ The basic calculation to perform for each table cell. It is one of:  File: hledger.info, Node: Accumulation type, Next: Valuation type, Prev: Calculation type, Up: Balance report types -24.13.13.2 Accumulation type -............................ +24.6.13.2 Accumulation type +........................... How amounts should accumulate across report periods. Another way to say it: which time period’s postings should contribute to each cell’s @@ -7776,8 +7785,8 @@ calculation. It is one of:  File: hledger.info, Node: Valuation type, Next: Combining balance report types, Prev: Accumulation type, Up: Balance report types -24.13.13.3 Valuation type -......................... +24.6.13.3 Valuation type +........................ Which kind of value or cost conversion should be applied, if any, before displaying the report. It is one of: @@ -7807,8 +7816,8 @@ displaying the report. It is one of:  File: hledger.info, Node: Combining balance report types, Prev: Valuation type, Up: Balance report types -24.13.13.4 Combining balance report types -......................................... +24.6.13.4 Combining balance report types +........................................ Most combinations of these options should produce reasonable reports, but if you find any that seem wrong or misleading, let us know. The @@ -7846,8 +7855,8 @@ Accumulation:v YYYY-MM-DD  File: hledger.info, Node: Budget report, Next: Data layout, Prev: Balance report types, Up: balance -24.13.14 Budget report ----------------------- +24.6.14 Budget report +--------------------- The ‘--budget’ report type activates extra columns showing any budget goals for each account and period. The budget goals are defined by @@ -7983,8 +7992,8 @@ currencies, ‘--layout bare’ or ‘--layout tall’ can help.  File: hledger.info, Node: Budget report start date, Next: Budgets and subaccounts, Up: Budget report -24.13.14.1 Budget report start date -................................... +24.6.14.1 Budget report start date +.................................. This might be a bug, but for now: when making budget reports, it’s a good idea to explicitly set the report’s start date to the first day of @@ -8027,8 +8036,8 @@ Budget performance in 2020-01-01..2020-01-15:  File: hledger.info, Node: Budgets and subaccounts, Next: Selecting budget goals, Prev: Budget report start date, Up: Budget report -24.13.14.2 Budgets and subaccounts -.................................. +24.6.14.2 Budgets and subaccounts +................................. You can add budgets to any account in your account hierarchy. If you have budgets on both parent account and some of its children, then @@ -8115,8 +8124,8 @@ Budget performance in 2019/01:  File: hledger.info, Node: Selecting budget goals, Next: Budget vs forecast, Prev: Budgets and subaccounts, Up: Budget report -24.13.14.3 Selecting budget goals -................................. +24.6.14.3 Selecting budget goals +................................ The budget report evaluates periodic transaction rules to generate special "goal transactions", which generate the goal amounts for each @@ -8141,8 +8150,8 @@ select from multiple budgets defined in your journal.  File: hledger.info, Node: Budget vs forecast, Prev: Selecting budget goals, Up: Budget report -24.13.14.4 Budget vs forecast -............................. +24.6.14.4 Budget vs forecast +............................ ‘hledger --forecast ...’ and ‘hledger balance --budget ...’ are separate features, though both of them use the periodic transaction rules defined @@ -8189,8 +8198,8 @@ time if you want. Here are some differences between them, as of hledger  File: hledger.info, Node: Data layout, Next: Useful balance reports, Prev: Budget report, Up: balance -24.13.15 Data layout --------------------- +24.6.15 Data layout +------------------- The ‘--layout’ option affects how balance reports show multi-commodity amounts and commodity symbols, which can improve readability. It can @@ -8324,8 +8333,8 @@ tidy Y  File: hledger.info, Node: Useful balance reports, Prev: Data layout, Up: balance -24.13.16 Useful balance reports -------------------------------- +24.6.16 Useful balance reports +------------------------------ Some frequently used ‘balance’ options/reports are: @@ -8364,8 +8373,8 @@ Some frequently used ‘balance’ options/reports are:  File: hledger.info, Node: balancesheet, Next: balancesheetequity, Prev: balance, Up: PART 4 COMMANDS -24.14 balancesheet -================== +24.7 balancesheet +================= (bs) @@ -8413,8 +8422,8 @@ options The output formats supported are ‘txt’, ‘csv’, ‘html’, and  File: hledger.info, Node: balancesheetequity, Next: cashflow, Prev: balancesheet, Up: PART 4 COMMANDS -24.15 balancesheetequity -======================== +24.8 balancesheetequity +======================= (bse) @@ -8467,8 +8476,8 @@ options The output formats supported are ‘txt’, ‘csv’, ‘html’, and  File: hledger.info, Node: cashflow, Next: check, Prev: balancesheetequity, Up: PART 4 COMMANDS -24.16 cashflow -============== +24.9 cashflow +============= (cf) @@ -8520,7 +8529,7 @@ options The output formats supported are ‘txt’, ‘csv’, ‘html’, and  File: hledger.info, Node: check, Next: close, Prev: cashflow, Up: PART 4 COMMANDS -24.17 check +24.10 check =========== Check for various kinds of errors in your data. @@ -8553,7 +8562,7 @@ run these checks, providing instant feedback as you edit the journal.  File: hledger.info, Node: Basic checks, Next: Strict checks, Up: check -24.17.1 Basic checks +24.10.1 Basic checks -------------------- These checks are always run automatically, by (almost) all hledger @@ -8572,7 +8581,7 @@ commands, including ‘check’:  File: hledger.info, Node: Strict checks, Next: Other checks, Prev: Basic checks, Up: check -24.17.2 Strict checks +24.10.2 Strict checks --------------------- These additional checks are run when the ‘-s’/‘--strict’ (strict mode) @@ -8590,7 +8599,7 @@ flag is used. Or, they can be run by giving their names as arguments to  File: hledger.info, Node: Other checks, Next: Custom checks, Prev: Strict checks, Up: check -24.17.3 Other checks +24.10.3 Other checks -------------------- These checks can be run only by giving their names as arguments to @@ -8611,7 +8620,7 @@ therefore optional:  File: hledger.info, Node: Custom checks, Next: More about specific checks, Prev: Other checks, Up: check -24.17.4 Custom checks +24.10.4 Custom checks --------------------- A few more checks are are available as separate add-on commands, in @@ -8629,7 +8638,7 @@ See: Cookbook -> Scripting.  File: hledger.info, Node: More about specific checks, Prev: Custom checks, Up: check -24.17.5 More about specific checks +24.10.5 More about specific checks ---------------------------------- ‘hledger check recentassertions’ will complain if any balance-asserted @@ -8647,7 +8656,7 @@ assertions against real-world balances.  File: hledger.info, Node: close, Next: codes, Prev: check, Up: PART 4 COMMANDS -24.18 close +24.11 close =========== ‘close [--retain | --migrate | --open] [QUERY]’ @@ -8712,7 +8721,7 @@ report period will be the closing date; eg ‘-e 2022’ means "close on  File: hledger.info, Node: close and costs, Next: close and balance assertions, Up: close -24.18.1 close and costs +24.11.1 close and costs ----------------------- With ‘--show-costs’, any amount costs are shown, with separate postings @@ -8723,7 +8732,7 @@ investment transactions, it can generate very large journal entries.  File: hledger.info, Node: close and balance assertions, Next: Example retain earnings, Prev: close and costs, Up: close -24.18.2 close and balance assertions +24.11.2 close and balance assertions ------------------------------------ Balance assertions will be generated, verifying that the accounts have @@ -8761,7 +8770,7 @@ single-day transactions:  File: hledger.info, Node: Example retain earnings, Next: Example migrate balances to a new file, Prev: close and balance assertions, Up: close -24.18.3 Example: retain earnings +24.11.3 Example: retain earnings -------------------------------- Record 2022’s revenues/expenses as retained earnings on 2022-12-31, @@ -8777,7 +8786,7 @@ $ hledger -f 2022.journal is not:desc:'retain earnings'  File: hledger.info, Node: Example migrate balances to a new file, Next: Example excluding closing/opening transactions, Prev: Example retain earnings, Up: close -24.18.4 Example: migrate balances to a new file +24.11.4 Example: migrate balances to a new file ----------------------------------------------- Close assets/liabilities/equity on 2022-12-31 and re-open them on @@ -8797,7 +8806,7 @@ $ hledger -f 2022.journal bs not:desc:'closing balances'  File: hledger.info, Node: Example excluding closing/opening transactions, Prev: Example migrate balances to a new file, Up: close -24.18.5 Example: excluding closing/opening transactions +24.11.5 Example: excluding closing/opening transactions ------------------------------------------------------- When combining many files for multi-year reports, the closing/opening @@ -8844,7 +8853,7 @@ $ hledger -f all.journal bs -e2023 not:tag:clopen=2023  File: hledger.info, Node: codes, Next: commodities, Prev: close, Up: PART 4 COMMANDS -24.19 codes +24.12 codes =========== List the codes seen in transactions, in the order parsed. @@ -8892,7 +8901,7 @@ $ hledger codes -E  File: hledger.info, Node: commodities, Next: descriptions, Prev: codes, Up: PART 4 COMMANDS -24.20 commodities +24.13 commodities ================= List all commodity/currency symbols used or declared in the journal. @@ -8900,7 +8909,7 @@ List all commodity/currency symbols used or declared in the journal.  File: hledger.info, Node: descriptions, Next: diff, Prev: commodities, Up: PART 4 COMMANDS -24.21 descriptions +24.14 descriptions ================== List the unique descriptions that appear in transactions. @@ -8919,7 +8928,7 @@ Person A  File: hledger.info, Node: diff, Next: files, Prev: descriptions, Up: PART 4 COMMANDS -24.22 diff +24.15 diff ========== Compares a particular account’s transactions in two input files. It @@ -8953,7 +8962,7 @@ These transactions are in the second file only:  File: hledger.info, Node: files, Next: help, Prev: diff, Up: PART 4 COMMANDS -24.23 files +24.16 files =========== List all files included in the journal. With a REGEX argument, only @@ -8962,7 +8971,7 @@ file names matching the regular expression (case sensitive) are shown.  File: hledger.info, Node: help, Next: import, Prev: files, Up: PART 4 COMMANDS -24.24 help +24.17 help ========== Show the hledger user manual in the terminal, with ‘info’, ‘man’, or a @@ -8989,7 +8998,7 @@ $ hledger help journal # show the journal topic in the hledger manual  File: hledger.info, Node: import, Next: incomestatement, Prev: help, Up: PART 4 COMMANDS -24.25 import +24.18 import ============ Read new transactions added to each FILE since last run, and add them to @@ -9021,7 +9030,7 @@ most common import source, and these docs focus on that case.  File: hledger.info, Node: Deduplication, Next: Import testing, Up: import -24.25.1 Deduplication +24.18.1 Deduplication --------------------- As a convenience ‘import’ does _deduplication_ while reading @@ -9065,7 +9074,7 @@ certain date.  File: hledger.info, Node: Import testing, Next: Importing balance assignments, Prev: Deduplication, Up: import -24.25.2 Import testing +24.18.2 Import testing ---------------------- With ‘--dry-run’, the transactions that will be imported are printed to @@ -9090,7 +9099,7 @@ import.  File: hledger.info, Node: Importing balance assignments, Next: Commodity display styles, Prev: Import testing, Up: import -24.25.3 Importing balance assignments +24.18.3 Importing balance assignments ------------------------------------- Entries added by import will have their posting amounts made explicit @@ -9109,7 +9118,7 @@ please test it and send a pull request.)  File: hledger.info, Node: Commodity display styles, Prev: Importing balance assignments, Up: import -24.25.4 Commodity display styles +24.18.4 Commodity display styles -------------------------------- Imported amounts will be formatted according to the canonical commodity @@ -9118,7 +9127,7 @@ styles (declared or inferred) in the main journal file.  File: hledger.info, Node: incomestatement, Next: notes, Prev: import, Up: PART 4 COMMANDS -24.26 incomestatement +24.19 incomestatement ===================== (is) @@ -9168,7 +9177,7 @@ options The output formats supported are ‘txt’, ‘csv’, ‘html’, and  File: hledger.info, Node: notes, Next: payees, Prev: incomestatement, Up: PART 4 COMMANDS -24.27 notes +24.20 notes =========== List the unique notes that appear in transactions. @@ -9187,7 +9196,7 @@ Snacks  File: hledger.info, Node: payees, Next: prices, Prev: notes, Up: PART 4 COMMANDS -24.28 payees +24.21 payees ============ List the unique payee/payer names that appear in transactions. @@ -9212,7 +9221,7 @@ Person A  File: hledger.info, Node: prices, Next: print, Prev: payees, Up: PART 4 COMMANDS -24.29 prices +24.22 prices ============ Print market price directives from the journal. With @@ -9224,7 +9233,7 @@ displayed with their full precision.  File: hledger.info, Node: print, Next: register, Prev: prices, Up: PART 4 COMMANDS -24.30 print +24.23 print =========== Show transaction journal entries, sorted by date. @@ -9348,7 +9357,7 @@ $ hledger print -Ocsv  File: hledger.info, Node: register, Next: rewrite, Prev: print, Up: PART 4 COMMANDS -24.31 register +24.24 register ============== (reg) @@ -9458,7 +9467,7 @@ no posting will be shown and the program exit code will be non-zero.  File: hledger.info, Node: Custom register output, Up: register -24.31.1 Custom register output +24.24.1 Custom register output ------------------------------ register uses the full terminal width by default, except on windows. @@ -9490,7 +9499,7 @@ options The output formats supported are ‘txt’, ‘csv’, and  File: hledger.info, Node: rewrite, Next: roi, Prev: register, Up: PART 4 COMMANDS -24.32 rewrite +24.25 rewrite ============= Print all transactions, rewriting the postings of matched transactions. @@ -9543,7 +9552,7 @@ commodity.  File: hledger.info, Node: Re-write rules in a file, Next: Diff output format, Up: rewrite -24.32.1 Re-write rules in a file +24.25.1 Re-write rules in a file -------------------------------- During the run this tool will execute so called "Automated Transactions" @@ -9581,7 +9590,7 @@ postings.  File: hledger.info, Node: Diff output format, Next: rewrite vs print --auto, Prev: Re-write rules in a file, Up: rewrite -24.32.2 Diff output format +24.25.2 Diff output format -------------------------- To use this tool for batch modification of your journal files you may @@ -9622,7 +9631,7 @@ output from ‘hledger print’.  File: hledger.info, Node: rewrite vs print --auto, Prev: Diff output format, Up: rewrite -24.32.3 rewrite vs. print –auto +24.25.3 rewrite vs. print –auto ------------------------------- This command predates print –auto, and currently does much the same @@ -9642,7 +9651,7 @@ thing, but with these differences:  File: hledger.info, Node: roi, Next: stats, Prev: rewrite, Up: PART 4 COMMANDS -24.33 roi +24.26 roi ========= Shows the time-weighted (TWR) and money-weighted (IRR) rate of return on @@ -9690,7 +9699,7 @@ display, regardless of the length of reporting interval.  File: hledger.info, Node: Spaces and special characters in --inv and --pnl, Next: Semantics of --inv and --pnl, Up: roi -24.33.1 Spaces and special characters in ‘--inv’ and +24.26.1 Spaces and special characters in ‘--inv’ and ---------------------------------------------------- ‘--pnl’ Note that ‘--inv’ and ‘--pnl’’s argument is a query, and queries @@ -9709,7 +9718,7 @@ $ hledger roi --inv="'Assets:Test 1'" --pnl="'Equity:Unrealized Profit and Loss'  File: hledger.info, Node: Semantics of --inv and --pnl, Next: IRR and TWR explained, Prev: Spaces and special characters in --inv and --pnl, Up: roi -24.33.2 Semantics of ‘--inv’ and ‘--pnl’ +24.26.2 Semantics of ‘--inv’ and ‘--pnl’ ---------------------------------------- Query supplied to ‘--inv’ has to match all transactions that are related @@ -9763,7 +9772,7 @@ postings in the example below would be classifed as:  File: hledger.info, Node: IRR and TWR explained, Prev: Semantics of --inv and --pnl, Up: roi -24.33.3 IRR and TWR explained +24.26.3 IRR and TWR explained ----------------------------- "ROI" stands for "return on investment". Traditionally this was @@ -9830,7 +9839,7 @@ your investment.  File: hledger.info, Node: stats, Next: tags, Prev: roi, Up: PART 4 COMMANDS -24.34 stats +24.27 stats =========== Show journal and performance statistics. @@ -9870,7 +9879,7 @@ Throughput : 8342 txns/s  File: hledger.info, Node: tags, Next: test, Prev: stats, Up: PART 4 COMMANDS -24.35 tags +24.28 tags ========== List the tags used in the journal, or their values. @@ -9900,7 +9909,7 @@ transactions also acquire tags from their postings.  File: hledger.info, Node: test, Prev: tags, Up: PART 4 COMMANDS -24.36 test +24.29 test ========== Run built-in unit tests. @@ -10772,188 +10781,190 @@ Node: Effect of valuation on reports239415 Ref: #effect-of-valuation-on-reports239612 Node: PART 4 COMMANDS247371 Ref: #part-4-commands247514 -Node: DATA ENTRY248031 -Ref: #data-entry248149 -Node: DATA CREATION248349 -Ref: #data-creation248497 -Node: DATA MANAGEMENT248620 -Ref: #data-management248779 -Node: REPORTS FINANCIAL248904 -Ref: #reports-financial249073 -Node: REPORTS VERSATILE249388 -Ref: #reports-versatile249555 -Node: REPORTS BASIC249816 -Ref: #reports-basic249962 -Node: HELP250522 -Ref: #help250638 -Node: ADD-ONS250698 -Ref: #add-ons250815 -Node: accounts251430 -Ref: #accounts251553 -Node: activity253528 -Ref: #activity253649 -Node: add254023 -Ref: #add254135 -Node: aregister256996 -Ref: #aregister257119 -Node: aregister and custom posting dates260095 -Ref: #aregister-and-custom-posting-dates260263 -Node: balance260831 -Ref: #balance260959 -Node: balance features261964 -Ref: #balance-features262106 -Node: Simple balance report264236 -Ref: #simple-balance-report264423 -Node: Balance report line format266068 -Ref: #balance-report-line-format266272 -Node: Filtered balance report268522 -Ref: #filtered-balance-report268716 -Node: List or tree mode269043 -Ref: #list-or-tree-mode269213 -Node: Depth limiting270588 -Ref: #depth-limiting270756 -Node: Dropping top-level accounts271373 -Ref: #dropping-top-level-accounts271575 -Node: Showing declared accounts271889 -Ref: #showing-declared-accounts272090 -Node: Sorting by amount272631 -Ref: #sorting-by-amount272800 -Node: Percentages273490 -Ref: #percentages273651 -Node: Multi-period balance report274221 -Ref: #multi-period-balance-report274423 -Node: Balance change end balance276816 -Ref: #balance-change-end-balance277027 -Node: Balance report types278475 -Ref: #balance-report-types278658 -Node: Calculation type279174 -Ref: #calculation-type279331 -Node: Accumulation type279862 -Ref: #accumulation-type280044 -Node: Valuation type280972 -Ref: #valuation-type281162 -Node: Combining balance report types282229 -Ref: #combining-balance-report-types282425 -Node: Budget report284329 -Ref: #budget-report284483 -Node: Budget report start date290217 -Ref: #budget-report-start-date290397 -Node: Budgets and subaccounts291759 -Ref: #budgets-and-subaccounts291968 -Node: Selecting budget goals295454 -Ref: #selecting-budget-goals295655 -Node: Budget vs forecast296702 -Ref: #budget-vs-forecast296863 -Node: Data layout298563 -Ref: #data-layout298715 -Node: Useful balance reports306656 -Ref: #useful-balance-reports306808 -Node: balancesheet307961 -Ref: #balancesheet308108 -Node: balancesheetequity309474 -Ref: #balancesheetequity309634 -Node: cashflow311077 -Ref: #cashflow311210 -Node: check312696 -Ref: #check312810 -Node: Basic checks313616 -Ref: #basic-checks313736 -Node: Strict checks314274 -Ref: #strict-checks314417 -Node: Other checks314858 -Ref: #other-checks315000 -Node: Custom checks315577 -Ref: #custom-checks315734 -Node: More about specific checks316155 -Ref: #more-about-specific-checks316317 -Node: close317049 -Ref: #close317160 -Node: close and costs319798 -Ref: #close-and-costs319942 -Node: close and balance assertions320231 -Ref: #close-and-balance-assertions320433 -Node: Example retain earnings321604 -Ref: #example-retain-earnings321821 -Node: Example migrate balances to a new file322179 -Ref: #example-migrate-balances-to-a-new-file322444 -Node: Example excluding closing/opening transactions322997 -Ref: #example-excluding-closingopening-transactions323246 -Node: codes324424 -Ref: #codes324541 -Node: commodities325417 -Ref: #commodities325553 -Node: descriptions325623 -Ref: #descriptions325760 -Node: diff326051 -Ref: #diff326166 -Node: files327212 -Ref: #files327321 -Node: help327462 -Ref: #help-1327571 -Node: import328561 -Ref: #import328684 -Node: Deduplication329792 -Ref: #deduplication329917 -Node: Import testing331839 -Ref: #import-testing332004 -Node: Importing balance assignments332855 -Ref: #importing-balance-assignments333061 -Node: Commodity display styles333718 -Ref: #commodity-display-styles333891 -Node: incomestatement334020 -Ref: #incomestatement334162 -Node: notes335529 -Ref: #notes335651 -Node: payees336013 -Ref: #payees336128 -Node: prices336653 -Ref: #prices336768 -Node: print337070 -Ref: #print337185 -Node: register342631 -Ref: #register342753 -Node: Custom register output347862 -Ref: #custom-register-output347993 -Node: rewrite349368 -Ref: #rewrite349486 -Node: Re-write rules in a file351398 -Ref: #re-write-rules-in-a-file351561 -Node: Diff output format352714 -Ref: #diff-output-format352897 -Node: rewrite vs print --auto354009 -Ref: #rewrite-vs.-print---auto354171 -Node: roi354745 -Ref: #roi354852 -Node: Spaces and special characters in --inv and --pnl356613 -Ref: #spaces-and-special-characters-in---inv-and---pnl356861 -Node: Semantics of --inv and --pnl357359 -Ref: #semantics-of---inv-and---pnl357606 -Node: IRR and TWR explained359484 -Ref: #irr-and-twr-explained359644 -Node: stats362756 -Ref: #stats362864 -Node: tags364261 -Ref: #tags-1364368 -Node: test365385 -Ref: #test365478 -Node: PART 5 COMMON TASKS366228 -Ref: #part-5-common-tasks366361 -Node: Getting help366635 -Ref: #getting-help366776 -Node: Constructing command lines367540 -Ref: #constructing-command-lines367741 -Node: Starting a journal file368422 -Ref: #starting-a-journal-file368629 -Node: Setting opening balances369827 -Ref: #setting-opening-balances370032 -Node: Recording transactions373185 -Ref: #recording-transactions373374 -Node: Reconciling373930 -Ref: #reconciling374082 -Node: Reporting376395 -Ref: #reporting376544 -Node: Migrating to a new file380533 -Ref: #migrating-to-a-new-file380690 +Node: Commands overview247884 +Ref: #commands-overview248018 +Node: DATA ENTRY248197 +Ref: #data-entry248321 +Node: DATA CREATION248524 +Ref: #data-creation248678 +Node: DATA MANAGEMENT248802 +Ref: #data-management248967 +Node: REPORTS FINANCIAL249092 +Ref: #reports-financial249267 +Node: REPORTS VERSATILE249582 +Ref: #reports-versatile249755 +Node: REPORTS BASIC250016 +Ref: #reports-basic250168 +Node: HELP250701 +Ref: #help250823 +Node: ADD-ONS250882 +Ref: #add-ons250988 +Node: accounts251585 +Ref: #accounts251718 +Node: activity253693 +Ref: #activity253812 +Node: add254186 +Ref: #add254296 +Node: aregister257157 +Ref: #aregister257278 +Node: aregister and custom posting dates260254 +Ref: #aregister-and-custom-posting-dates260420 +Node: balance260988 +Ref: #balance261114 +Node: balance features262119 +Ref: #balance-features262259 +Node: Simple balance report264389 +Ref: #simple-balance-report264574 +Node: Balance report line format266219 +Ref: #balance-report-line-format266421 +Node: Filtered balance report268671 +Ref: #filtered-balance-report268863 +Node: List or tree mode269190 +Ref: #list-or-tree-mode269358 +Node: Depth limiting270733 +Ref: #depth-limiting270899 +Node: Dropping top-level accounts271516 +Ref: #dropping-top-level-accounts271716 +Node: Showing declared accounts272030 +Ref: #showing-declared-accounts272229 +Node: Sorting by amount272770 +Ref: #sorting-by-amount272937 +Node: Percentages273627 +Ref: #percentages273786 +Node: Multi-period balance report274356 +Ref: #multi-period-balance-report274556 +Node: Balance change end balance276949 +Ref: #balance-change-end-balance277158 +Node: Balance report types278606 +Ref: #balance-report-types278787 +Node: Calculation type279303 +Ref: #calculation-type279458 +Node: Accumulation type279989 +Ref: #accumulation-type280169 +Node: Valuation type281097 +Ref: #valuation-type281285 +Node: Combining balance report types282352 +Ref: #combining-balance-report-types282546 +Node: Budget report284450 +Ref: #budget-report284602 +Node: Budget report start date290336 +Ref: #budget-report-start-date290514 +Node: Budgets and subaccounts291876 +Ref: #budgets-and-subaccounts292083 +Node: Selecting budget goals295569 +Ref: #selecting-budget-goals295768 +Node: Budget vs forecast296815 +Ref: #budget-vs-forecast296974 +Node: Data layout298674 +Ref: #data-layout298824 +Node: Useful balance reports306765 +Ref: #useful-balance-reports306915 +Node: balancesheet308068 +Ref: #balancesheet308213 +Node: balancesheetequity309579 +Ref: #balancesheetequity309737 +Node: cashflow311180 +Ref: #cashflow311311 +Node: check312797 +Ref: #check312911 +Node: Basic checks313717 +Ref: #basic-checks313837 +Node: Strict checks314375 +Ref: #strict-checks314518 +Node: Other checks314959 +Ref: #other-checks315101 +Node: Custom checks315678 +Ref: #custom-checks315835 +Node: More about specific checks316256 +Ref: #more-about-specific-checks316418 +Node: close317150 +Ref: #close317261 +Node: close and costs319899 +Ref: #close-and-costs320043 +Node: close and balance assertions320332 +Ref: #close-and-balance-assertions320534 +Node: Example retain earnings321705 +Ref: #example-retain-earnings321922 +Node: Example migrate balances to a new file322280 +Ref: #example-migrate-balances-to-a-new-file322545 +Node: Example excluding closing/opening transactions323098 +Ref: #example-excluding-closingopening-transactions323347 +Node: codes324525 +Ref: #codes324642 +Node: commodities325518 +Ref: #commodities325654 +Node: descriptions325724 +Ref: #descriptions325861 +Node: diff326152 +Ref: #diff326267 +Node: files327313 +Ref: #files327422 +Node: help327563 +Ref: #help-1327672 +Node: import328662 +Ref: #import328785 +Node: Deduplication329893 +Ref: #deduplication330018 +Node: Import testing331940 +Ref: #import-testing332105 +Node: Importing balance assignments332956 +Ref: #importing-balance-assignments333162 +Node: Commodity display styles333819 +Ref: #commodity-display-styles333992 +Node: incomestatement334121 +Ref: #incomestatement334263 +Node: notes335630 +Ref: #notes335752 +Node: payees336114 +Ref: #payees336229 +Node: prices336754 +Ref: #prices336869 +Node: print337171 +Ref: #print337286 +Node: register342732 +Ref: #register342854 +Node: Custom register output347963 +Ref: #custom-register-output348094 +Node: rewrite349469 +Ref: #rewrite349587 +Node: Re-write rules in a file351499 +Ref: #re-write-rules-in-a-file351662 +Node: Diff output format352815 +Ref: #diff-output-format352998 +Node: rewrite vs print --auto354110 +Ref: #rewrite-vs.-print---auto354272 +Node: roi354846 +Ref: #roi354953 +Node: Spaces and special characters in --inv and --pnl356714 +Ref: #spaces-and-special-characters-in---inv-and---pnl356962 +Node: Semantics of --inv and --pnl357460 +Ref: #semantics-of---inv-and---pnl357707 +Node: IRR and TWR explained359585 +Ref: #irr-and-twr-explained359745 +Node: stats362857 +Ref: #stats362965 +Node: tags364362 +Ref: #tags-1364469 +Node: test365486 +Ref: #test365579 +Node: PART 5 COMMON TASKS366329 +Ref: #part-5-common-tasks366462 +Node: Getting help366736 +Ref: #getting-help366877 +Node: Constructing command lines367641 +Ref: #constructing-command-lines367842 +Node: Starting a journal file368523 +Ref: #starting-a-journal-file368730 +Node: Setting opening balances369928 +Ref: #setting-opening-balances370133 +Node: Recording transactions373286 +Ref: #recording-transactions373475 +Node: Reconciling374031 +Ref: #reconciling374183 +Node: Reporting376496 +Ref: #reporting376645 +Node: Migrating to a new file380634 +Ref: #migrating-to-a-new-file380791  End Tag Table diff --git a/hledger/hledger.txt b/hledger/hledger.txt index 33e22bc26..453abcf77 100644 --- a/hledger/hledger.txt +++ b/hledger/hledger.txt @@ -5639,23 +5639,24 @@ Valuation ods). PART 4: COMMANDS + Commands overview Here are the built-in commands: DATA ENTRY These data entry commands are the only ones which can modify your jour- nal file. - o add - add transactions using guided prompts + o add - add transactions using terminal prompts - o import - add any new transactions from other files (eg csv) + o import - add new transactions from other files, eg CSV files DATA CREATION - o close - generate balance-resetting transactions + o close - generate balance-zeroing/restoring transactions - o rewrite - generate extra postings, similar to print --auto + o rewrite - generate auto postings, like print --auto DATA MANAGEMENT - o check - check for various kinds of issue in the data + o check - check for various kinds of error in the data o diff - compare account transactions in two journal files @@ -5671,10 +5672,9 @@ PART 4: COMMANDS o incomestatement (is) - show revenues and expenses REPORTS, VERSATILE - o balance (bal) - show balance changes/end balances/budgets in any - accounts + o balance (bal) - show balance changes, end balances, budgets, gains.. - o print - show transactions (journal entries) + o print - show transactions or export journal data o register (reg) - show postings in one or more accounts & running total @@ -5684,21 +5684,21 @@ PART 4: COMMANDS REPORTS, BASIC o accounts - show account names - o activity - show postings-per-interval bar charts + o activity - show bar charts of posting counts per period o codes - show transaction codes o commodities - show commodity/currency symbols - o descriptions - show unique transaction descriptions + o descriptions - show transaction descriptions o files - show input file paths - o notes - show unique note segments of transaction descriptions + o notes - show note parts of transaction descriptions - o payees - show unique payee segments of transaction descriptions + o payees - show payee parts of transaction descriptions - o prices - show market price records + o prices - show market prices o stats - show journal statistics @@ -5707,7 +5707,7 @@ PART 4: COMMANDS o test - run self tests HELP - o help - show hledger user manuals in several formats + o help - show the hledger manual with info/man/pager ADD-ONS @@ -5715,18 +5715,17 @@ PART 4: COMMANDS by the hledger-install script. If installed, they will appear in hledger's commands list: - o ui - hledger's official terminal UI + o ui - run hledger's terminal UI - o web - hledger's official web UI + o web - run hledger's web UI - o iadd - an alternative to hledger's add command (currently hard to - build) + o iadd - add transactions using a TUI (currently hard to build) - o interest - generates interest transactions + o interest - generate interest transactions - o stockquotes - downloads market prices + o stockquotes - download market prices from AlphaVantage - o Scripts and add-ons - check-fancyassertions, edit, fifo, git, move, + o Scripts and add-ons - check-fancyassertions, edit, fifo, git, move, pijul, plot, and more.. Next, each command is described in detail, in alphabetical order. @@ -5734,38 +5733,38 @@ PART 4: COMMANDS accounts Show account names. - This command lists account names. By default it shows all known - accounts, either used in transactions or declared with account direc- + This command lists account names. By default it shows all known + accounts, either used in transactions or declared with account direc- tives. With query arguments, only matched account names and account names ref- erenced by matched postings are shown. - Or it can show just the used accounts (--used/-u), the declared - accounts (--declared/-d), the accounts declared but not used - (--unused), the accounts used but not declared (--undeclared), or the + Or it can show just the used accounts (--used/-u), the declared + accounts (--declared/-d), the accounts declared but not used + (--unused), the accounts used but not declared (--undeclared), or the first account matched by an account name pattern, if any (--find). - It shows a flat list by default. With --tree, it uses indentation to - show the account hierarchy. In flat mode you can add --drop N to omit - the first few account name components. Account names can be depth- + It shows a flat list by default. With --tree, it uses indentation to + show the account hierarchy. In flat mode you can add --drop N to omit + the first few account name components. Account names can be depth- clipped with depth:N or --depth N or -N. - With --types, it also shows each account's type, if it's known. (See + With --types, it also shows each account's type, if it's known. (See Declaring accounts > Account types.) - With --positions, it also shows the file and line number of each - account's declaration, if any, and the account's overall declaration - order; these may be useful when troubleshooting account display order. + With --positions, it also shows the file and line number of each + account's declaration, if any, and the account's overall declaration + order; these may be useful when troubleshooting account display order. - With --directives, it adds the account keyword, showing valid account - directives which can be pasted into a journal file. This is useful - together with --undeclared when updating your account declarations to + With --directives, it adds the account keyword, showing valid account + directives which can be pasted into a journal file. This is useful + together with --undeclared when updating your account declarations to satisfy hledger check accounts. - The --find flag can be used to look up a single account name, in the - same way that the aregister command does. It returns the alphanumeri- - cally-first matched account name, or if none can be found, it fails + The --find flag can be used to look up a single account name, in the + same way that the aregister command does. It returns the alphanumeri- + cally-first matched account name, or if none can be found, it fails with a non-zero exit code. Examples: @@ -5786,8 +5785,8 @@ PART 4: COMMANDS activity Show an ascii barchart of posting counts per interval. - The activity command displays an ascii histogram showing transaction - counts by day, week, month or other reporting interval (by day is the + The activity command displays an ascii histogram showing transaction + counts by day, week, month or other reporting interval (by day is the default). With query arguments, it counts only matched transactions. Examples: @@ -5799,36 +5798,36 @@ PART 4: COMMANDS 2008-10-01 ** add - Prompt for transactions and add them to the journal. Any arguments + Prompt for transactions and add them to the journal. Any arguments will be used as default inputs for the first N prompts. - Many hledger users edit their journals directly with a text editor, or - generate them from CSV. For more interactive data entry, there is the - add command, which prompts interactively on the console for new trans- - actions, and appends them to the main journal file (which should be in - journal format). Existing transactions are not changed. This is one - of the few hledger commands that writes to the journal file (see also + Many hledger users edit their journals directly with a text editor, or + generate them from CSV. For more interactive data entry, there is the + add command, which prompts interactively on the console for new trans- + actions, and appends them to the main journal file (which should be in + journal format). Existing transactions are not changed. This is one + of the few hledger commands that writes to the journal file (see also import). To use it, just run hledger add and follow the prompts. You can add as - many transactions as you like; when you are finished, enter . or press + many transactions as you like; when you are finished, enter . or press control-d or control-c to exit. Features: - o add tries to provide useful defaults, using the most similar (by - description) recent transaction (filtered by the query, if any) as a + o add tries to provide useful defaults, using the most similar (by + description) recent transaction (filtered by the query, if any) as a template. o You can also set the initial defaults with command line arguments. o Readline-style edit keys can be used during data entry. - o The tab key will auto-complete whenever possible - accounts, pay- - ees/descriptions, dates (yesterday, today, tomorrow). If the input + o The tab key will auto-complete whenever possible - accounts, pay- + ees/descriptions, dates (yesterday, today, tomorrow). If the input area is empty, it will insert the default value. - o If the journal defines a default commodity, it will be added to any + o If the journal defines a default commodity, it will be added to any bare numbers entered. o A parenthesised transaction code may be entered following a date. @@ -5837,7 +5836,7 @@ PART 4: COMMANDS o If you make a mistake, enter < at any prompt to go one step backward. - o Input prompts are displayed in a different colour when the terminal + o Input prompts are displayed in a different colour when the terminal supports it. Example (see https://hledger.org/add.html for a detailed tutorial): @@ -5867,82 +5866,82 @@ PART 4: COMMANDS Starting the next transaction (. or ctrl-D/ctrl-C to quit) Date [2015/05/22]: $ - On Microsoft Windows, the add command makes sure that no part of the + On Microsoft Windows, the add command makes sure that no part of the file path ends with a period, as that would cause problems (#1056). aregister (areg) - Show the transactions and running historical balance of a single + Show the transactions and running historical balance of a single account, with each transaction displayed as one line. aregister shows the overall transactions affecting a particular account - (and any subaccounts). Each report line represents one transaction in - this account. Transactions before the report start date are always + (and any subaccounts). Each report line represents one transaction in + this account. Transactions before the report start date are always included in the running balance (--historical mode is always on). - This is a more "real world", bank-like view than the register command - (which shows individual postings, possibly from multiple accounts, not + This is a more "real world", bank-like view than the register command + (which shows individual postings, possibly from multiple accounts, not necessarily in historical mode). As a quick rule of thumb: - use areg- ister for reviewing and reconciling real-world asset/liability accounts - use register for reviewing detailed revenues/expenses. - aregister requires one argument: the account to report on. You can - write either the full account name, or a case-insensitive regular - expression which will select the alphabetically first matched account. + aregister requires one argument: the account to report on. You can + write either the full account name, or a case-insensitive regular + expression which will select the alphabetically first matched account. When there are multiple matches, the alphabetically-first choice can be - surprising; eg if you have assets:per:checking 1 and assets:biz:check- - ing 2 accounts, hledger areg checking would select assets:biz:checking - 2. It's just a convenience to save typing, so if in doubt, write the + surprising; eg if you have assets:per:checking 1 and assets:biz:check- + ing 2 accounts, hledger areg checking would select assets:biz:checking + 2. It's just a convenience to save typing, so if in doubt, write the full account name, or a distinctive substring that matches uniquely. - Transactions involving subaccounts of this account will also be shown. - aregister ignores depth limits, so its final total will always match a + Transactions involving subaccounts of this account will also be shown. + aregister ignores depth limits, so its final total will always match a balance report with similar arguments. - Any additional arguments form a query which will filter the transac- + Any additional arguments form a query which will filter the transac- tions shown. Note some queries will disturb the running balance, caus- ing it to be different from the account's real-world running balance. - An example: this shows the transactions and historical running balance + An example: this shows the transactions and historical running balance during july, in the first account whose name contains "checking": $ hledger areg checking date:jul Each aregister line item shows: - o the transaction's date (or the relevant posting's date if different, + o the transaction's date (or the relevant posting's date if different, see below) - o the names of all the other account(s) involved in this transaction + o the names of all the other account(s) involved in this transaction (probably abbreviated) o the total change to this account's balance from this transaction o the account's historical running balance after this transaction. - Transactions making a net change of zero are not shown by default; add + Transactions making a net change of zero are not shown by default; add the -E/--empty flag to show them. - For performance reasons, column widths are chosen based on the first - 1000 lines; this means unusually wide values in later lines can cause - visual discontinuities as column widths are adjusted. If you want to - ensure perfect alignment, at the cost of more time and memory, use the + For performance reasons, column widths are chosen based on the first + 1000 lines; this means unusually wide values in later lines can cause + visual discontinuities as column widths are adjusted. If you want to + ensure perfect alignment, at the cost of more time and memory, use the --align-all flag. - This command also supports the output destination and output format + 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 it's the posting date that is shown.) This + 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 it's 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 + 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, it's probably best to assume the running balance is wrong. balance @@ -5950,19 +5949,19 @@ PART 4: COMMANDS Show accounts and their balances. - balance is one of hledger's oldest and most versatile commands, for - listing account balances, balance changes, values, value changes and + balance is one of hledger's oldest and most versatile commands, for + listing account balances, balance changes, values, value changes and more, during one time period or many. Generally it shows a table, with rows representing accounts, and columns representing periods. - Note there are some higher-level variants of the balance command with - convenient defaults, which can be simpler to use: balancesheet, bal- + Note there are some higher-level variants of the balance command with + convenient defaults, which can be simpler to use: balancesheet, bal- ancesheetequity, cashflow and incomestatement. When you need more con- trol, then use balance. balance features - Here's a quick overview of the balance command's features, followed by - more detailed descriptions and examples. Many of these work with the + Here's a quick overview of the balance command's features, followed by + more detailed descriptions and examples. Many of these work with the higher-level commands as well. balance can show.. @@ -6013,7 +6012,7 @@ PART 4: COMMANDS ..with.. - o totals (-T), averages (-A), percentages (-%), inverted sign + o totals (-T), averages (-A), percentages (-%), inverted sign (--invert) o rows and columns swapped (--transpose) @@ -6025,24 +6024,24 @@ PART 4: COMMANDS o commodities displayed on the same line or multiple lines (--layout) This command supports the output destination and output format options, - with output formats txt, csv, json, and (multi-period reports only:) - html. In txt output in a colour-supporting terminal, negative amounts + with output formats txt, csv, json, and (multi-period reports only:) + html. In txt output in a colour-supporting terminal, negative amounts are shown in red. - The --related/-r flag shows the balance of the other postings in the + The --related/-r flag shows the balance of the other postings in the transactions of the postings which would normally be shown. Simple balance report - With no arguments, balance shows a list of all accounts and their - change of balance - ie, the sum of posting amounts, both inflows and - outflows - during the entire period of the journal. ("Simple" here - means just one column of numbers, covering a single period. You can + With no arguments, balance shows a list of all accounts and their + change of balance - ie, the sum of posting amounts, both inflows and + outflows - during the entire period of the journal. ("Simple" here + means just one column of numbers, covering a single period. You can also have multi-period reports, described later.) - For real-world accounts, these numbers will normally be their end bal- + For real-world accounts, these numbers will normally be their end bal- ance at the end of the journal period; more on this below. - Accounts are sorted by declaration order if any, and then alphabeti- + Accounts are sorted by declaration order if any, and then alphabeti- cally by account name. For instance (using examples/sample.journal): $ hledger -f examples/sample.journal bal @@ -6057,7 +6056,7 @@ PART 4: COMMANDS 0 Accounts with a zero balance (and no non-zero subaccounts, in tree mode - - see below) are hidden by default. Use -E/--empty to show them + - see below) are hidden by default. Use -E/--empty to show them (revealing assets:bank:checking here): $ hledger -f examples/sample.journal bal -E @@ -6072,12 +6071,12 @@ PART 4: COMMANDS -------------------- 0 - The total of the amounts displayed is shown as the last line, unless + The total of the amounts displayed is shown as the last line, unless -N/--no-total is used. Balance report line format For single-period balance reports displayed in the terminal (only), you - can use --format FMT to customise the format and content of each line. + can use --format FMT to customise the format and content of each line. Eg: $ hledger -f examples/sample.journal balance --format "%20(account) %12(total)" @@ -6095,7 +6094,7 @@ PART 4: COMMANDS 0 The FMT format string specifies the formatting applied to each - account/balance pair. It may contain any suitable text, with data + account/balance pair. It may contain any suitable text, with data fields interpolated like so: %[MIN][.MAX](FIELDNAME) @@ -6106,14 +6105,14 @@ PART 4: COMMANDS o FIELDNAME must be enclosed in parentheses, and can be one of: - o depth_spacer - a number of spaces equal to the account's depth, or + o depth_spacer - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces. o account - the account's name o total - the account's balance/posted total, right justified - Also, FMT can begin with an optional prefix to control how multi-com- + Also, FMT can begin with an optional prefix to control how multi-com- modity amounts are rendered: o %_ - render on multiple lines, bottom-aligned (the default) @@ -6122,26 +6121,26 @@ PART 4: COMMANDS o %, - render on one line, comma-separated - There are some quirks. Eg in one-line mode, %(depth_spacer) has no - effect, instead %(account) has indentation built in. Experimentation + There are some quirks. Eg in one-line mode, %(depth_spacer) has no + effect, instead %(account) has indentation built in. Experimentation may be needed to get pleasing results. Some example formats: o %(total) - the account's total - o %-20.20(account) - the account's name, left justified, padded to 20 + o %-20.20(account) - the account's name, left justified, padded to 20 characters and clipped at 20 characters - o %,%-50(account) %25(total) - account name padded to 50 characters, - total padded to 20 characters, with multiple commodities rendered on + o %,%-50(account) %25(total) - account name padded to 50 characters, + total padded to 20 characters, with multiple commodities rendered on one line - o %20(total) %2(depth_spacer)%-(account) - the default format for the + o %20(total) %2(depth_spacer)%-(account) - the default format for the single-column balance report Filtered balance report - You can show fewer accounts, a different time period, totals from + You can show fewer accounts, a different time period, totals from cleared transactions only, etc. by using query arguments or options to limit the postings being matched. Eg: @@ -6151,10 +6150,10 @@ PART 4: COMMANDS $-2 List or tree mode - By default, or with -l/--flat, accounts are shown as a flat list with + By default, or with -l/--flat, accounts are shown as a flat list with their full names visible, as in the examples above. - With -t/--tree, the account hierarchy is shown, with subaccounts' + With -t/--tree, the account hierarchy is shown, with subaccounts' "leaf" names indented below their parent: $ hledger -f examples/sample.journal balance @@ -6174,26 +6173,26 @@ PART 4: COMMANDS Notes: o "Boring" accounts are combined with their subaccount for more compact - output, unless --no-elide is used. Boring accounts have no balance - of their own and just one subaccount (eg assets:bank and liabilities + output, unless --no-elide is used. Boring accounts have no balance + of their own and just one subaccount (eg assets:bank and liabilities above). - o All balances shown are "inclusive", ie including the balances from - all subaccounts. Note this means some repetition in the output, + o All balances shown are "inclusive", ie including the balances from + all subaccounts. Note this means some repetition in the output, which requires explanation when sharing reports with non-plaintextac- - counting-users. A tree mode report's final total is the sum of the + counting-users. A tree mode report's final total is the sum of the top-level balances shown, not of all the balances shown. - o Each group of sibling accounts (ie, under a common parent) is sorted + o Each group of sibling accounts (ie, under a common parent) is sorted separately. Depth limiting - With a depth:NUM query, or --depth NUM option, or just -NUM (eg: -3) - balance reports will show accounts only to the specified depth, hiding - the deeper subaccounts. This can be useful for getting an overview + With a depth:NUM query, or --depth NUM option, or just -NUM (eg: -3) + balance reports will show accounts only to the specified depth, hiding + the deeper subaccounts. This can be useful for getting an overview without too much detail. - Account balances at the depth limit always include the balances from + Account balances at the depth limit always include the balances from any deeper subaccounts (even in list mode). Eg, limiting to depth 1: $ hledger -f examples/sample.journal balance -1 @@ -6205,7 +6204,7 @@ PART 4: COMMANDS 0 Dropping top-level accounts - You can also hide one or more top-level account name parts, using + You can also hide one or more top-level account name parts, using --drop NUM. This can be useful for hiding repetitive top-level account names: @@ -6217,54 +6216,54 @@ PART 4: COMMANDS Showing declared accounts - With --declared, accounts which have been declared with an account - directive will be included in the balance report, even if they have no + With --declared, accounts which have been declared with an account + directive will be included in the balance report, even if they have no transactions. (Since they will have a zero balance, you will also need -E/--empty to see them.) - More precisely, leaf declared accounts (with no subaccounts) will be + More precisely, leaf declared accounts (with no subaccounts) will be included, since those are usually the more useful in reports. - The idea of this is to be able to see a useful "complete" balance - report, even when you don't have transactions in all of your declared + The idea of this is to be able to see a useful "complete" balance + report, even when you don't have transactions in all of your declared accounts yet. Sorting by amount - With -S/--sort-amount, accounts with the largest (most positive) bal- - ances are shown first. Eg: hledger bal expenses -MAS shows your big- - gest averaged monthly expenses first. When more than one commodity is - present, they will be sorted by the alphabetically earliest commodity - first, and then by subsequent commodities (if an amount is missing a + With -S/--sort-amount, accounts with the largest (most positive) bal- + ances are shown first. Eg: hledger bal expenses -MAS shows your big- + gest averaged monthly expenses first. When more than one commodity is + present, they will be sorted by the alphabetically earliest commodity + first, and then by subsequent commodities (if an amount is missing a commodity, it is treated as 0). - Revenues and liability balances are typically negative, however, so -S - shows these in reverse order. To work around this, you can add - --invert to flip the signs. (Or, use one of the higher-level reports, - which flip the sign automatically. Eg: hledger incomestatement -MAS). + Revenues and liability balances are typically negative, however, so -S + shows these in reverse order. To work around this, you can add + --invert to flip the signs. (Or, use one of the higher-level reports, + which flip the sign automatically. Eg: hledger incomestatement -MAS). Percentages - With -%/--percent, balance reports show each account's value expressed + With -%/--percent, balance reports show each account's value expressed as a percentage of the (column) total. Note it is not useful to calculate percentages if the amounts in a col- - umn have mixed signs. In this case, make a separate report for each + umn have mixed signs. In this case, make a separate report for each sign, eg: $ hledger bal -% amt:`>0` $ hledger bal -% amt:`<0` - Similarly, if the amounts in a column have mixed commodities, convert - them to one commodity with -B, -V, -X or --value, or make a separate + Similarly, if the amounts in a column have mixed commodities, convert + them to one commodity with -B, -V, -X or --value, or make a separate report for each commodity: $ hledger bal -% cur:\\$ $ hledger bal -% cur:EUR Multi-period balance report - With a report interval (set by the -D/--daily, -W/--weekly, - -M/--monthly, -Q/--quarterly, -Y/--yearly, or -p/--period flag), bal- - ance shows a tabular report, with columns representing successive time + With a report interval (set by the -D/--daily, -W/--weekly, + -M/--monthly, -Q/--quarterly, -Y/--yearly, or -p/--period flag), bal- + ance shows a tabular report, with columns representing successive time periods (and a title): $ hledger -f examples/sample.journal bal --quarterly income expenses -E @@ -6285,21 +6284,21 @@ PART 4: COMMANDS encompass the displayed subperiods (so that the first and last subpe- riods have the same duration as the others). - o Leading and trailing periods (columns) containing all zeroes are not + o Leading and trailing periods (columns) containing all zeroes are not shown, unless -E/--empty is used. - o Accounts (rows) containing all zeroes are not shown, unless + o Accounts (rows) containing all zeroes are not shown, unless -E/--empty is used. - o Amounts with many commodities are shown in abbreviated form, unless + o Amounts with many commodities are shown in abbreviated form, unless --no-elide is used. (experimental) - o Average and/or total columns can be added with the -A/--average and + o Average and/or total columns can be added with the -A/--average and -T/--row-total flags. o The --transpose flag can be used to exchange rows and columns. - o The --pivot FIELD option causes a different transaction field to be + o The --pivot FIELD option causes a different transaction field to be used as "account name". See PIVOTING. Multi-period reports with many periods can be too wide for easy viewing @@ -6313,57 +6312,57 @@ PART 4: COMMANDS o Reduce the terminal's font size - o View with a pager like less, eg: hledger bal -D --color=yes | less + o View with a pager like less, eg: hledger bal -D --color=yes | less -RS - o Output as CSV and use a CSV viewer like visidata (hledger bal -D -O - csv | vd -f csv), Emacs' csv-mode (M-x csv-mode, C-c C-a), or a + o Output as CSV and use a CSV viewer like visidata (hledger bal -D -O + csv | vd -f csv), Emacs' csv-mode (M-x csv-mode, C-c C-a), or a spreadsheet (hledger bal -D -o a.csv && open a.csv) - o Output as HTML and view with a browser: hledger bal -D -o a.html && + o Output as HTML and view with a browser: hledger bal -D -o a.html && open a.html Balance change, end balance - It's important to be clear on the meaning of the numbers shown in bal- + It's important to be clear on the meaning of the numbers shown in bal- ance reports. Here is some terminology we use: - A balance change is the net amount added to, or removed from, an + A balance change is the net amount added to, or removed from, an account during some period. - An end balance is the amount accumulated in an account as of some date - (and some time, but hledger doesn't store that; assume end of day in + An end balance is the amount accumulated in an account as of some date + (and some time, but hledger doesn't store that; assume end of day in your timezone). It is the sum of previous balance changes. - We call it a historical end balance if it includes all balance changes + We call it a historical end balance if it includes all balance changes since the account was created. For a real world account, this means it - will match the "historical record", eg the balances reported in your + will match the "historical record", eg the balances reported in your bank statements or bank web UI. (If they are correct!) - In general, balance changes are what you want to see when reviewing + In general, balance changes are what you want to see when reviewing revenues and expenses, and historical end balances are what you want to see when reviewing or reconciling asset, liability and equity accounts. - balance shows balance changes by default. To see accurate historical + balance shows balance changes by default. To see accurate historical end balances: - 1. Initialise account starting balances with an "opening balances" - transaction (a transfer from equity to the account), unless the + 1. Initialise account starting balances with an "opening balances" + transaction (a transfer from equity to the account), unless the journal covers the account's full lifetime. 2. Include all of of the account's prior postings in the report, by not - specifying a report start date, or by using the -H/--historical + specifying a report start date, or by using the -H/--historical flag. (-H causes report start date to be ignored when summing post- ings.) Balance report types - The balance command is quite flexible; here is the full detail on how - to control what it reports. If the following seems complicated, don't + The balance command is quite flexible; here is the full detail on how + to control what it reports. If the following seems complicated, don't worry - this is for advanced reporting, and it does typically take some time and experimentation to get clear on all these report modes. There are three important option groups: - hledger balance [CALCULATIONTYPE] [ACCUMULATIONTYPE] [VALUATIONTYPE] + hledger balance [CALCULATIONTYPE] [ACCUMULATIONTYPE] [VALUATIONTYPE] ... Calculation type @@ -6375,44 +6374,44 @@ PART 4: COMMANDS each account/period) o --valuechange : show the change in period-end historical balance val- - ues (caused by deposits, withdrawals, and/or market price fluctua- + ues (caused by deposits, withdrawals, and/or market price fluctua- tions) - o --gain : show the unrealised capital gain/loss, (the current valued + o --gain : show the unrealised capital gain/loss, (the current valued balance minus each amount's original cost) Accumulation type - How amounts should accumulate across report periods. Another way to - say it: which time period's postings should contribute to each cell's + How amounts should accumulate across report periods. Another way to + say it: which time period's postings should contribute to each cell's calculation. It is one of: - o --change : calculate with postings from column start to column end, - ie "just this column". Typically used to see revenues/expenses. + o --change : calculate with postings from column start to column end, + ie "just this column". Typically used to see revenues/expenses. (default for balance, incomestatement) - o --cumulative : calculate with postings from report start to column - end, ie "previous columns plus this column". Typically used to show + o --cumulative : calculate with postings from report start to column + end, ie "previous columns plus this column". Typically used to show changes accumulated since the report's start date. Not often used. - o --historical/-H : calculate with postings from journal start to col- - umn end, ie "all postings from before report start date until this - column's end". Typically used to see historical end balances of + o --historical/-H : calculate with postings from journal start to col- + umn end, ie "all postings from before report start date until this + column's end". Typically used to see historical end balances of assets/liabilities/equity. (default for balancesheet, balancesheete- quity, cashflow) Valuation type - Which kind of value or cost conversion should be applied, if any, + Which kind of value or cost conversion should be applied, if any, before displaying the report. It is one of: o no valuation type : don't convert to cost or value (default) - o --value=cost[,COMM] : convert amounts to cost (then optionally to + o --value=cost[,COMM] : convert amounts to cost (then optionally to some other commodity) - o --value=then[,COMM] : convert amounts to market value on transaction + o --value=then[,COMM] : convert amounts to market value on transaction dates - o --value=end[,COMM] : convert amounts to market value on period end + o --value=end[,COMM] : convert amounts to market value on period end date(s) (default with --valuechange, --gain) @@ -6423,7 +6422,7 @@ PART 4: COMMANDS or one of the equivalent simpler flags: - o -B/--cost : like --value=cost (though, note --cost and --value are + o -B/--cost : like --value=cost (though, note --cost and --value are independent options which can both be used at once) o -V/--market : like --value=end @@ -6433,13 +6432,13 @@ PART 4: COMMANDS See Cost reporting and Valuation for more about these. Combining balance report types - Most combinations of these options should produce reasonable reports, - but if you find any that seem wrong or misleading, let us know. The + Most combinations of these options should produce reasonable reports, + but if you find any that seem wrong or misleading, let us know. The following restrictions are applied: o --valuechange implies --value=end - o --valuechange makes --change the default when used with the bal- + o --valuechange makes --change the default when used with the bal- ancesheet/balancesheetequity commands o --cumulative or --historical disables --row-total/-T @@ -6454,26 +6453,26 @@ PART 4: COMMANDS lation:v ----------------------------------------------------------------------------------- --change change in period sum of posting- period-end DATE-value of - date market val- value of change change in + date market val- value of change change in ues in period in period period --cumu- change from sum of posting- period-end DATE-value of - lative report start to date market val- value of change change from + lative report start to date market val- value of change change from period end ues from report from report report start start to period start to period to period end end end --his- change from sum of posting- period-end DATE-value of - torical journal start to date market val- value of change change from - /-H period end (his- ues from journal from journal journal start + torical journal start to date market val- value of change change from + /-H period end (his- ues from journal from journal journal start torical end bal- start to period start to period to period end ance) end end Budget report - The --budget report type activates extra columns showing any budget - goals for each account and period. The budget goals are defined by + The --budget report type activates extra columns showing any budget + goals for each account and period. The budget goals are defined by periodic transactions. This is useful for comparing planned and actual income, expenses, time usage, etc. - For example, you can take average monthly expenses in the common + For example, you can take average monthly expenses in the common expense categories to construct a minimal monthly budget: ;; Budget @@ -6520,26 +6519,26 @@ PART 4: COMMANDS This is different from a normal balance report in several ways: - o Only accounts with budget goals during the report period are shown, + o Only accounts with budget goals during the report period are shown, by default. - o In each column, in square brackets after the actual amount, budget - goal amounts are shown, and the actual/goal percentage. (Note: bud- + o In each column, in square brackets after the actual amount, budget + goal amounts are shown, and the actual/goal percentage. (Note: bud- get goals should be in the same commodity as the actual amount.) - o All parent accounts are always shown, even in list mode. Eg assets, + o All parent accounts are always shown, even in list mode. Eg assets, assets:bank, and expenses above. - o Amounts always include all subaccounts, budgeted or unbudgeted, even + o Amounts always include all subaccounts, budgeted or unbudgeted, even in list mode. - This means that the numbers displayed will not always add up! Eg - above, the expenses actual amount includes the gifts and supplies + This means that the numbers displayed will not always add up! Eg + above, the expenses actual amount includes the gifts and supplies transactions, but the expenses:gifts and expenses:supplies accounts are not shown, as they have no budget amounts declared. - This can be confusing. When you need to make things clearer, use the - -E/--empty flag, which will reveal all accounts including unbudgeted + This can be confusing. When you need to make things clearer, use the + -E/--empty flag, which will reveal all accounts including unbudgeted ones, giving the full picture. Eg: $ hledger balance -M --budget --empty @@ -6586,19 +6585,19 @@ PART 4: COMMANDS hledger bal -M --budget type:rx - It's also common to limit or convert them to a single currency - (cur:COMM or -X COMM [--infer-market-prices]). If showing multiple + It's also common to limit or convert them to a single currency + (cur:COMM or -X COMM [--infer-market-prices]). If showing multiple currencies, --layout bare or --layout tall can help. For more examples and notes, see Budgeting. Budget report start date - This might be a bug, but for now: when making budget reports, it's a + This might be a bug, but for now: when making budget reports, it's a good idea to explicitly set the report's start date to the first day of - a reporting period, because a periodic rule like ~ monthly generates - its transactions on the 1st of each month, and if your journal has no - regular transactions on the 1st, the default report start date could - exclude that budget goal, which can be a little surprising. Eg here + a reporting period, because a periodic rule like ~ monthly generates + its transactions on the 1st of each month, and if your journal has no + regular transactions on the 1st, the default report start date could + exclude that budget goal, which can be a little surprising. Eg here the default report period is just the day of 2020-01-15: ~ monthly in 2020 @@ -6617,9 +6616,9 @@ PART 4: COMMANDS --------------++------------ || $400 - To avoid this, specify the budget report's period, or at least the - start date, with -b/-e/-p/date:, to ensure it includes the budget goal - transactions (periodic transactions) that you want. Eg, adding -b + To avoid this, specify the budget report's period, or at least the + start date, with -b/-e/-p/date:, to ensure it includes the budget goal + transactions (periodic transactions) that you want. Eg, adding -b 2020/1/1 to the above: $ hledger bal expenses --budget -b 2020/1/1 @@ -6632,12 +6631,12 @@ PART 4: COMMANDS || $400 [80% of $500] Budgets and subaccounts - You can add budgets to any account in your account hierarchy. If you + You can add budgets to any account in your account hierarchy. If you have budgets on both parent account and some of its children, then bud- - get(s) of the child account(s) would be added to the budget of their + get(s) of the child account(s) would be added to the budget of their parent, much like account balances behave. - In the most simple case this means that once you add a budget to any + In the most simple case this means that once you add a budget to any account, all its parents would have budget as well. To illustrate this, consider the following budget: @@ -6647,13 +6646,13 @@ PART 4: COMMANDS expenses:personal:electronics $100.00 liabilities - With this, monthly budget for electronics is defined to be $100 and - budget for personal expenses is an additional $1000, which implicitly + With this, monthly budget for electronics is defined to be $100 and + budget for personal expenses is an additional $1000, which implicitly means that budget for both expenses:personal and expenses is $1100. - Transactions in expenses:personal:electronics will be counted both - towards its $100 budget and $1100 of expenses:personal , and transac- - tions in any other subaccount of expenses:personal would be counted + Transactions in expenses:personal:electronics will be counted both + towards its $100 budget and $1100 of expenses:personal , and transac- + tions in any other subaccount of expenses:personal would be counted towards only towards the budget of expenses:personal. For example, let's consider these transactions: @@ -6679,9 +6678,9 @@ PART 4: COMMANDS expenses:personal $30.00 liabilities - As you can see, we have transactions in expenses:personal:electron- - ics:upgrades and expenses:personal:train tickets, and since both of - these accounts are without explicitly defined budget, these transac- + As you can see, we have transactions in expenses:personal:electron- + ics:upgrades and expenses:personal:train tickets, and since both of + these accounts are without explicitly defined budget, these transac- tions would be counted towards budgets of expenses:personal:electronics and expenses:personal accordingly: @@ -6697,7 +6696,7 @@ PART 4: COMMANDS -------------------------------++------------------------------- || 0 [ 0] - And with --empty, we can get a better picture of budget allocation and + And with --empty, we can get a better picture of budget allocation and consumption: $ hledger balance --budget -M --empty @@ -6716,65 +6715,65 @@ PART 4: COMMANDS Selecting budget goals The budget report evaluates periodic transaction rules to generate spe- - cial "goal transactions", which generate the goal amounts for each - account in each report subperiod. When troubleshooting, you can use + cial "goal transactions", which generate the goal amounts for each + account in each report subperiod. When troubleshooting, you can use print --forecast to show these as forecasted transactions: $ hledger print --forecast=BUDGETREPORTPERIOD tag:generated - By default, the budget report uses all available periodic transaction - rules to generate goals. This includes rules with a different report - interval from your report. Eg if you have daily, weekly and monthly - periodic rules, all of these will contribute to the goals in a monthly + By default, the budget report uses all available periodic transaction + rules to generate goals. This includes rules with a different report + interval from your report. Eg if you have daily, weekly and monthly + periodic rules, all of these will contribute to the goals in a monthly budget report. - You can select a subset of periodic rules by providing an argument to - the --budget flag. --budget=DESCPAT will match all periodic rules + You can select a subset of periodic rules by providing an argument to + the --budget flag. --budget=DESCPAT will match all periodic rules whose description contains DESCPAT, a case-insensitive substring (not a - regular expression or query). This means you can give your periodic - rules descriptions (remember that two spaces are needed), and then + regular expression or query). This means you can give your periodic + rules descriptions (remember that two spaces are needed), and then select from multiple budgets defined in your journal. Budget vs forecast - hledger --forecast ... and hledger balance --budget ... are separate - features, though both of them use the periodic transaction rules - defined in the journal, and both of them generate temporary transac- - tions for reporting purposes ("forecast transactions" and "budget goal - transactions", respectively). You can use both features at the same - time if you want. Here are some differences between them, as of + hledger --forecast ... and hledger balance --budget ... are separate + features, though both of them use the periodic transaction rules + defined in the journal, and both of them generate temporary transac- + tions for reporting purposes ("forecast transactions" and "budget goal + transactions", respectively). You can use both features at the same + time if you want. Here are some differences between them, as of hledger 1.29: CLI: o --forecast is a general hledger option, usable with any command - o --budget is a balance command option, usable only with that command. + o --budget is a balance command option, usable only with that command. Visibility of generated transactions: o forecast transactions are visible in any report, like ordinary trans- actions - o budget goal transactions are invisible except for the goal amounts + o budget goal transactions are invisible except for the goal amounts they produce in --budget reports. Periodic transaction rules: o --forecast uses all available periodic transaction rules - o --budget uses all periodic rules (--budget) or a selected subset + o --budget uses all periodic rules (--budget) or a selected subset (--budget=DESCPAT) Period of generated transactions: o --forecast generates forecast transactions - o from after the last regular transaction to the end of the report + o from after the last regular transaction to the end of the report period (--forecast) o or, during a specified period (--forecast=PERIODEXPR) - o possibly further restricted by a period specified in the periodic + o possibly further restricted by a period specified in the periodic transaction rule o and always restricted within the bounds of the report period @@ -6783,12 +6782,12 @@ PART 4: COMMANDS o throughout the report period - o possibly restricted by a period specified in the periodic transac- + o possibly restricted by a period specified in the periodic transac- tion rule. Data layout - The --layout option affects how balance reports show multi-commodity - amounts and commodity symbols, which can improve readability. It can + The --layout option affects how balance reports show multi-commodity + amounts and commodity symbols, which can improve readability. It can also normalise the data for easy consumption by other programs. It has four possible values: @@ -6800,10 +6799,10 @@ PART 4: COMMANDS o --layout=bare: commodity symbols are in their own column, amounts are bare numbers - o --layout=tidy: data is normalised to easily-consumed "tidy" form, + o --layout=tidy: data is normalised to easily-consumed "tidy" form, with one row per data value - Here are the --layout modes supported by each output format; note only + Here are the --layout modes supported by each output format; note only CSV output supports all of them: @@ -6827,7 +6826,7 @@ PART 4: COMMANDS ------------------++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || 10.00 ITOT, 337.18 USD, 12.00 VEA, 106.00 VHT 70.00 GLD, 18.00 ITOT, -98.12 USD, 10.00 VEA, 18.00 VHT -11.00 ITOT, 4881.44 USD, 14.00 VEA, 170.00 VHT 70.00 GLD, 17.00 ITOT, 5120.50 USD, 36.00 VEA, 294.00 VHT - o Limited wide layout. A width limit reduces the width, but some com- + o Limited wide layout. A width limit reduces the width, but some com- modities will be hidden: $ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -T -Y --layout=wide,32 @@ -6839,7 +6838,7 @@ PART 4: COMMANDS ------------------++--------------------------------------------------------------------------------------------------------------------------- || 10.00 ITOT, 337.18 USD, 2 more.. 70.00 GLD, 18.00 ITOT, 3 more.. -11.00 ITOT, 3 more.. 70.00 GLD, 17.00 ITOT, 3 more.. - o Tall layout. Each commodity gets a new line (may be different in + o Tall layout. Each commodity gets a new line (may be different in each column), and account names are repeated: $ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -T -Y --layout=tall @@ -6859,7 +6858,7 @@ PART 4: COMMANDS || 106.00 VHT 10.00 VEA 170.00 VHT 36.00 VEA || 18.00 VHT 294.00 VHT - o Bare layout. Commodity symbols are kept in one column, each commod- + o Bare layout. Commodity symbols are kept in one column, each commod- ity gets its own report row, account names are repeated: $ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -T -Y --layout=bare @@ -6879,7 +6878,7 @@ PART 4: COMMANDS || VEA 12.00 10.00 14.00 36.00 || VHT 106.00 18.00 170.00 294.00 - o Bare layout also affects CSV output, which is useful for producing + o Bare layout also affects CSV output, which is useful for producing data that is easier to consume, eg for making charts: $ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -O csv --layout=bare @@ -6896,7 +6895,7 @@ PART 4: COMMANDS "total","VHT","294.00" o Tidy layout produces normalised "tidy data", where every variable has - its own column and each row represents a single data point. See + its own column and each row represents a single data point. See https://cran.r-project.org/web/packages/tidyr/vignettes/tidy- data.html for more. This is the easiest kind of data for other soft- ware to consume. Here's how it looks: @@ -6923,25 +6922,25 @@ PART 4: COMMANDS Some frequently used balance options/reports are: o bal -M revenues expenses - Show revenues/expenses in each month. Also available as the incomes- + Show revenues/expenses in each month. Also available as the incomes- tatement command. o bal -M -H assets liabilities - Show historical asset/liability balances at each month end. Also + Show historical asset/liability balances at each month end. Also available as the balancesheet command. o bal -M -H assets liabilities equity - Show historical asset/liability/equity balances at each month end. + Show historical asset/liability/equity balances at each month end. Also available as the balancesheetequity command. o bal -M assets not:receivable - Show changes to liquid assets in each month. Also available as the + Show changes to liquid assets in each month. Also available as the cashflow command. Also: o bal -M expenses -2 -SA - Show monthly expenses summarised to depth 2 and sorted by average + Show monthly expenses summarised to depth 2 and sorted by average amount. o bal -M --budget expenses @@ -6957,14 +6956,14 @@ PART 4: COMMANDS balancesheet (bs) - This command displays a balance sheet, showing historical ending bal- + This command displays a balance sheet, showing historical ending bal- ances of asset and liability accounts. (To see equity as well, use the - balancesheetequity command.) Amounts are shown with normal positive + balancesheetequity command.) Amounts are shown with normal positive sign, as in conventional financial statements. - This report shows accounts declared with the Asset, Cash or Liability - type (see account types). Or if no such accounts are declared, it - shows top-level accounts named asset or liability (case insensitive, + This report shows accounts declared with the Asset, Cash or Liability + type (see account types). Or if no such accounts are declared, it + shows top-level accounts named asset or liability (case insensitive, plurals allowed) and their subaccounts. Example: @@ -6989,25 +6988,25 @@ PART 4: COMMANDS 0 This command is a higher-level variant of the balance command, and sup- - ports many of that command's features, such as multi-period reports. - It is similar to hledger balance -H assets liabilities, but with - smarter account detection, and liabilities displayed with their sign + ports many of that command's features, such as multi-period reports. + It is similar to hledger balance -H assets liabilities, but with + smarter account detection, and liabilities displayed with their sign flipped. - This command also supports the output destination and output format - options The output formats supported are txt, csv, html, and (experi- + This command also supports the output destination and output format + options The output formats supported are txt, csv, html, and (experi- mental) json. balancesheetequity (bse) - This command displays a balance sheet, showing historical ending bal- - ances of asset, liability and equity accounts. Amounts are shown with + This command displays a balance sheet, showing historical ending bal- + ances of asset, liability and equity accounts. Amounts are shown with normal positive sign, as in conventional financial statements. - This report shows accounts declared with the Asset, Cash, Liability or - Equity type (see account types). Or if no such accounts are declared, - it shows top-level accounts named asset, liability or equity (case + This report shows accounts declared with the Asset, Cash, Liability or + Equity type (see account types). Or if no such accounts are declared, + it shows top-level accounts named asset, liability or equity (case insensitive, plurals allowed) and their subaccounts. Example: @@ -7037,32 +7036,32 @@ PART 4: COMMANDS 0 This command is a higher-level variant of the balance command, and sup- - ports many of that command's features, such as multi-period reports. + ports many of that command's features, such as multi-period reports. It is similar to hledger balance -H assets liabilities equity, but with - smarter account detection, and liabilities/equity displayed with their + smarter account detection, and liabilities/equity displayed with their sign flipped. - This command also supports the output destination and output format - options The output formats supported are txt, csv, html, and (experi- + This command also supports the output destination and output format + options The output formats supported are txt, csv, html, and (experi- mental) json. cashflow (cf) - This command displays a cashflow statement, showing the inflows and - outflows affecting "cash" (ie, liquid, easily convertible) assets. - Amounts are shown with normal positive sign, as in conventional finan- + This command displays a cashflow statement, showing the inflows and + outflows affecting "cash" (ie, liquid, easily convertible) assets. + Amounts are shown with normal positive sign, as in conventional finan- cial statements. - This report shows accounts declared with the Cash type (see account + This report shows accounts declared with the Cash type (see account types). Or if no such accounts are declared, it shows accounts - o under a top-level account named asset (case insensitive, plural + o under a top-level account named asset (case insensitive, plural allowed) o whose name contains some variation of cash, bank, checking or saving. - More precisely: all accounts matching this case insensitive regular + More precisely: all accounts matching this case insensitive regular expression: ^assets?(:.+)?:(cash|bank|che(ck|que?)(ing)?|savings?|currentcash)(:|$) @@ -7086,21 +7085,21 @@ PART 4: COMMANDS $-1 This command is a higher-level variant of the balance command, and sup- - ports many of that command's features, such as multi-period reports. - It is similar to hledger balance assets not:fixed not:investment + ports many of that command's features, such as multi-period reports. + It is similar to hledger balance assets not:fixed not:investment not:receivable, but with smarter account detection. - This command also supports the output destination and output format - options The output formats supported are txt, csv, html, and (experi- + This command also supports the output destination and output format + options The output formats supported are txt, csv, html, and (experi- mental) json. check Check for various kinds of errors in your data. - hledger provides a number of built-in error checks to help prevent - problems in your data. Some of these are run automatically; or, you - can use this check command to run them on demand, with no output and a - zero exit code if all is well. Specify their names (or a prefix) as + hledger provides a number of built-in error checks to help prevent + problems in your data. Some of these are run automatically; or, you + can use this check command to run them on demand, with no output and a + zero exit code if all is well. Specify their names (or a prefix) as argument(s). Some examples: @@ -7109,7 +7108,7 @@ PART 4: COMMANDS hledger check -s # basic + strict checks hledger check ordereddates payees # basic + two other checks - If you are an Emacs user, you can also configure flycheck-hledger to + If you are an Emacs user, you can also configure flycheck-hledger to run these checks, providing instant feedback as you edit the journal. Here are the checks currently available: @@ -7121,34 +7120,34 @@ PART 4: COMMANDS o parseable - data files are well-formed and can be successfully parsed o balancedwithautoconversion - all transactions are balanced, inferring - missing amounts where necessary, and possibly converting commodities + missing amounts where necessary, and possibly converting commodities using costs or automatically-inferred costs - o assertions - all balance assertions in the journal are passing. + o assertions - all balance assertions in the journal are passing. (This check can be disabled with -I/--ignore-assertions.) Strict checks These additional checks are run when the -s/--strict (strict mode) flag - is used. Or, they can be run by giving their names as arguments to + is used. Or, they can be run by giving their names as arguments to check: o accounts - all account names used by transactions have been declared o commodities - all commodity symbols used have been declared - o balancednoautoconversion - transactions are balanced, possibly using + o balancednoautoconversion - transactions are balanced, possibly using explicit costs but not inferred ones Other checks - These checks can be run only by giving their names as arguments to - check. They are more specialised and not desirable for everyone, + These checks can be run only by giving their names as arguments to + check. They are more specialised and not desirable for everyone, therefore optional: o ordereddates - transactions are ordered by date within each file o payees - all payees used by transactions have been declared - o recentassertions - all accounts with balance assertions have a bal- + o recentassertions - all accounts with balance assertions have a bal- ance assertion no more than 7 days before their latest posting o tags - all tags used by transactions have been declared @@ -7156,110 +7155,110 @@ PART 4: COMMANDS o uniqueleafnames - all account leaf names are unique Custom checks - A few more checks are are available as separate add-on commands, in + A few more checks are are available as separate add-on commands, in https://github.com/simonmichael/hledger/tree/master/bin: - o hledger-check-tagfiles - all tag values containing / (a forward + o hledger-check-tagfiles - all tag values containing / (a forward slash) exist as file paths - o hledger-check-fancyassertions - more complex balance assertions are + o hledger-check-fancyassertions - more complex balance assertions are passing You could make similar scripts to perform your own custom checks. See: Cookbook -> Scripting. More about specific checks - hledger check recentassertions will complain if any balance-asserted + hledger check recentassertions will complain if any balance-asserted account does not have a balance assertion within 7 days before its lat- - est posting. This aims to prevent the situation where you are regu- - larly updating your journal, but forgetting to check your balances - against the real world, then one day must dig back through months of - data to find an error. It assumes that adding a balance assertion - requires/reminds you to check the real-world balance. That may not be - true if you auto-generate balance assertions from bank data; in that - case, I recommend to import transactions uncleared, then use the man- - ual-review-and-mark-cleared phase as a reminder to check the latest + est posting. This aims to prevent the situation where you are regu- + larly updating your journal, but forgetting to check your balances + against the real world, then one day must dig back through months of + data to find an error. It assumes that adding a balance assertion + requires/reminds you to check the real-world balance. That may not be + true if you auto-generate balance assertions from bank data; in that + case, I recommend to import transactions uncleared, then use the man- + ual-review-and-mark-cleared phase as a reminder to check the latest assertions against real-world balances. close close [--retain | --migrate | --open] [QUERY] - By default: prints a transaction that zeroes out ("closes") all - accounts, transferring their balances to an equity account. Query + By default: prints a transaction that zeroes out ("closes") all + accounts, transferring their balances to an equity account. Query arguments can be added to override the accounts selection. Three other modes are supported: - --retain: prints a transaction closing revenue and expense balances. - This is traditionally done by businesses at the end of each accounting + --retain: prints a transaction closing revenue and expense balances. + This is traditionally done by businesses at the end of each accounting period; it is less necessary in personal and computer-based accounting, but it can help balance the accounting equation A=L+E. - --migrate: prints a transaction to close asset, liability and most - equity balances, and another transaction to re-open them. This can be - useful when starting a new file (for performance or data protection). + --migrate: prints a transaction to close asset, liability and most + equity balances, and another transaction to re-open them. This can be + useful when starting a new file (for performance or data protection). Adding the closing transaction to the old file allows old and new files to be combined. --open: as above, but prints just the opening transaction. This can be - useful for starting a new file, leaving the old file unchanged. Simi- + useful for starting a new file, leaving the old file unchanged. Simi- lar to Ledger's equity command. - You can change the equity account name with --close-acct ACCT. It - defaults to equity:retained earnings with --retain, or equity:open- + You can change the equity account name with --close-acct ACCT. It + defaults to equity:retained earnings with --retain, or equity:open- ing/closing balances otherwise. - You can change the transaction description(s) with --close-desc 'DESC' - and --open-desc 'DESC'. It defaults to retain earnings with --retain, + You can change the transaction description(s) with --close-desc 'DESC' + and --open-desc 'DESC'. It defaults to retain earnings with --retain, or closing balances and opening balances otherwise. Just one posting to the equity account will be used by default, with an implicit amount. - With --x/--explicit the amount will be shown explicitly, and if it + With --x/--explicit the amount will be shown explicitly, and if it involves multiple commodities, a separate posting will be generated for each commodity. - With --interleaved, each equity posting is shown next to the corre- + With --interleaved, each equity posting is shown next to the corre- sponding source/destination posting. The default closing date is yesterday or the journal's end date, which- - ever is later. You can change this by specifying a report end date; + ever is later. You can change this by specifying a report end date; the last day of the report period will be the closing date. Eg -e 2022 means "close on 2022-12-31". - The default closing date is yesterday, or the journal's end date, - whichever is later. You can change this by specifying a report end - date; (The report start date does not matter.) The last day of the - report period will be the closing date; eg -e 2022 means "close on - 2022-12-31". The opening date is always the day after the closing + The default closing date is yesterday, or the journal's end date, + whichever is later. You can change this by specifying a report end + date; (The report start date does not matter.) The last day of the + report period will be the closing date; eg -e 2022 means "close on + 2022-12-31". The opening date is always the day after the closing date. close and costs - With --show-costs, any amount costs are shown, with separate postings + With --show-costs, any amount costs are shown, with separate postings for each cost. (This currently the best way to view investment assets, - showing lots and cost bases.) If you have many currency conversion or + showing lots and cost bases.) If you have many currency conversion or investment transactions, it can generate very large journal entries. close and balance assertions - Balance assertions will be generated, verifying that the accounts have - been reset to zero (and then restored to their previous balances, if + Balance assertions will be generated, verifying that the accounts have + been reset to zero (and then restored to their previous balances, if there is an opening transaction). - These provide useful error checking, but you can ignore them temporar- + These provide useful error checking, but you can ignore them temporar- ily with -I, or remove them if you prefer. - You probably should avoid filtering transactions by status or realness - (-C, -R, status:), or generating postings (--auto), with this command, + You probably should avoid filtering transactions by status or realness + (-C, -R, status:), or generating postings (--auto), with this command, since the balance assertions would depend on these. - Note custom posting dates spanning the file boundary will disrupt the + Note custom posting dates spanning the file boundary will disrupt the balance assertions: 2023-12-30 a purchase made in december, cleared in january expenses:food 5 assets:bank:checking -5 ; date: 2023-01-02 - To solve that you can transfer the money to and from a temporary + To solve that you can transfer the money to and from a temporary account, in effect splitting the multi-day transaction into two single- day transactions: @@ -7274,38 +7273,38 @@ PART 4: COMMANDS assets:bank:checking -5 Example: retain earnings - Record 2022's revenues/expenses as retained earnings on 2022-12-31, + Record 2022's revenues/expenses as retained earnings on 2022-12-31, appending the generated transaction to the journal: $ hledger close --retain -f 2022.journal -p 2022 >> 2022.journal - Now 2022's income statement will show only zeroes. To see it again, + Now 2022's income statement will show only zeroes. To see it again, exclude the retain transaction. Eg: $ hledger -f 2022.journal is not:desc:'retain earnings' Example: migrate balances to a new file - Close assets/liabilities/equity on 2022-12-31 and re-open them on + Close assets/liabilities/equity on 2022-12-31 and re-open them on 2023-01-01: $ hledger close --migrate -f 2022.journal -p 2022 # copy/paste the closing transaction to the end of 2022.journal # copy/paste the opening transaction to the start of 2023.journal - Now 2022's balance sheet will show only zeroes, indicating a balanced - accounting equation. (Unless you are using @/@@ notation - in that + Now 2022's balance sheet will show only zeroes, indicating a balanced + accounting equation. (Unless you are using @/@@ notation - in that case, try adding --infer-equity.) To see it again, exclude the closing transaction. Eg: $ hledger -f 2022.journal bs not:desc:'closing balances' Example: excluding closing/opening transactions - When combining many files for multi-year reports, the closing/opening - transactions cause some noise in reports like print and register. You + When combining many files for multi-year reports, the closing/opening + transactions cause some noise in reports like print and register. You can exclude them as shown above, but not:desc:... could be fragile, and - also you will need to avoid excluding the very first opening transac- - tion, which can be awkward. Here is a way to do it, using tags: add - clopen: tags to all opening/closing balances transactions except the + also you will need to avoid excluding the very first opening transac- + tion, which can be awkward. Here is a way to do it, using tags: add + clopen: tags to all opening/closing balances transactions except the first, like this: ; 2021.journal @@ -7331,7 +7330,7 @@ PART 4: COMMANDS include 2022.journal include 2023.journal - The clopen: tag can exclude all but the first opening transaction. To + The clopen: tag can exclude all but the first opening transaction. To show a clean multi-year checking register: $ hledger -f all.journal areg checking not:tag:clopen @@ -7344,13 +7343,13 @@ PART 4: COMMANDS codes List the codes seen in transactions, in the order parsed. - This command prints the value of each transaction's code field, in the - order transactions were parsed. The transaction code is an optional - value written in parentheses between the date and description, often + This command prints the value of each transaction's code field, in the + order transactions were parsed. The transaction code is an optional + value written in parentheses between the date and description, often used to store a cheque number, order number or similar. Transactions aren't required to have a code, and missing or empty codes - will not be shown by default. With the -E/--empty flag, they will be + will not be shown by default. With the -E/--empty flag, they will be printed as blank lines. You can add a query to select a subset of transactions. @@ -7391,7 +7390,7 @@ PART 4: COMMANDS List the unique descriptions that appear in transactions. This command lists the unique descriptions that appear in transactions, - in alphabetic order. You can add a query to select a subset of trans- + in alphabetic order. You can add a query to select a subset of trans- actions. Example: @@ -7402,18 +7401,18 @@ PART 4: COMMANDS Person A diff - Compares a particular account's transactions in two input files. It + Compares a particular account's transactions in two input files. It shows any transactions to this account which are in one file but not in the other. More precisely, for each posting affecting this account in either file, - it looks for a corresponding posting in the other file which posts the - same amount to the same account (ignoring date, description, etc.) + it looks for a corresponding posting in the other file which posts the + same amount to the same account (ignoring date, description, etc.) Since postings not transactions are compared, this also works when mul- tiple bank transactions have been combined into a single journal entry. This is useful eg if you have downloaded an account's transactions from - your bank (eg as CSV data). When hledger and your bank disagree about + your bank (eg as CSV data). When hledger and your bank disagree about the account balance, you can compare the bank data with your journal to find out the cause. @@ -7430,22 +7429,22 @@ PART 4: COMMANDS These transactions are in the second file only: files - List all files included in the journal. With a REGEX argument, only - file names matching the regular expression (case sensitive) are shown. + List all files included in the journal. With a REGEX argument, only + file names matching the regular expression (case sensitive) are shown. help - Show the hledger user manual in the terminal, with info, man, or a - pager. With a TOPIC argument, open it at that topic if possible. - TOPIC can be any heading in the manual, or a heading prefix, case - insensitive. Eg: commands, print, forecast, journal, amount, "auto + Show the hledger user manual in the terminal, with info, man, or a + pager. With a TOPIC argument, open it at that topic if possible. + TOPIC can be any heading in the manual, or a heading prefix, case + insensitive. Eg: commands, print, forecast, journal, amount, "auto postings". This command shows the hledger manual built in to your hledger version. It can be useful when offline, or when you prefer the terminal to a web - browser, or when the appropriate hledger manual or viewing tools are + browser, or when the appropriate hledger manual or viewing tools are not installed on your system. - By default it chooses the best viewer found in $PATH (preferring info + By default it chooses the best viewer found in $PATH (preferring info since the hledger manual is large). You can select a particular viewer with the -i, -m, or -p flags. @@ -7456,71 +7455,71 @@ PART 4: COMMANDS $ hledger help journal # show the journal topic in the hledger manual import - Read new transactions added to each FILE since last run, and add them - to the journal. Or with --dry-run, just print the transactions that - would be added. Or with --catchup, just mark all of the FILEs' trans- + Read new transactions added to each FILE since last run, and add them + to the journal. Or with --dry-run, just print the transactions that + would be added. Or with --catchup, just mark all of the FILEs' trans- actions as imported, without actually importing any. - This command may append new transactions to the main journal file - (which should be in journal format). Existing transactions are not - changed. This is one of the few hledger commands that writes to the + This command may append new transactions to the main journal file + (which should be in journal format). Existing transactions are not + changed. This is one of the few hledger commands that writes to the journal file (see also add). - Unlike other hledger commands, with import the journal file is an out- + Unlike other hledger commands, with import the journal file is an out- put file, and will be modified, though only by appending (existing data - will not be changed). The input files are specified as arguments, so - to import one or more CSV files to your main journal, you will run + will not be changed). The input files are specified as arguments, so + to import one or more CSV files to your main journal, you will run hledger import bank.csv or perhaps hledger import *.csv. Note you can import from any file format, though CSV files are the most common import source, and these docs focus on that case. Deduplication - As a convenience import does deduplication while reading transactions. + As a convenience import does deduplication while reading transactions. This does not mean "ignore transactions that look the same", but rather "ignore transactions that have been seen before". This is intended for - when you are periodically importing foreign data which may contain - already-imported transactions. So eg, if every day you download bank - CSV files containing redundant data, you can safely run hledger import - bank.csv and only new transactions will be imported. (import is idem- + when you are periodically importing foreign data which may contain + already-imported transactions. So eg, if every day you download bank + CSV files containing redundant data, you can safely run hledger import + bank.csv and only new transactions will be imported. (import is idem- potent.) - Since the items being read (CSV records, eg) often do not come with - unique identifiers, hledger detects new transactions by date, assuming + Since the items being read (CSV records, eg) often do not come with + unique identifiers, hledger detects new transactions by date, assuming that: 1. new items always have the newest dates 2. item dates do not change across reads - 3. and items with the same date remain in the same relative order + 3. and items with the same date remain in the same relative order across reads. - These are often true of CSV files representing transactions, or true - enough so that it works pretty well in practice. 1 is important, but + These are often true of CSV files representing transactions, or true + enough so that it works pretty well in practice. 1 is important, but violations of 2 and 3 amongst the old transactions won't matter (and if - you import often, the new transactions will be few, so less likely to + you import often, the new transactions will be few, so less likely to be the ones affected). - hledger remembers the latest date processed in each input file by sav- + hledger remembers the latest date processed in each input file by sav- ing a hidden ".latest" state file in the same directory. Eg when read- - ing finance/bank.csv, it will look for and update the finance/.lat- - est.bank.csv state file. The format is simple: one or more lines con- - taining the same ISO-format date (YYYY-MM-DD), meaning "I have pro- - cessed transactions up to this date, and this many of them on that + ing finance/bank.csv, it will look for and update the finance/.lat- + est.bank.csv state file. The format is simple: one or more lines con- + taining the same ISO-format date (YYYY-MM-DD), meaning "I have pro- + cessed transactions up to this date, and this many of them on that date." Normally you won't see or manipulate these state files yourself. - But if needed, you can delete them to reset the state (making all - transactions "new"), or you can construct them to "catch up" to a cer- + But if needed, you can delete them to reset the state (making all + transactions "new"), or you can construct them to "catch up" to a cer- tain date. - Note deduplication (and updating of state files) can also be done by + Note deduplication (and updating of state files) can also be done by print --new, but this is less often used. Import testing - With --dry-run, the transactions that will be imported are printed to + With --dry-run, the transactions that will be imported are printed to the terminal, without updating your journal or state files. The output - is valid journal format, like the print command, so you can re-parse - it. Eg, to see any importable transactions which CSV rules have not + is valid journal format, like the print command, so you can re-parse + it. Eg, to see any importable transactions which CSV rules have not categorised: $ hledger import --dry bank.csv | hledger -f- -I print unknown @@ -7536,17 +7535,17 @@ PART 4: COMMANDS do a --dry-run first and fix any problems before the real import. Importing balance assignments - Entries added by import will have their posting amounts made explicit - (like hledger print -x). This means that any balance assignments in - imported files must be evaluated; but, imported files don't get to see - the main file's account balances. As a result, importing entries with + Entries added by import will have their posting amounts made explicit + (like hledger print -x). This means that any balance assignments in + imported files must be evaluated; but, imported files don't get to see + the main file's account balances. As a result, importing entries with balance assignments (eg from an institution that provides only balances - and not posting amounts) will probably generate incorrect posting + and not posting amounts) will probably generate incorrect posting amounts. To avoid this problem, use print instead of import: $ hledger print IMPORTFILE [--new] >> $LEDGER_FILE - (If you think import should leave amounts implicit like print does, + (If you think import should leave amounts implicit like print does, please test it and send a pull request.) Commodity display styles @@ -7557,12 +7556,12 @@ PART 4: COMMANDS (is) This command displays an income statement, showing revenues and - expenses during one or more periods. Amounts are shown with normal + expenses during one or more periods. Amounts are shown with normal positive sign, as in conventional financial statements. - This report shows accounts declared with the Revenue or Expense type - (see account types). Or if no such accounts are declared, it shows - top-level accounts named revenue or income or expense (case insensi- + This report shows accounts declared with the Revenue or Expense type + (see account types). Or if no such accounts are declared, it shows + top-level accounts named revenue or income or expense (case insensi- tive, plurals allowed) and their subaccounts. Example: @@ -7589,21 +7588,21 @@ PART 4: COMMANDS 0 This command is a higher-level variant of the balance command, and sup- - ports many of that command's features, such as multi-period reports. + ports many of that command's features, such as multi-period reports. It is similar to hledger balance '(revenues|income)' expenses, but with - smarter account detection, and revenues/income displayed with their + smarter account detection, and revenues/income displayed with their sign flipped. - This command also supports the output destination and output format - options The output formats supported are txt, csv, html, and (experi- + This command also supports the output destination and output format + options The output formats supported are txt, csv, html, and (experi- mental) json. notes List the unique notes that appear in transactions. - This command lists the unique notes that appear in transactions, in - alphabetic order. You can add a query to select a subset of transac- - tions. The note is the part of the transaction description after a | + This command lists the unique notes that appear in transactions, in + alphabetic order. You can add a query to select a subset of transac- + tions. The note is the part of the transaction description after a | character (or if there is no |, the whole description). Example: @@ -7615,14 +7614,14 @@ PART 4: COMMANDS payees List the unique payee/payer names that appear in transactions. - This command lists unique payee/payer names which have been declared - with payee directives (--declared), used in transaction descriptions + This command lists unique payee/payer names which have been declared + with payee directives (--declared), used in transaction descriptions (--used), or both (the default). - The payee/payer is the part of the transaction description before a | + The payee/payer is the part of the transaction description before a | character (or if there is no |, the whole description). - You can add query arguments to select a subset of transactions. This + You can add query arguments to select a subset of transactions. This implies --used. Example: @@ -7633,10 +7632,10 @@ PART 4: COMMANDS Person A prices - Print market price directives from the journal. With --infer-market- - prices, generate additional market prices from costs. With --infer- - reverse-prices, also generate market prices by inverting known prices. - Prices can be filtered by a query. Price amounts are displayed with + Print market price directives from the journal. With --infer-market- + prices, generate additional market prices from costs. With --infer- + reverse-prices, also generate market prices by inverting known prices. + Prices can be filtered by a query. Price amounts are displayed with their full precision. print @@ -7645,17 +7644,17 @@ PART 4: COMMANDS The print command displays full journal entries (transactions) from the journal file, sorted by date (or with --date2, by secondary date). - Amounts are shown mostly normalised to commodity display style, eg the - placement of commodity symbols will be consistent. All of their deci- + Amounts are shown mostly normalised to commodity display style, eg the + placement of commodity symbols will be consistent. All of their deci- mal places are shown, as in the original journal entry (with one alter- ation: in some cases trailing zeroes are added.) Amounts are shown right-aligned within each transaction (but not across all transactions). - Directives and inter-transaction comments are not shown, currently. + Directives and inter-transaction comments are not shown, currently. This means the print command is somewhat lossy, and if you are using it - to reformat your journal you should take care to also copy over the + to reformat your journal you should take care to also copy over the directives and file-level comments. Eg: @@ -7682,7 +7681,7 @@ PART 4: COMMANDS liabilities:debts $1 assets:bank:checking $-1 - print's output is usually a valid hledger journal, and you can process + print's output is usually a valid hledger journal, and you can process it again with a second hledger command. This can be useful for certain kinds of search, eg: @@ -7692,7 +7691,7 @@ PART 4: COMMANDS There are some situations where print's output can become unparseable: - o Valuation affects posting amounts but not balance assertion or bal- + o Valuation affects posting amounts but not balance assertion or bal- ance assignment amounts, potentially causing those to fail. o Auto postings can generate postings with too many missing amounts. @@ -7701,33 +7700,33 @@ PART 4: COMMANDS Normally, the journal entry's explicit or implicit amount style is pre- served. For example, when an amount is omitted in the journal, it will - not appear in the output. Similarly, when a cost is implied but not - written, it will not appear in the output. You can use the + not appear in the output. Similarly, when a cost is implied but not + written, it will not appear in the output. You can use the -x/--explicit flag to make all amounts and costs explicit, which can be useful for troubleshooting or for making your journal more readable and - robust against data entry errors. -x is also implied by using any of + robust against data entry errors. -x is also implied by using any of -B,-V,-X,--value. - Note, -x/--explicit will cause postings with a multi-commodity amount - (these can arise when a multi-commodity transaction has an implicit - amount) to be split into multiple single-commodity postings, keeping + Note, -x/--explicit will cause postings with a multi-commodity amount + (these can arise when a multi-commodity transaction has an implicit + amount) to be split into multiple single-commodity postings, keeping the output parseable. - With -B/--cost, amounts with costs are converted to cost using that + With -B/--cost, amounts with costs are converted to cost using that price. This can be used for troubleshooting. - With -m DESC/--match=DESC, print does a fuzzy search for one recent - transaction whose description is most similar to DESC. DESC should - contain at least two characters. If there is no similar-enough match, - no transaction will be shown and the program exit code will be non- + With -m DESC/--match=DESC, print does a fuzzy search for one recent + transaction whose description is most similar to DESC. DESC should + contain at least two characters. If there is no similar-enough match, + no transaction will be shown and the program exit code will be non- zero. - With --new, hledger prints only transactions it has not seen on a pre- - vious run. This uses the same deduplication system as the import com- + With --new, hledger prints only transactions it has not seen on a pre- + vious run. This uses the same deduplication system as the import com- mand. (See import's docs for details.) - This command also supports the output destination and output format - options The output formats supported are txt, csv, and (experimental) + This command also supports the output destination and output format + options The output formats supported are txt, csv, and (experimental) json and sql. Here's an example of print's CSV output: @@ -7746,20 +7745,20 @@ PART 4: COMMANDS "5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","","" "5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","","" - o There is one CSV record per posting, with the parent transaction's + o There is one CSV record per posting, with the parent transaction's fields repeated. o The "txnidx" (transaction index) field shows which postings belong to - the same transaction. (This number might change if transactions are - reordered within the file, files are parsed/included in a different + the same transaction. (This number might change if transactions are + reordered within the file, files are parsed/included in a different order, etc.) - o The amount is separated into "commodity" (the symbol) and "amount" + o The amount is separated into "commodity" (the symbol) and "amount" (numeric quantity) fields. o The numeric amount is repeated in either the "credit" or "debit" col- - umn, for convenience. (Those names are not accurate in the account- - ing sense; it just puts negative amounts under credit and zero or + umn, for convenience. (Those names are not accurate in the account- + ing sense; it just puts negative amounts under credit and zero or greater amounts under debit.) register @@ -7768,14 +7767,14 @@ PART 4: COMMANDS Show postings and their running total. The register command displays matched postings, across all accounts, in - date order, with their running total or running historical balance. - (See also the aregister command, which shows matched transactions in a + date order, with their running total or running historical balance. + (See also the aregister command, which shows matched transactions in a specific account.) register normally shows line per posting, but note that multi-commodity amounts will occupy multiple lines (one line per commodity). - It is typically used with a query selecting a particular account, to + It is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking @@ -7786,14 +7785,14 @@ PART 4: COMMANDS With --date2, it shows and sorts by secondary date instead. - For performance reasons, column widths are chosen based on the first - 1000 lines; this means unusually wide values in later lines can cause - visual discontinuities as column widths are adjusted. If you want to - ensure perfect alignment, at the cost of more time and memory, use the + For performance reasons, column widths are chosen based on the first + 1000 lines; this means unusually wide values in later lines can cause + visual discontinuities as column widths are adjusted. If you want to + ensure perfect alignment, at the cost of more time and memory, use the --align-all flag. - The --historical/-H flag adds the balance from any undisplayed prior - postings to the running total. This is useful when you want to see + The --historical/-H flag adds the balance from any undisplayed prior + postings to the running total. This is useful when you want to see only recent activity, with a historically accurate running balance: $ hledger register checking -b 2008/6 --historical @@ -7803,30 +7802,30 @@ PART 4: COMMANDS The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead + The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for - the whole report period). This flag implies --empty (see below). It - is affected by --historical. It works best when showing just one + the whole report period). This flag implies --empty (see below). It + is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of + The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - The --invert flag negates all amounts. For example, it can be used on + The --invert flag negates all amounts. For example, it can be used on an income account where amounts are normally displayed as negative num- - bers. It's also useful to show postings on the checking account + bers. It's also useful to show postings on the checking account together with the related account: $ hledger register --related --invert assets:checking - With a reporting interval, register shows summary postings, one per + With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are + Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E @@ -7843,7 +7842,7 @@ PART 4: COMMANDS 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth + Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h @@ -7851,24 +7850,24 @@ PART 4: COMMANDS 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these - will be adjusted outward if necessary to contain a whole number of - intervals. This ensures that the first and last intervals are full + Note when using report intervals, if you specify start/end dates these + will be adjusted outward if necessary to contain a whole number of + intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. - With -m DESC/--match=DESC, register does a fuzzy search for one recent + With -m DESC/--match=DESC, register does a fuzzy search for one recent posting whose description is most similar to DESC. DESC should contain at least two characters. If there is no similar-enough match, no post- ing will be shown and the program exit code will be non-zero. Custom register output - register uses the full terminal width by default, except on windows. - You can override this by setting the COLUMNS environment variable (not + register uses the full terminal width by default, except on windows. + You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally - (about half of (width - 40) each). You can adjust this by adding a - description width as part of --width's argument, comma-separated: + The description and account columns normally share the space equally + (about half of (width - 40) each). You can adjust this by adding a + description width as part of --width's argument, comma-separated: --width W,D . Here's a diagram (won't display correctly in --help): <--------------------------------- width (W) ----------------------------------> @@ -7884,19 +7883,19 @@ PART 4: COMMANDS $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, & description width 40 - This command also supports the output destination and output format - options The output formats supported are txt, csv, and (experimental) + This command also supports the output destination and output format + options The output formats supported are txt, csv, and (experimental) json. rewrite Print all transactions, rewriting the postings of matched transactions. - For now the only rewrite available is adding new postings, like print + For now the only rewrite available is adding new postings, like print --auto. This is a start at a generic rewriter of transaction entries. It reads - the default journal and prints the transactions, like print, but adds + the default journal and prints the transactions, like print, but adds one or more specified postings to any transactions matching QUERY. The - posting amounts can be fixed, or a multiplier of the existing transac- + posting amounts can be fixed, or a multiplier of the existing transac- tion's first posting amount. Examples: @@ -7912,7 +7911,7 @@ PART 4: COMMANDS (reserve:grocery) *0.25 ; reserve 25% for grocery (reserve:) *0.25 ; reserve 25% for grocery - Note the single quotes to protect the dollar sign from bash, and the + Note the single quotes to protect the dollar sign from bash, and the two spaces between account and amount. More: @@ -7922,16 +7921,16 @@ PART 4: COMMANDS $ hledger rewrite -- expenses:gifts --add-posting '(budget:gifts) *-1"' $ hledger rewrite -- ^income --add-posting '(budget:foreign currency) *0.25 JPY; diversify' - Argument for --add-posting option is a usual posting of transaction - with an exception for amount specification. More precisely, you can + Argument for --add-posting option is a usual posting of transaction + with an exception for amount specification. More precisely, you can use '*' (star symbol) before the amount to indicate that that this is a - factor for an amount of original matched posting. If the amount - includes a commodity name, the new posting amount will be in the new - commodity; otherwise, it will be in the matched posting amount's com- + factor for an amount of original matched posting. If the amount + includes a commodity name, the new posting amount will be in the new + commodity; otherwise, it will be in the matched posting amount's com- modity. Re-write rules in a file - During the run this tool will execute so called "Automated Transac- + During the run this tool will execute so called "Automated Transac- tions" found in any journal it process. I.e instead of specifying this operations in command line you can put them in a journal file. @@ -7946,7 +7945,7 @@ PART 4: COMMANDS budget:gifts *-1 assets:budget *1 - Note that '=' (equality symbol) that is used instead of date in trans- + Note that '=' (equality symbol) that is used instead of date in trans- actions you usually write. It indicates the query by which you want to match the posting to add new ones. @@ -7959,12 +7958,12 @@ PART 4: COMMANDS --add-posting 'assets:budget *1' \ > rewritten-tidy-output.journal - It is important to understand that relative order of such entries in - journal is important. You can re-use result of previously added post- + It is important to understand that relative order of such entries in + journal is important. You can re-use result of previously added post- ings. Diff output format - To use this tool for batch modification of your journal files you may + To use this tool for batch modification of your journal files you may find useful output in form of unified diff. $ hledger rewrite -- --diff -f examples/sample.journal '^income' --add-posting '(liabilities:tax) *.33' @@ -7988,10 +7987,10 @@ PART 4: COMMANDS If you'll pass this through patch tool you'll get transactions contain- ing the posting that matches your query be updated. Note that multiple - files might be update according to list of input files specified via + files might be update according to list of input files specified via --file options and include directives inside of these files. - Be careful. Whole transaction being re-formatted in a style of output + Be careful. Whole transaction being re-formatted in a style of output from hledger print. See also: @@ -7999,53 +7998,53 @@ PART 4: COMMANDS https://github.com/simonmichael/hledger/issues/99 rewrite vs. print --auto - This command predates print --auto, and currently does much the same + This command predates print --auto, and currently does much the same thing, but with these differences: - o with multiple files, rewrite lets rules in any file affect all other - files. print --auto uses standard directive scoping; rules affect + o with multiple files, rewrite lets rules in any file affect all other + files. print --auto uses standard directive scoping; rules affect only child files. - o rewrite's query limits which transactions can be rewritten; all are + o rewrite's query limits which transactions can be rewritten; all are printed. print --auto's query limits which transactions are printed. - o rewrite applies rules specified on command line or in the journal. + o rewrite applies rules specified on command line or in the journal. print --auto applies rules specified in the journal. roi - Shows the time-weighted (TWR) and money-weighted (IRR) rate of return + Shows the time-weighted (TWR) and money-weighted (IRR) rate of return on your investments. - At a minimum, you need to supply a query (which could be just an - account name) to select your investment(s) with --inv, and another + At a minimum, you need to supply a query (which could be just an + account name) to select your investment(s) with --inv, and another query to identify your profit and loss transactions with --pnl. - If you do not record changes in the value of your investment manually, - or do not require computation of time-weighted return (TWR), --pnl + If you do not record changes in the value of your investment manually, + or do not require computation of time-weighted return (TWR), --pnl could be an empty query (--pnl "" or --pnl STR where STR does not match any of your accounts). - This command will compute and display the internalized rate of return - (IRR) and time-weighted rate of return (TWR) for your investments for - the time period requested. Both rates of return are annualized before + This command will compute and display the internalized rate of return + (IRR) and time-weighted rate of return (TWR) for your investments for + the time period requested. Both rates of return are annualized before display, regardless of the length of reporting interval. - Price directives will be taken into account if you supply appropriate + Price directives will be taken into account if you supply appropriate --cost or --value flags (see VALUATION). Note, in some cases this report can fail, for these reasons: - o Error (NotBracketed): No solution for Internal Rate of Return (IRR). - Possible causes: IRR is huge (>1000000%), balance of investment + o Error (NotBracketed): No solution for Internal Rate of Return (IRR). + Possible causes: IRR is huge (>1000000%), balance of investment becomes negative at some point in time. - o Error (SearchFailed): Failed to find solution for Internal Rate of + o Error (SearchFailed): Failed to find solution for Internal Rate of Return (IRR). Either search does not converge to a solution, or con- verges too slowly. Examples: - o Using roi to compute total return of investment in stocks: + o Using roi to compute total return of investment in stocks: https://github.com/simonmichael/hledger/blob/master/examples/invest- ing/roi-unrealised.ledger @@ -8055,27 +8054,27 @@ PART 4: COMMANDS Note that --inv and --pnl's argument is a query, and queries could have several space-separated terms (see QUERIES). - To indicate that all search terms form single command-line argument, + To indicate that all search terms form single command-line argument, you will need to put them in quotes (see Special characters): $ hledger roi --inv 'term1 term2 term3 ...' - If any query terms contain spaces themselves, you will need an extra + If any query terms contain spaces themselves, you will need an extra level of nested quoting, eg: $ hledger roi --inv="'Assets:Test 1'" --pnl="'Equity:Unrealized Profit and Loss'" Semantics of --inv and --pnl - Query supplied to --inv has to match all transactions that are related + Query supplied to --inv has to match all transactions that are related to your investment. Transactions not matching --inv will be ignored. In these transactions, ROI will conside postings that match --inv to be - "investment postings" and other postings (not matching --inv) will be - sorted into two categories: "cash flow" and "profit and loss", as ROI - needs to know which part of the investment value is your contributions + "investment postings" and other postings (not matching --inv) will be + sorted into two categories: "cash flow" and "profit and loss", as ROI + needs to know which part of the investment value is your contributions and which is due to the return on investment. - o "Cash flow" is depositing or withdrawing money, buying or selling + o "Cash flow" is depositing or withdrawing money, buying or selling assets, or otherwise converting between your investment commodity and any other commodity. Example: @@ -8093,12 +8092,12 @@ PART 4: COMMANDS investment:snake oil = $57 equity:unrealized profit or loss - All non-investment postings are assumed to be "cash flow", unless they - match --pnl query. Changes in value of your investment due to "profit - and loss" postings will be considered as part of your investment + All non-investment postings are assumed to be "cash flow", unless they + match --pnl query. Changes in value of your investment due to "profit + and loss" postings will be considered as part of your investment return. - Example: if you use --inv snake --pnl equity:unrealized, then postings + Example: if you use --inv snake --pnl equity:unrealized, then postings in the example below would be classifed as: 2019-01-01 Snake Oil #1 @@ -8115,57 +8114,57 @@ PART 4: COMMANDS snake oil $50 ; investment posting IRR and TWR explained - "ROI" stands for "return on investment". Traditionally this was com- - puted as a difference between current value of investment and its ini- + "ROI" stands for "return on investment". Traditionally this was com- + puted as a difference between current value of investment and its ini- tial value, expressed in percentage of the initial value. However, this approach is only practical in simple cases, where invest- - ments receives no in-flows or out-flows of money, and where rate of + ments receives no in-flows or out-flows of money, and where rate of growth is fixed over time. For more complex scenarios you need differ- - ent ways to compute rate of return, and this command implements two of + ent ways to compute rate of return, and this command implements two of them: IRR and TWR. - Internal rate of return, or "IRR" (also called "money-weighted rate of - return") takes into account effects of in-flows and out-flows. + Internal rate of return, or "IRR" (also called "money-weighted rate of + return") takes into account effects of in-flows and out-flows. Naively, if you are withdrawing from your investment, your future gains - would be smaller (in absolute numbers), and will be a smaller percent- - age of your initial investment, and if you are adding to your invest- - ment, you will receive bigger absolute gains (but probably at the same - rate of return). IRR is a way to compute rate of return for each + would be smaller (in absolute numbers), and will be a smaller percent- + age of your initial investment, and if you are adding to your invest- + ment, you will receive bigger absolute gains (but probably at the same + rate of return). IRR is a way to compute rate of return for each period between in-flow or out-flow of money, and then combine them in a - way that gives you a compound annual rate of return that investment is + way that gives you a compound annual rate of return that investment is expected to generate. - As mentioned before, in-flows and out-flows would be any cash that you + As mentioned before, in-flows and out-flows would be any cash that you personally put in or withdraw, and for the "roi" command, these are the - postings that match the query in the--inv argument and NOT match the + postings that match the query in the--inv argument and NOT match the query in the--pnl argument. - If you manually record changes in the value of your investment as - transactions that balance them against "profit and loss" (or "unreal- - ized gains") account or use price directives, then in order for IRR to - compute the precise effect of your in-flows and out-flows on the rate - of return, you will need to record the value of your investement on or + If you manually record changes in the value of your investment as + transactions that balance them against "profit and loss" (or "unreal- + ized gains") account or use price directives, then in order for IRR to + compute the precise effect of your in-flows and out-flows on the rate + of return, you will need to record the value of your investement on or close to the days when in- or out-flows occur. - In technical terms, IRR uses the same approach as computation of net + In technical terms, IRR uses the same approach as computation of net present value, and tries to find a discount rate that makes net present value of all the cash flows of your investment to add up to zero. This - could be hard to wrap your head around, especially if you haven't done + could be hard to wrap your head around, especially if you haven't done discounted cash flow analysis before. Implementation of IRR in hledger should produce results that match the XIRR formula in Excel. - Second way to compute rate of return that roi command implements is + Second way to compute rate of return that roi command implements is called "time-weighted rate of return" or "TWR". Like IRR, it will also - break the history of your investment into periods between in-flows, - out-flows and value changes, to compute rate of return per each period - and then a compound rate of return. However, internal workings of TWR + break the history of your investment into periods between in-flows, + out-flows and value changes, to compute rate of return per each period + and then a compound rate of return. However, internal workings of TWR are quite different. - TWR represents your investment as an imaginary "unit fund" where in- - flows/ out-flows lead to buying or selling "units" of your investment + TWR represents your investment as an imaginary "unit fund" where in- + flows/ out-flows lead to buying or selling "units" of your investment and changes in its value change the value of "investment unit". Change - in "unit price" over the reporting period gives you rate of return of + in "unit price" over the reporting period gives you rate of return of your investment. References: @@ -8176,21 +8175,21 @@ PART 4: COMMANDS o Explanation of TWR - o Examples of computing IRR and TWR and discussion of the limitations + o Examples of computing IRR and TWR and discussion of the limitations of both metrics stats Show journal and performance statistics. - The stats command displays summary information for the whole journal, - or a matched part of it. With a reporting interval, it shows a report + The stats command displays summary information for the whole journal, + or a matched part of it. With a reporting interval, it shows a report for each report period. - At the end, it shows (in the terminal) the overall run time and number - of transactions processed per second. Note these are approximate and - will vary based on machine, current load, data size, hledger version, - haskell lib versions, GHC version.. but they may be of interest. The - stats command's run time is similar to that of a single-column balance + At the end, it shows (in the terminal) the overall run time and number + of transactions processed per second. Note these are approximate and + will vary based on machine, current load, data size, hledger version, + haskell lib versions, GHC version.. but they may be of interest. The + stats command's run time is similar to that of a single-column balance report. Example: @@ -8220,35 +8219,35 @@ PART 4: COMMANDS This command lists the tag names used in the journal, whether on trans- actions, postings, or account declarations. - With a TAGREGEX argument, only tag names matching this regular expres- + With a TAGREGEX argument, only tag names matching this regular expres- sion (case insensitive, infix matched) are shown. - With QUERY arguments, only transactions and accounts matching this + With QUERY arguments, only transactions and accounts matching this query are considered. If the query involves transaction fields (date:, desc:, amt:, ...), the search is restricted to the matched transactions and their accounts. - With the --values flag, the tags' unique non-empty values are listed + With the --values flag, the tags' unique non-empty values are listed instead. With -E/--empty, blank/empty values are also shown. - With --parsed, tags or values are shown in the order they were parsed, - with duplicates included. (Except, tags from account declarations are + With --parsed, tags or values are shown in the order they were parsed, + with duplicates included. (Except, tags from account declarations are always shown first.) - Tip: remember, accounts also acquire tags from their parents, postings + Tip: remember, accounts also acquire tags from their parents, postings also acquire tags from their account and transaction, transactions also acquire tags from their postings. test Run built-in unit tests. - This command runs the unit tests built in to hledger and hledger-lib, - printing the results on stdout. If any test fails, the exit code will + This command runs the unit tests built in to hledger and hledger-lib, + printing the results on stdout. If any test fails, the exit code will be non-zero. - This is mainly used by hledger developers, but you can also use it to - sanity-check the installed hledger executable on your platform. All - tests are expected to pass - if you ever see a failure, please report + This is mainly used by hledger developers, but you can also use it to + sanity-check the installed hledger executable on your platform. All + tests are expected to pass - if you ever see a failure, please report as a bug! This command also accepts tasty test runner options, written after a -- @@ -8257,12 +8256,12 @@ PART 4: COMMANDS $ hledger test -- -pData.Amount --color=never - For help on these, see https://github.com/feuerbach/tasty#options (-- + For help on these, see https://github.com/feuerbach/tasty#options (-- --help currently doesn't show them). PART 5: COMMON TASKS - Here are some quick examples of how to do some basic tasks with + Here are some quick examples of how to do some basic tasks with hledger. Getting help @@ -8272,37 +8271,37 @@ PART 5: COMMON TASKS $ hledger --help # show common options $ hledger CMD --help # show CMD's options, common options and CMD's documentation - You can also view your hledger version's manual in several formats by + You can also view your hledger version's manual in several formats by using the help command. Eg: $ hledger help # show the hledger manual with info, man or $PAGER (best available) $ hledger help journal # show the journal topic in the hledger manual $ hledger help --help # find out more about the help command - To view manuals and introductory docs on the web, visit - https://hledger.org. Chat and mail list support and discussion ar- + To view manuals and introductory docs on the web, visit + https://hledger.org. Chat and mail list support and discussion ar- chives can be found at https://hledger.org/support. Constructing command lines - hledger has a flexible command line interface. We strive to keep it - simple and ergonomic, but if you run into one of the sharp edges + hledger has a flexible command line interface. We strive to keep it + simple and ergonomic, but if you run into one of the sharp edges described in OPTIONS, here are some tips that might help: - o command-specific options must go after the command (it's fine to put + o command-specific options must go after the command (it's fine to put common options there too: hledger CMD OPTS ARGS) - o running add-on executables directly simplifies command line parsing + o running add-on executables directly simplifies command line parsing (hledger-ui OPTS ARGS) o enclose "problematic" args in single quotes - o if needed, also add a backslash to hide regular expression metachar- + o if needed, also add a backslash to hide regular expression metachar- acters from the shell o to see how a misbehaving command line is being parsed, add --debug=2. Starting a journal file - hledger looks for your accounting data in a journal file, + hledger looks for your accounting data in a journal file, $HOME/.hledger.journal by default: $ hledger stats @@ -8310,9 +8309,9 @@ PART 5: COMMON TASKS Please create it first, eg with "hledger add" or a text editor. Or, specify an existing journal file with -f or LEDGER_FILE. - You can override this by setting the LEDGER_FILE environment variable. + You can override this by setting the LEDGER_FILE environment variable. It's a good practice to keep this important file under version control, - and to start a new file each year. So you could do something like + and to start a new file each year. So you could do something like this: $ mkdir ~/finance @@ -8336,20 +8335,20 @@ PART 5: COMMON TASKS Market prices : 0 () Setting opening balances - Pick a starting date for which you can look up the balances of some - real-world assets (bank accounts, wallet..) and liabilities (credit + Pick a starting date for which you can look up the balances of some + real-world assets (bank accounts, wallet..) and liabilities (credit cards..). - To avoid a lot of data entry, you may want to start with just one or - two accounts, like your checking account or cash wallet; and pick a - recent starting date, like today or the start of the week. You can + To avoid a lot of data entry, you may want to start with just one or + two accounts, like your checking account or cash wallet; and pick a + recent starting date, like today or the start of the week. You can always come back later and add more accounts and older transactions, eg going back to january 1st. - Add an opening balances transaction to the journal, declaring the bal- + Add an opening balances transaction to the journal, declaring the bal- ances on this date. Here are two ways to do it: - o The first way: open the journal in any text editor and save an entry + o The first way: open the journal in any text editor and save an entry like this: 2020-01-01 * opening balances @@ -8359,19 +8358,19 @@ PART 5: COMMON TASKS liabilities:creditcard $-50 = $-50 equity:opening/closing balances - These are start-of-day balances, ie whatever was in the account at + These are start-of-day balances, ie whatever was in the account at the end of the previous day. - The * after the date is an optional status flag. Here it means + The * after the date is an optional status flag. Here it means "cleared & confirmed". - The currency symbols are optional, but usually a good idea as you'll + The currency symbols are optional, but usually a good idea as you'll be dealing with multiple currencies sooner or later. - The = amounts are optional balance assertions, providing extra error + The = amounts are optional balance assertions, providing extra error checking. - o The second way: run hledger add and follow the prompts to record a + o The second way: run hledger add and follow the prompts to record a similar transaction: $ hledger add @@ -8408,18 +8407,18 @@ PART 5: COMMON TASKS Starting the next transaction (. or ctrl-D/ctrl-C to quit) Date [2020-01-01]: . - If you're using version control, this could be a good time to commit + If you're using version control, this could be a good time to commit the journal. Eg: $ git commit -m 'initial balances' 2020.journal Recording transactions - As you spend or receive money, you can record these transactions using - one of the methods above (text editor, hledger add) or by using the - hledger-iadd or hledger-web add-ons, or by using the import command to + As you spend or receive money, you can record these transactions using + one of the methods above (text editor, hledger add) or by using the + hledger-iadd or hledger-web add-ons, or by using the import command to convert CSV data downloaded from your bank. - Here are some simple transactions, see the hledger_journal(5) manual + Here are some simple transactions, see the hledger_journal(5) manual and hledger.org for more ideas: 2020/1/10 * gift received @@ -8435,22 +8434,22 @@ PART 5: COMMON TASKS assets:bank:checking $1000 Reconciling - Periodically you should reconcile - compare your hledger-reported bal- - ances against external sources of truth, like bank statements or your - bank's website - to be sure that your ledger accurately represents the - real-world balances (and, that the real-world institutions have not - made a mistake!). This gets easy and fast with (1) practice and (2) - frequency. If you do it daily, it can take 2-10 minutes. If you let - it pile up, expect it to take longer as you hunt down errors and dis- + Periodically you should reconcile - compare your hledger-reported bal- + ances against external sources of truth, like bank statements or your + bank's website - to be sure that your ledger accurately represents the + real-world balances (and, that the real-world institutions have not + made a mistake!). This gets easy and fast with (1) practice and (2) + frequency. If you do it daily, it can take 2-10 minutes. If you let + it pile up, expect it to take longer as you hunt down errors and dis- crepancies. A typical workflow: - 1. Reconcile cash. Count what's in your wallet. Compare with what - hledger reports (hledger bal cash). If they are different, try to - remember the missing transaction, or look for the error in the - already-recorded transactions. A register report can be helpful - (hledger reg cash). If you can't find the error, add an adjustment + 1. Reconcile cash. Count what's in your wallet. Compare with what + hledger reports (hledger bal cash). If they are different, try to + remember the missing transaction, or look for the error in the + already-recorded transactions. A register report can be helpful + (hledger reg cash). If you can't find the error, add an adjustment transaction. Eg if you have $105 after the above, and can't explain the missing $2, it could be: @@ -8460,26 +8459,26 @@ PART 5: COMMON TASKS 2. Reconcile checking. Log in to your bank's website. Compare today's (cleared) balance with hledger's cleared balance (hledger bal check- - ing -C). If they are different, track down the error or record the - missing transaction(s) or add an adjustment transaction, similar to + ing -C). If they are different, track down the error or record the + missing transaction(s) or add an adjustment transaction, similar to the above. Unlike the cash case, you can usually compare the trans- - action history and running balance from your bank with the one - reported by hledger reg checking -C. This will be easier if you - generally record transaction dates quite similar to your bank's + action history and running balance from your bank with the one + reported by hledger reg checking -C. This will be easier if you + generally record transaction dates quite similar to your bank's clearing dates. 3. Repeat for other asset/liability accounts. - Tip: instead of the register command, use hledger-ui to see a live- + Tip: instead of the register command, use hledger-ui to see a live- updating register while you edit the journal: hledger-ui --watch --reg- ister checking -C - After reconciling, it could be a good time to mark the reconciled - transactions' status as "cleared and confirmed", if you want to track - that, by adding the * marker. Eg in the paycheck transaction above, + After reconciling, it could be a good time to mark the reconciled + transactions' status as "cleared and confirmed", if you want to track + that, by adding the * marker. Eg in the paycheck transaction above, insert * between 2020-01-15 and paycheck - If you're using version control, this can be another good time to com- + If you're using version control, this can be another good time to com- mit: $ git commit -m 'txns' 2020.journal @@ -8551,7 +8550,7 @@ PART 5: COMMON TASKS -------------------- 0 - Show only asset and liability balances, as a flat list, limited to + Show only asset and liability balances, as a flat list, limited to depth 2: $ hledger bal assets liabilities -2 @@ -8561,7 +8560,7 @@ PART 5: COMMON TASKS -------------------- $4055 - Show the same thing without negative numbers, formatted as a simple + Show the same thing without negative numbers, formatted as a simple balance sheet: $ hledger bs -2 @@ -8628,9 +8627,9 @@ PART 5: COMMON TASKS 2020-01-13 **** Migrating to a new file - At the end of the year, you may want to continue your journal in a new + At the end of the year, you may want to continue your journal in a new file, so that old transactions don't slow down or clutter your reports, - and to help ensure the integrity of your accounting history. See the + and to help ensure the integrity of your accounting history. See the close command. If using version control, don't forget to git add the new file. @@ -8638,7 +8637,7 @@ PART 5: COMMON TASKS REPORTING BUGS - Report bugs at http://bugs.hledger.org (or on the #hledger chat or + Report bugs at http://bugs.hledger.org (or on the #hledger chat or hledger mail list)