From 5d40b5404306742209ffb5b8fc4142c10648f526 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 1 Aug 2020 12:41:54 -0700 Subject: [PATCH] ;doc: regen manuals --- hledger-lib/defs.m4 | 2 +- hledger-lib/hledger_csv.5 | 2 +- hledger-lib/hledger_csv.txt | 2 +- hledger-lib/hledger_journal.5 | 13 +- hledger-lib/hledger_journal.info | 179 +++--- hledger-lib/hledger_journal.txt | 484 +++++++------- hledger-lib/hledger_timeclock.5 | 2 +- hledger-lib/hledger_timeclock.txt | 2 +- hledger-lib/hledger_timedot.5 | 2 +- hledger-lib/hledger_timedot.txt | 2 +- hledger-ui/defs.m4 | 2 +- hledger-ui/hledger-ui.1 | 2 +- hledger-ui/hledger-ui.txt | 2 +- hledger-web/defs.m4 | 2 +- hledger-web/hledger-web.1 | 2 +- hledger-web/hledger-web.txt | 2 +- hledger/Hledger/Cli/Commands/Register.txt | 13 +- hledger/defs.m4 | 2 +- hledger/hledger.1 | 104 +-- hledger/hledger.info | 365 ++++++----- hledger/hledger.txt | 742 +++++++++++----------- 21 files changed, 1013 insertions(+), 915 deletions(-) diff --git a/hledger-lib/defs.m4 b/hledger-lib/defs.m4 index 91bb58d4c..628ffc87b 100644 --- a/hledger-lib/defs.m4 +++ b/hledger-lib/defs.m4 @@ -4,4 +4,4 @@ m4_dnl Program version. Updated by make setversion. m4_define({{_version_}}, {{1.18.99}})m4_dnl m4_dnl m4_dnl Date to show in man pages. Updated by make setdate. -m4_define({{_monthyear_}}, {{July 2020}})m4_dnl +m4_define({{_monthyear_}}, {{August 2020}})m4_dnl diff --git a/hledger-lib/hledger_csv.5 b/hledger-lib/hledger_csv.5 index 7febe0205..ea6dd2f22 100644 --- a/hledger-lib/hledger_csv.5 +++ b/hledger-lib/hledger_csv.5 @@ -1,6 +1,6 @@ .\"t -.TH "hledger_csv" "5" "July 2020" "hledger 1.18.99" "hledger User Manuals" +.TH "hledger_csv" "5" "August 2020" "hledger 1.18.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_csv.txt b/hledger-lib/hledger_csv.txt index a25e3f354..5aebdaa41 100644 --- a/hledger-lib/hledger_csv.txt +++ b/hledger-lib/hledger_csv.txt @@ -914,4 +914,4 @@ SEE ALSO -hledger 1.18.99 July 2020 hledger_csv(5) +hledger 1.18.99 August 2020 hledger_csv(5) diff --git a/hledger-lib/hledger_journal.5 b/hledger-lib/hledger_journal.5 index 5e9b6805d..0c40725b9 100644 --- a/hledger-lib/hledger_journal.5 +++ b/hledger-lib/hledger_journal.5 @@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "July 2020" "hledger 1.18.99" "hledger User Manuals" +.TH "hledger_journal" "5" "August 2020" "hledger 1.18.99" "hledger User Manuals" @@ -670,10 +670,13 @@ hledger infer the price that balances the transaction: \f[R] .fi .RE +.IP "4." 3 +Like 1, but the \f[C]\[at]\f[R] is parenthesised, i.e. +\f[C](\[at])\f[R]; this is for compatibility with Ledger journals +(Virtual posting costs), and is equivalent to 1 in hledger. .IP "5." 3 -Like 1 and 2, but the \f[C]\[at]\f[R] or \f[C]\[at]\[at]\f[R] is -parenthesised; this is for compatibility with Ledger journals (Virtual -posting costs), and in hledger is equivalent to 1 and 2. +Like 2, but as in 4 the \f[C]\[at]\[at]\f[R] is parenthesised, i.e. +\f[C](\[at]\[at])\f[R]; in hledger, this is equivalent to 2. .PP Use the \f[C]-B/--cost\f[R] flag to convert amounts to their transaction price\[aq]s commodity, if any. @@ -1646,7 +1649,7 @@ Eg: .IP .nf \f[C] -alias /\[ha](.+):bank:([\[ha]:]+)(.*)/ = \[rs]1:\[rs]2 \[rs]3 +alias /\[ha](.+):bank:([\[ha]:]+):(.*)/ = \[rs]1:\[rs]2 \[rs]3 ; rewrites \[dq]assets:bank:wells fargo:checking\[dq] to \[dq]assets:wells fargo checking\[dq] \f[R] .fi diff --git a/hledger-lib/hledger_journal.info b/hledger-lib/hledger_journal.info index eba8e6fec..2317078ad 100644 --- a/hledger-lib/hledger_journal.info +++ b/hledger-lib/hledger_journal.info @@ -593,9 +593,12 @@ certain date. assets:euros €100 ; one hundred euros purchased assets:dollars $-135 ; for $135 - 4. 5. Like 1 and 2, but the '@' or '@@' is parenthesised; this is for - compatibility with Ledger journals (Virtual posting costs), and in - hledger is equivalent to 1 and 2. + 4. Like 1, but the '@' is parenthesised, i.e. '(@)'; this is for + compatibility with Ledger journals (Virtual posting costs), and is + equivalent to 1 in hledger. + + 5. Like 2, but as in 4 the '@@' is parenthesised, i.e. '(@@)'; in + hledger, this is equivalent to 2. Use the '-B/--cost' flag to convert amounts to their transaction price's commodity, if any. (mnemonic: "B" is from "cost Basis", as in @@ -1440,7 +1443,7 @@ inside an account name, the matched part will be replaced by REPLACEMENT. If REGEX contains parenthesised match groups, these can be referenced by the usual numeric backreferences in REPLACEMENT. Eg: -alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 +alias /^(.+):bank:([^:]+):(.*)/ = \1:\2 \3 ; rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking" Also note that REPLACEMENT continues to the end of line (or on @@ -1896,90 +1899,90 @@ Node: Amount display style18138 Ref: #amount-display-style18292 Node: Transaction prices19729 Ref: #transaction-prices19901 -Node: Lot prices and lot dates22233 -Ref: #lot-prices-and-lot-dates22430 -Node: Balance assertions22918 -Ref: #balance-assertions23104 -Node: Assertions and ordering24137 -Ref: #assertions-and-ordering24325 -Node: Assertions and included files25025 -Ref: #assertions-and-included-files25268 -Node: Assertions and multiple -f options25601 -Ref: #assertions-and-multiple--f-options25857 -Node: Assertions and commodities25989 -Ref: #assertions-and-commodities26221 -Node: Assertions and prices27378 -Ref: #assertions-and-prices27592 -Node: Assertions and subaccounts28032 -Ref: #assertions-and-subaccounts28261 -Node: Assertions and virtual postings28585 -Ref: #assertions-and-virtual-postings28827 -Node: Assertions and precision28969 -Ref: #assertions-and-precision29162 -Node: Balance assignments29429 -Ref: #balance-assignments29603 -Node: Balance assignments and prices30767 -Ref: #balance-assignments-and-prices30939 -Node: Directives31163 -Ref: #directives31322 -Node: Directives and multiple files37013 -Ref: #directives-and-multiple-files37196 -Node: Comment blocks37860 -Ref: #comment-blocks38043 -Node: Including other files38219 -Ref: #including-other-files38399 -Node: Default year39323 -Ref: #default-year39492 -Node: Declaring commodities39899 -Ref: #declaring-commodities40082 -Node: Default commodity41888 -Ref: #default-commodity42074 -Node: Declaring market prices42963 -Ref: #declaring-market-prices43158 -Node: Declaring accounts44015 -Ref: #declaring-accounts44201 -Node: Account comments45126 -Ref: #account-comments45289 -Node: Account subdirectives45713 -Ref: #account-subdirectives45908 -Node: Account types46221 -Ref: #account-types46405 -Node: Account display order49451 -Ref: #account-display-order49621 -Node: Rewriting accounts50772 -Ref: #rewriting-accounts50957 -Node: Basic aliases51714 -Ref: #basic-aliases51860 -Node: Regex aliases52564 -Ref: #regex-aliases52736 -Node: Combining aliases53454 -Ref: #combining-aliases53647 -Node: Aliases and multiple files54923 -Ref: #aliases-and-multiple-files55132 -Node: end aliases55711 -Ref: #end-aliases55868 -Node: Default parent account55969 -Ref: #default-parent-account56137 -Node: Periodic transactions57021 -Ref: #periodic-transactions57196 -Node: Periodic rule syntax59068 -Ref: #periodic-rule-syntax59274 -Node: Two spaces between period expression and description!59978 -Ref: #two-spaces-between-period-expression-and-description60297 -Node: Forecasting with periodic transactions60981 -Ref: #forecasting-with-periodic-transactions61286 -Node: Budgeting with periodic transactions63341 -Ref: #budgeting-with-periodic-transactions63580 -Node: Auto postings64029 -Ref: #auto-postings64169 -Node: Auto postings and multiple files66348 -Ref: #auto-postings-and-multiple-files66552 -Node: Auto postings and dates66761 -Ref: #auto-postings-and-dates67035 -Node: Auto postings and transaction balancing / inferred amounts / balance assertions67210 -Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions67561 -Node: Auto posting tags67903 -Ref: #auto-posting-tags68118 +Node: Lot prices and lot dates22332 +Ref: #lot-prices-and-lot-dates22529 +Node: Balance assertions23017 +Ref: #balance-assertions23203 +Node: Assertions and ordering24236 +Ref: #assertions-and-ordering24424 +Node: Assertions and included files25124 +Ref: #assertions-and-included-files25367 +Node: Assertions and multiple -f options25700 +Ref: #assertions-and-multiple--f-options25956 +Node: Assertions and commodities26088 +Ref: #assertions-and-commodities26320 +Node: Assertions and prices27477 +Ref: #assertions-and-prices27691 +Node: Assertions and subaccounts28131 +Ref: #assertions-and-subaccounts28360 +Node: Assertions and virtual postings28684 +Ref: #assertions-and-virtual-postings28926 +Node: Assertions and precision29068 +Ref: #assertions-and-precision29261 +Node: Balance assignments29528 +Ref: #balance-assignments29702 +Node: Balance assignments and prices30866 +Ref: #balance-assignments-and-prices31038 +Node: Directives31262 +Ref: #directives31421 +Node: Directives and multiple files37112 +Ref: #directives-and-multiple-files37295 +Node: Comment blocks37959 +Ref: #comment-blocks38142 +Node: Including other files38318 +Ref: #including-other-files38498 +Node: Default year39422 +Ref: #default-year39591 +Node: Declaring commodities39998 +Ref: #declaring-commodities40181 +Node: Default commodity41987 +Ref: #default-commodity42173 +Node: Declaring market prices43062 +Ref: #declaring-market-prices43257 +Node: Declaring accounts44114 +Ref: #declaring-accounts44300 +Node: Account comments45225 +Ref: #account-comments45388 +Node: Account subdirectives45812 +Ref: #account-subdirectives46007 +Node: Account types46320 +Ref: #account-types46504 +Node: Account display order49550 +Ref: #account-display-order49720 +Node: Rewriting accounts50871 +Ref: #rewriting-accounts51056 +Node: Basic aliases51813 +Ref: #basic-aliases51959 +Node: Regex aliases52663 +Ref: #regex-aliases52835 +Node: Combining aliases53554 +Ref: #combining-aliases53747 +Node: Aliases and multiple files55023 +Ref: #aliases-and-multiple-files55232 +Node: end aliases55811 +Ref: #end-aliases55968 +Node: Default parent account56069 +Ref: #default-parent-account56237 +Node: Periodic transactions57121 +Ref: #periodic-transactions57296 +Node: Periodic rule syntax59168 +Ref: #periodic-rule-syntax59374 +Node: Two spaces between period expression and description!60078 +Ref: #two-spaces-between-period-expression-and-description60397 +Node: Forecasting with periodic transactions61081 +Ref: #forecasting-with-periodic-transactions61386 +Node: Budgeting with periodic transactions63441 +Ref: #budgeting-with-periodic-transactions63680 +Node: Auto postings64129 +Ref: #auto-postings64269 +Node: Auto postings and multiple files66448 +Ref: #auto-postings-and-multiple-files66652 +Node: Auto postings and dates66861 +Ref: #auto-postings-and-dates67135 +Node: Auto postings and transaction balancing / inferred amounts / balance assertions67310 +Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions67661 +Node: Auto posting tags68003 +Ref: #auto-posting-tags68218  End Tag Table diff --git a/hledger-lib/hledger_journal.txt b/hledger-lib/hledger_journal.txt index 77a1d31fa..2cd7cc5fa 100644 --- a/hledger-lib/hledger_journal.txt +++ b/hledger-lib/hledger_journal.txt @@ -472,11 +472,14 @@ FILE FORMAT assets:euros EUR100 ; one hundred euros purchased assets:dollars $-135 ; for $135 - 5. Like 1 and 2, but the @ or @@ is parenthesised; this is for compati- - bility with Ledger journals (Virtual posting costs), and in hledger - is equivalent to 1 and 2. + 4. Like 1, but the @ is parenthesised, i.e. (@); this is for compati- + bility with Ledger journals (Virtual posting costs), and is equiva- + lent to 1 in hledger. - Use the -B/--cost flag to convert amounts to their transaction price's + 5. Like 2, but as in 4 the @@ is parenthesised, i.e. (@@); in hledger, + this is equivalent to 2. + + Use the -B/--cost flag to convert amounts to their transaction price's commodity, if any. (mnemonic: "B" is from "cost Basis", as in Ledger). Eg here is how -B affects the balance report for the example above: @@ -487,8 +490,8 @@ FILE FORMAT $-135 assets:dollars $135 assets:euros # <- the euros' cost - Note -B is sensitive to the order of postings when a transaction price - is inferred: the inferred price will be in the commodity of the last + Note -B is sensitive to the order of postings when a transaction price + is inferred: the inferred price will be in the commodity of the last amount. So if example 3's postings are reversed, while the transaction is equivalent, -B shows something different: @@ -501,18 +504,18 @@ FILE FORMAT EUR100 assets:euros Lot prices and lot dates - Ledger allows another kind of price, lot price (four variants: {UNIT- + Ledger allows another kind of price, lot price (four variants: {UNIT- PRICE}, {{TOTALPRICE}}, {=FIXEDUNITPRICE}, {{=FIXEDTOTALPRICE}}), and/or a lot date ([DATE]) to be specified. These are normally used to - select a lot when selling investments. hledger will parse these, for - compatibility with Ledger journals, but currently ignores them. A - transaction price, lot price and/or lot date may appear in any order, + select a lot when selling investments. hledger will parse these, for + compatibility with Ledger journals, but currently ignores them. A + transaction price, lot price and/or lot date may appear in any order, after the posting amount and before the balance assertion if any. Balance assertions - hledger supports Ledger-style balance assertions in journal files. - These look like, for example, = EXPECTEDBALANCE following a posting's - amount. Eg here we assert the expected dollar balance in accounts a + hledger supports Ledger-style balance assertions in journal files. + These look like, for example, = EXPECTEDBALANCE following a posting's + amount. Eg here we assert the expected dollar balance in accounts a and b after each posting: 2013/1/1 @@ -524,32 +527,32 @@ FILE FORMAT b $-1 =$-2 After reading a journal file, hledger will check all balance assertions - and report an error if any of them fail. Balance assertions can pro- - tect you from, eg, inadvertently disrupting reconciled balances while - cleaning up old entries. You can disable them temporarily with the + and report an error if any of them fail. Balance assertions can pro- + tect you from, eg, inadvertently disrupting reconciled balances while + cleaning up old entries. You can disable them temporarily with the -I/--ignore-assertions flag, which can be useful for troubleshooting or - for reading Ledger files. (Note: this flag currently does not disable + for reading Ledger files. (Note: this flag currently does not disable balance assignments, below). Assertions and ordering - hledger sorts an account's postings and assertions first by date and - then (for postings on the same day) by parse order. Note this is dif- + hledger sorts an account's postings and assertions first by date and + then (for postings on the same day) by parse order. Note this is dif- ferent from Ledger, which sorts assertions only by parse order. (Also, - Ledger assertions do not see the accumulated effect of repeated post- + Ledger assertions do not see the accumulated effect of repeated post- ings to the same account within a transaction.) So, hledger balance assertions keep working if you reorder differently- - dated transactions within the journal. But if you reorder same-dated - transactions or postings, assertions might break and require updating. + dated transactions within the journal. But if you reorder same-dated + transactions or postings, assertions might break and require updating. This order dependence does bring an advantage: precise control over the order of postings and assertions within a day, so you can assert intra- day balances. Assertions and included files - With included files, things are a little more complicated. Including - preserves the ordering of postings and assertions. If you have multi- - ple postings to an account on the same day, split across different - files, and you also want to assert the account's balance on the same + With included files, things are a little more complicated. Including + preserves the ordering of postings and assertions. If you have multi- + ple postings to an account on the same day, split across different + files, and you also want to assert the account's balance on the same day, you'll have to put the assertion in the right file. Assertions and multiple -f options @@ -557,15 +560,15 @@ FILE FORMAT -f options. Use include or concatenate the files instead. Assertions and commodities - The asserted balance must be a simple single-commodity amount, and in - fact the assertion checks only this commodity's balance within the - (possibly multi-commodity) account balance. This is how assertions + The asserted balance must be a simple single-commodity amount, and in + fact the assertion checks only this commodity's balance within the + (possibly multi-commodity) account balance. This is how assertions work in Ledger also. We could call this a "partial" balance assertion. To assert the balance of more than one commodity in an account, you can write multiple postings, each asserting one commodity's balance. - You can make a stronger "total" balance assertion by writing a double + You can make a stronger "total" balance assertion by writing a double equals sign (== EXPECTEDBALANCE). This asserts that there are no other unasserted commodities in the account (or, that their balance is 0). @@ -585,7 +588,7 @@ FILE FORMAT a 0 == $1 It's not yet possible to make a complete assertion about a balance that - has multiple commodities. One workaround is to isolate each commodity + has multiple commodities. One workaround is to isolate each commodity into its own subaccount: 2013/1/1 @@ -599,21 +602,21 @@ FILE FORMAT a:euro 0 == 1EUR Assertions and prices - Balance assertions ignore transaction prices, and should normally be + Balance assertions ignore transaction prices, and should normally be written without one: 2019/1/1 (a) $1 @ EUR1 = $1 - We do allow prices to be written there, however, and print shows them, - even though they don't affect whether the assertion passes or fails. - This is for backward compatibility (hledger's close command used to - generate balance assertions with prices), and because balance assign- + We do allow prices to be written there, however, and print shows them, + even though they don't affect whether the assertion passes or fails. + This is for backward compatibility (hledger's close command used to + generate balance assertions with prices), and because balance assign- ments do use them (see below). Assertions and subaccounts - The balance assertions above (= and ==) do not count the balance from - subaccounts; they check the account's exclusive balance only. You can + The balance assertions above (= and ==) do not count the balance from + subaccounts; they check the account's exclusive balance only. You can assert the balance including subaccounts by writing =* or ==*, eg: 2019/1/1 @@ -627,16 +630,16 @@ FILE FORMAT tual. They are not affected by the --real/-R flag or real: query. Assertions and precision - Balance assertions compare the exactly calculated amounts, which are - not always what is shown by reports. Eg a commodity directive may - limit the display precision, but this will not affect balance asser- + Balance assertions compare the exactly calculated amounts, which are + not always what is shown by reports. Eg a commodity directive may + limit the display precision, but this will not affect balance asser- tions. Balance assertion failure messages show exact amounts. Balance assignments - Ledger-style balance assignments are also supported. These are like - balance assertions, but with no posting amount on the left side of the - equals sign; instead it is calculated automatically so as to satisfy - the assertion. This can be a convenience during data entry, eg when + Ledger-style balance assignments are also supported. These are like + balance assertions, but with no posting amount on the left side of the + equals sign; instead it is calculated automatically so as to satisfy + the assertion. This can be a convenience during data entry, eg when setting opening balances: ; starting a new journal, set asset account balances @@ -654,14 +657,14 @@ FILE FORMAT expenses:misc The calculated amount depends on the account's balance in the commodity - at that point (which depends on the previously-dated postings of the - commodity to that account since the last balance assertion or assign- + at that point (which depends on the previously-dated postings of the + commodity to that account since the last balance assertion or assign- ment). Note that using balance assignments makes your journal a little less explicit; to know the exact amount posted, you have to run hledger or do the calculations yourself, instead of just reading it. Balance assignments and prices - A transaction price in a balance assignment will cause the calculated + A transaction price in a balance assignment will cause the calculated amount to have that price attached: 2019/1/1 @@ -672,87 +675,88 @@ FILE FORMAT (a) $1 @ EUR2 = $1 @ EUR2 Directives - A directive is a line in the journal beginning with a special keyword, + A directive is a line in the journal beginning with a special keyword, that influences how the journal is processed. hledger's directives are based on a subset of Ledger's, but there are many differences (and also some differences between hledger versions). Directives' behaviour and interactions can get a little bit complex, so - here is a table summarising the directives and their effects, with + here is a table summarising the directives and their effects, with links to more detailed docs. - direc- end di- subdi- purpose can affect (as of + direc- end di- subdi- purpose can affect (as of tive rective rec- 2018/06) tives ------------------------------------------------------------------------------------ - account any document account names, de- all entries in all - text clare account types & dis- files, before or + account any document account names, de- all entries in all + text clare account types & dis- files, before or play order after alias end rewrite account names following in- aliases line/included en- - tries until end of + tries until end of current file or end directive - apply end apply prepend a common parent to following in- + apply end apply prepend a common parent to following in- account account account names line/included en- - tries until end of + tries until end of current file or end directive comment end com- ignore part of journal following in- ment line/included en- - tries until end of + tries until end of current file or end directive - commod- format declare a commodity and its number notation: + commod- format declare a commodity and its number notation: ity number notation & display following entries style in that commodity - in all files; dis- + in all files; dis- play style: amounts of that commodity in reports - D declare a commodity to be default commodity: + D declare a commodity to be default commodity: used for commodityless following commod- - amounts, and its number no- ityless entries un- - tation & display style til end of current - file; number nota- + amounts, and its number no- ityless entries un- + tation & display style til end of current + file; number nota- tion: following en- - tries in that com- + tries in that com- modity until end of - current file; dis- + current file; dis- play style: amounts of that commodity in reports include include entries/directives what the included from another file directives affect P declare a market price for a amounts of that - commodity commodity in re- - ports, when -V is + commodity commodity in re- + ports, when -V is used - Y declare a year for yearless following in- + + Y declare a year for yearless following in- dates line/included en- - tries until end of + tries until end of current file - = declare an auto posting all entries in par- - rule, adding postings to ent/current/child + = declare an auto posting all entries in par- + rule, adding postings to ent/current/child other transactions files (but not sib- ling files, see #1212) And some definitions: - subdi- optional indented directive line immediately following a parent + subdi- optional indented directive line immediately following a parent rec- directive tive number how to interpret numbers when parsing journal entries (the iden- - nota- tity of the decimal separator character). (Currently each com- + nota- tity of the decimal separator character). (Currently each com- tion modity can have its own notation, even in the same file.) - dis- how to display amounts of a commodity in reports (symbol side + dis- how to display amounts of a commodity in reports (symbol side play and spacing, digit groups, decimal separator, decimal places) style - direc- which entries and (when there are multiple files) which files + direc- which entries and (when there are multiple files) which files tive are affected by a directive scope @@ -761,35 +765,35 @@ FILE FORMAT ports). Some directives have multiple effects. Directives and multiple files - If you use multiple -f/--file options, or the include directive, - hledger will process multiple input files. But note that directives + If you use multiple -f/--file options, or the include directive, + hledger will process multiple input files. But note that directives which affect input (see above) typically last only until the end of the file in which they occur. This may seem inconvenient, but it's intentional; it makes reports sta- - ble and deterministic, independent of the order of input. Otherwise - you could see different numbers if you happened to write -f options in - a different order, or if you moved includes around while cleaning up + ble and deterministic, independent of the order of input. Otherwise + you could see different numbers if you happened to write -f options in + a different order, or if you moved includes around while cleaning up your files. - It can be surprising though; for example, it means that alias direc- + It can be surprising though; for example, it means that alias direc- tives do not affect parent or sibling files (see below). Comment blocks - A line containing just comment starts a commented region of the file, + A line containing just comment starts a commented region of the file, and a line containing just end comment (or the end of the current file) ends it. See also comments. Including other files - You can pull in the content of additional files by writing an include + You can pull in the content of additional files by writing an include directive, like this: include FILEPATH - Only journal files can include, and only journal, timeclock or timedot + Only journal files can include, and only journal, timeclock or timedot files can be included (not CSV files, currently). - If the file path does not begin with a slash, it is relative to the + If the file path does not begin with a slash, it is relative to the current file's folder. A tilde means home directory, eg: include ~/main.journal. @@ -798,17 +802,17 @@ FILE FORMAT *.journal. There is limited support for recursive wildcards: **/ (the slash is re- - quired) matches 0 or more subdirectories. It's not super convenient - since you have to avoid include cycles and including directories, but + quired) matches 0 or more subdirectories. It's not super convenient + since you have to avoid include cycles and including directories, but this can be done, eg: include */**/*.journal. The path may also be prefixed to force a specific file format, overrid- - ing the file extension (as described in hledger.1 -> Input files): in- + ing the file extension (as described in hledger.1 -> Input files): in- clude timedot:~/notes/2020*.md. Default year - You can set a default year to be used for subsequent dates which don't - specify a year. This is a line beginning with Y followed by the year. + You can set a default year to be used for subsequent dates which don't + specify a year. This is a line beginning with Y followed by the year. Eg: Y2009 ; set default year to 2009 @@ -830,19 +834,19 @@ FILE FORMAT Declaring commodities The commodity directive has several functions: - 1. It declares commodities which may be used in the journal. This is + 1. It declares commodities which may be used in the journal. This is currently not enforced, but can serve as documentation. - 2. It declares what decimal mark character (period or comma) to expect - when parsing input - useful to disambiguate international number - formats in your data. (Without this, hledger will parse both 1,000 + 2. It declares what decimal mark character (period or comma) to expect + when parsing input - useful to disambiguate international number + formats in your data. (Without this, hledger will parse both 1,000 and 1.000 as 1). - 3. It declares the amount display style to use in output - decimal and + 3. It declares the amount display style to use in output - decimal and digit group marks, number of decimal places, symbol placement etc. - You are likely to run into one of the problems solved by commodity di- - rectives, sooner or later, so it's a good idea to just always use them + You are likely to run into one of the problems solved by commodity di- + rectives, sooner or later, so it's a good idea to just always use them to declare your commodities. A commodity directive is just the word commodity followed by an amount. @@ -855,8 +859,8 @@ FILE FORMAT ; separating thousands with comma. commodity 1,000.0000 AAAA - or on multiple lines, using the "format" subdirective. (In this case - the commodity symbol appears twice and should be the same in both + or on multiple lines, using the "format" subdirective. (In this case + the commodity symbol appears twice and should be the same in both places.): ; commodity SYMBOL @@ -869,22 +873,22 @@ FILE FORMAT format INR 1,00,00,000.00 The quantity of the amount does not matter; only the format is signifi- - cant. The number must include a decimal mark: either a period or a + cant. The number must include a decimal mark: either a period or a comma, followed by 0 or more decimal digits. - Note hledger normally uses banker's rounding, so 0.5 displayed with + Note hledger normally uses banker's rounding, so 0.5 displayed with zero decimal digits is "0". (More at Amount display style.) Default commodity - The D directive sets a default commodity, to be used for amounts with- + The D directive sets a default commodity, to be used for amounts with- out a commodity symbol (ie, plain numbers). This commodity will be ap- plied to all subsequent commodity-less amounts, or until the next D di- rective. (Note, this is different from Ledger's D.) - For compatibility/historical reasons, D also acts like a commodity di- + For compatibility/historical reasons, D also acts like a commodity di- rective, setting the commodity's display style (for output) and decimal mark (for parsing input). As with commodity, the amount must always be - written with a decimal mark (period or comma). If both directives are + written with a decimal mark (period or comma). If both directives are used, commodity's style takes precedence. The syntax is D AMOUNT. Eg: @@ -898,9 +902,9 @@ FILE FORMAT b Declaring market prices - The P directive declares a market price, which is an exchange rate be- - tween two commodities on a certain date. (In Ledger, they are called - "historical prices".) These are often obtained from a stock exchange, + The P directive declares a market price, which is an exchange rate be- + tween two commodities on a certain date. (In Ledger, they are called + "historical prices".) These are often obtained from a stock exchange, cryptocurrency exchange, or the foreign exchange market. Here is the format: @@ -911,16 +915,16 @@ FILE FORMAT o COMMODITYA is the symbol of the commodity being priced - o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com- + o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com- modity, giving the price in commodity B of one unit of commodity A. - These two market price directives say that one euro was worth 1.35 US + These two market price directives say that one euro was worth 1.35 US dollars during 2009, and $1.40 from 2010 onward: P 2009/1/1 EUR $1.35 P 2010/1/1 EUR $1.40 - The -V, -X and --value flags use these market prices to show amount + The -V, -X and --value flags use these market prices to show amount values in another commodity. See Valuation. Declaring accounts @@ -930,20 +934,20 @@ FILE FORMAT o They can document your intended chart of accounts, providing a refer- ence. - o They can store extra information about accounts (account numbers, + o They can store extra information about accounts (account numbers, notes, etc.) - o They can help hledger know your accounts' types (asset, liability, - equity, revenue, expense), useful for reports like balancesheet and + o They can help hledger know your accounts' types (asset, liability, + equity, revenue, expense), useful for reports like balancesheet and incomestatement. - o They control account display order in reports, allowing non-alpha- + o They control account display order in reports, allowing non-alpha- betic sorting (eg Revenues to appear above Expenses). - o They help with account name completion in the add command, hledger- + o They help with account name completion in the add command, hledger- iadd, hledger-web, ledger-mode etc. - The simplest form is just the word account followed by a hledger-style + The simplest form is just the word account followed by a hledger-style account name, eg: account assets:bank:checking @@ -951,7 +955,7 @@ FILE FORMAT Account comments Comments, beginning with a semicolon, can be added: - o on the same line, after two or more spaces (because ; is allowed in + o on the same line, after two or more spaces (because ; is allowed in account names) o on the next lines, indented @@ -965,7 +969,7 @@ FILE FORMAT Same-line comments are not supported by Ledger, or hledger <1.13. Account subdirectives - We also allow (and ignore) Ledger-style indented subdirectives, just + We also allow (and ignore) Ledger-style indented subdirectives, just for compatibility.: account assets:bank:checking @@ -984,21 +988,21 @@ FILE FORMAT Asset, Liability, Equity, Revenue, Expense. These account types are important for controlling which accounts appear - in the balancesheet, balancesheetequity, incomestatement reports (and + in the balancesheet, balancesheetequity, incomestatement reports (and probably for other things in future). - Additionally, we recognise the Cash type, which is also an Asset, and - which causes accounts to appear in the cashflow report. ("Cash" here - means liquid assets, eg bank balances but typically not investments or + Additionally, we recognise the Cash type, which is also an Asset, and + which causes accounts to appear in the cashflow report. ("Cash" here + means liquid assets, eg bank balances but typically not investments or receivables.) Declaring account types Generally, to make these reports work you should declare your top-level accounts and their types, using account directives with type: tags. - The tag's value should be one of: Asset, Liability, Equity, Revenue, - Expense, Cash, A, L, E, R, X, C (all case insensitive). The type is - inherited by all subaccounts except where they override it. Here's a + The tag's value should be one of: Asset, Liability, Equity, Revenue, + Expense, Cash, A, L, E, R, X, C (all case insensitive). The type is + inherited by all subaccounts except where they override it. Here's a complete example: account assets ; type: Asset @@ -1010,8 +1014,8 @@ FILE FORMAT account expenses ; type: Expense Auto-detected account types - If you happen to use common english top-level account names, you may - not need to declare account types, as they will be detected automati- + If you happen to use common english top-level account names, you may + not need to declare account types, as they will be detected automati- cally using the following rules: If name matches regular account type is: @@ -1024,7 +1028,7 @@ FILE FORMAT ^(income|revenue)s?(:|$) Revenue ^expenses?(:|$) Expense - If account type is Asset and name does not contain regu- account type + If account type is Asset and name does not contain regu- account type lar expression: is: -------------------------------------------------------------------------- (investment|receivable|:A/R|:fixed) Cash @@ -1034,9 +1038,9 @@ FILE FORMAT Interference from auto-detected account types If you assign any account type, it's a good idea to assign all of them, - to prevent any confusion from mixing declared and auto-detected types. - Although it's unlikely to happen in real life, here's an example: with - the following journal, balancesheetequity shows "liabilities" in both + to prevent any confusion from mixing declared and auto-detected types. + Although it's unlikely to happen in real life, here's an example: with + the following journal, balancesheetequity shows "liabilities" in both Liabilities and Equity sections. Declaring another account as type:Li- ability would fix it: @@ -1048,8 +1052,8 @@ FILE FORMAT equity -2 Old account type syntax - In some hledger journals you might instead see this old syntax (the - letters ALERX, separated from the account name by two or more spaces); + In some hledger journals you might instead see this old syntax (the + letters ALERX, separated from the account name by two or more spaces); this is deprecated and may be removed soon: account assets A @@ -1059,8 +1063,8 @@ FILE FORMAT account expenses X Account display order - Account directives also set the order in which accounts are displayed, - eg in reports, the hledger-ui accounts screen, and the hledger-web + Account directives also set the order in which accounts are displayed, + eg in reports, the hledger-ui accounts screen, and the hledger-web sidebar. By default accounts are listed in alphabetical order. But if you have these account directives in the journal: @@ -1082,20 +1086,20 @@ FILE FORMAT Undeclared accounts, if any, are displayed last, in alphabetical order. - Note that sorting is done at each level of the account tree (within - each group of sibling accounts under the same parent). And currently, + Note that sorting is done at each level of the account tree (within + each group of sibling accounts under the same parent). And currently, this directive: account other:zoo - would influence the position of zoo among other's subaccounts, but not + would influence the position of zoo among other's subaccounts, but not the position of other among the top-level accounts. This means: - o you will sometimes declare parent accounts (eg account other above) + o you will sometimes declare parent accounts (eg account other above) that you don't intend to post to, just to customize their display or- der - o sibling accounts stay together (you couldn't display x:y in between + o sibling accounts stay together (you couldn't display x:y in between a:b and a:c). Rewriting accounts @@ -1113,14 +1117,14 @@ FILE FORMAT o customising reports Account aliases also rewrite account names in account directives. They - do not affect account names being entered via hledger add or hledger- + do not affect account names being entered via hledger add or hledger- web. See also Rewrite account names. Basic aliases - To set an account alias, use the alias directive in your journal file. - This affects all subsequent journal entries in the current file or its + To set an account alias, use the alias directive in your journal file. + This affects all subsequent journal entries in the current file or its included files. The spaces around the = are optional: alias OLD = NEW @@ -1128,49 +1132,49 @@ FILE FORMAT Or, you can use the --alias 'OLD=NEW' option on the command line. This affects all entries. It's useful for trying out aliases interactively. - OLD and NEW are case sensitive full account names. hledger will re- - place any occurrence of the old account name with the new one. Subac- + OLD and NEW are case sensitive full account names. hledger will re- + place any occurrence of the old account name with the new one. Subac- counts are also affected. Eg: alias checking = assets:bank:wells fargo:checking ; rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a" Regex aliases - There is also a more powerful variant that uses a regular expression, + There is also a more powerful variant that uses a regular expression, indicated by the forward slashes: alias /REGEX/ = REPLACEMENT or --alias '/REGEX/=REPLACEMENT'. - REGEX is a case-insensitive regular expression. Anywhere it matches - inside an account name, the matched part will be replaced by REPLACE- - MENT. If REGEX contains parenthesised match groups, these can be ref- + REGEX is a case-insensitive regular expression. Anywhere it matches + inside an account name, the matched part will be replaced by REPLACE- + MENT. If REGEX contains parenthesised match groups, these can be ref- erenced by the usual numeric backreferences in REPLACEMENT. Eg: - alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 + alias /^(.+):bank:([^:]+):(.*)/ = \1:\2 \3 ; rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking" - Also note that REPLACEMENT continues to the end of line (or on command - line, to end of option argument), so it can contain trailing white- + Also note that REPLACEMENT continues to the end of line (or on command + line, to end of option argument), so it can contain trailing white- space. Combining aliases - You can define as many aliases as you like, using journal directives + You can define as many aliases as you like, using journal directives and/or command line options. - Recursive aliases - where an account name is rewritten by one alias, - then by another alias, and so on - are allowed. Each alias sees the + Recursive aliases - where an account name is rewritten by one alias, + then by another alias, and so on - are allowed. Each alias sees the effect of previously applied aliases. - In such cases it can be important to understand which aliases will be - applied and in which order. For (each account name in) each journal + In such cases it can be important to understand which aliases will be + applied and in which order. For (each account name in) each journal entry, we apply: - 1. alias directives preceding the journal entry, most recently parsed + 1. alias directives preceding the journal entry, most recently parsed first (ie, reading upward from the journal entry, bottom to top) - 2. --alias options, in the order they appeared on the command line + 2. --alias options, in the order they appeared on the command line (left to right). In other words, for (an account name in) a given journal entry: @@ -1181,20 +1185,20 @@ FILE FORMAT o aliases defined after/below the entry do not affect it. - This gives nearby aliases precedence over distant ones, and helps pro- - vide semantic stability - aliases will keep working the same way inde- + This gives nearby aliases precedence over distant ones, and helps pro- + vide semantic stability - aliases will keep working the same way inde- pendent of which files are being read and in which order. - In case of trouble, adding --debug=6 to the command line will show + In case of trouble, adding --debug=6 to the command line will show which aliases are being applied when. Aliases and multiple files - As explained at Directives and multiple files, alias directives do not + As explained at Directives and multiple files, alias directives do not affect parent or sibling files. Eg in this command, hledger -f a.aliases -f b.journal - account aliases defined in a.aliases will not affect b.journal. In- + account aliases defined in a.aliases will not affect b.journal. In- cluding the aliases doesn't work either: include a.aliases @@ -1216,14 +1220,14 @@ FILE FORMAT include c.journal ; also affected end aliases - You can clear (forget) all currently defined aliases with the end + You can clear (forget) all currently defined aliases with the end aliases directive: end aliases Default parent account - You can specify a parent account which will be prepended to all ac- - counts within a section of the journal. Use the apply account and end + You can specify a parent account which will be prepended to all ac- + counts within a section of the journal. Use the apply account and end apply account directives like so: apply account home @@ -1240,7 +1244,7 @@ FILE FORMAT home:food $10 home:cash $-10 - If end apply account is omitted, the effect lasts to the end of the + If end apply account is omitted, the effect lasts to the end of the file. Included files are also affected, eg: apply account business @@ -1249,50 +1253,50 @@ FILE FORMAT apply account personal include personal.journal - Prior to hledger 1.0, legacy account and end spellings were also sup- + Prior to hledger 1.0, legacy account and end spellings were also sup- ported. - A default parent account also affects account directives. It does not - affect account names being entered via hledger add or hledger-web. If - account aliases are present, they are applied after the default parent + A default parent account also affects account directives. It does not + affect account names being entered via hledger add or hledger-web. If + account aliases are present, they are applied after the default parent account. Periodic transactions - Periodic transaction rules describe transactions that recur. They al- - low hledger to generate temporary future transactions to help with - forecasting, so you don't have to write out each one in the journal, - and it's easy to try out different forecasts. Secondly, they are also + Periodic transaction rules describe transactions that recur. They al- + low hledger to generate temporary future transactions to help with + forecasting, so you don't have to write out each one in the journal, + and it's easy to try out different forecasts. Secondly, they are also used to define the budgets shown in budget reports. - Periodic transactions can be a little tricky, so before you use them, + Periodic transactions can be a little tricky, so before you use them, read this whole section - or at least these tips: - 1. Two spaces accidentally added or omitted will cause you trouble - + 1. Two spaces accidentally added or omitted will cause you trouble - read about this below. - 2. For troubleshooting, show the generated transactions with hledger - print --forecast tag:generated or hledger register --forecast + 2. For troubleshooting, show the generated transactions with hledger + print --forecast tag:generated or hledger register --forecast tag:generated. - 3. Forecasted transactions will begin only after the last non-fore- + 3. Forecasted transactions will begin only after the last non-fore- casted transaction's date. - 4. Forecasted transactions will end 6 months from today, by default. + 4. Forecasted transactions will end 6 months from today, by default. See below for the exact start/end rules. - 5. period expressions can be tricky. Their documentation needs im- + 5. period expressions can be tricky. Their documentation needs im- provement, but is worth studying. - 6. Some period expressions with a repeating interval must begin on a - natural boundary of that interval. Eg in weekly from DATE, DATE - must be a monday. ~ weekly from 2019/10/1 (a tuesday) will give an + 6. Some period expressions with a repeating interval must begin on a + natural boundary of that interval. Eg in weekly from DATE, DATE + must be a monday. ~ weekly from 2019/10/1 (a tuesday) will give an error. 7. Other period expressions with an interval are automatically expanded - to cover a whole number of that interval. (This is done to improve + to cover a whole number of that interval. (This is done to improve reports, but it also affects periodic transactions. Yes, it's a bit - inconsistent with the above.) Eg: ~ every 10th day of month from - 2020/01, which is equivalent to ~ every 10th day of month from + inconsistent with the above.) Eg: ~ every 10th day of month from + 2020/01, which is equivalent to ~ every 10th day of month from 2020/01/01, will be adjusted to start on 2019/12/10. Periodic rule syntax @@ -1304,17 +1308,17 @@ FILE FORMAT expenses:rent $2000 assets:bank:checking - There is an additional constraint on the period expression: the start - date must fall on a natural boundary of the interval. Eg monthly from + There is an additional constraint on the period expression: the start + date must fall on a natural boundary of the interval. Eg monthly from 2018/1/1 is valid, but monthly from 2018/1/15 is not. - Partial or relative dates (M/D, D, tomorrow, last week) in the period - expression can work (useful or not). They will be relative to today's - date, unless a Y default year directive is in effect, in which case + Partial or relative dates (M/D, D, tomorrow, last week) in the period + expression can work (useful or not). They will be relative to today's + date, unless a Y default year directive is in effect, in which case they will be relative to Y/1/1. Two spaces between period expression and description! - If the period expression is followed by a transaction description, + If the period expression is followed by a transaction description, these must be separated by two or more spaces. This helps hledger know where the period expression ends, so that descriptions can not acciden- tally alter their meaning, as in this example: @@ -1328,68 +1332,68 @@ FILE FORMAT So, - o Do write two spaces between your period expression and your transac- + o Do write two spaces between your period expression and your transac- tion description, if any. - o Don't accidentally write two spaces in the middle of your period ex- + o Don't accidentally write two spaces in the middle of your period ex- pression. Forecasting with periodic transactions - The --forecast flag activates any periodic transaction rules in the - journal. They will generate temporary recurring transactions, which - are not saved in the journal, but will appear in all reports (eg + The --forecast flag activates any periodic transaction rules in the + journal. They will generate temporary recurring transactions, which + are not saved in the journal, but will appear in all reports (eg print). This can be useful for estimating balances into the future, or - experimenting with different scenarios. Or, it can be used as a data + experimenting with different scenarios. Or, it can be used as a data entry aid: describe recurring transactions, and every so often copy the output of print --forecast into the journal. - These transactions will have an extra tag indicating which periodic + These transactions will have an extra tag indicating which periodic rule generated them: generated-transaction:~ PERIODICEXPR. And a simi- - lar, hidden tag (beginning with an underscore) which, because it's - never displayed by print, can be used to match transactions generated + lar, hidden tag (beginning with an underscore) which, because it's + never displayed by print, can be used to match transactions generated "just now": _generated-transaction:~ PERIODICEXPR. - Periodic transactions are generated within some forecast period. By + Periodic transactions are generated within some forecast period. By default, this o begins on the later of o the report start date if specified with -b/-p/date: - o the day after the latest normal (non-periodic) transaction in the + o the day after the latest normal (non-periodic) transaction in the journal, or today if there are no normal transactions. - o ends on the report end date if specified with -e/-p/date:, or 6 + o ends on the report end date if specified with -e/-p/date:, or 6 months (180 days) from today. - This means that periodic transactions will begin only after the latest - recorded transaction. And a recorded transaction dated in the future - can prevent generation of periodic transactions. (You can avoid that + This means that periodic transactions will begin only after the latest + recorded transaction. And a recorded transaction dated in the future + can prevent generation of periodic transactions. (You can avoid that by writing the future transaction as a one-time periodic rule instead - put tilde before the date, eg ~ YYYY-MM-DD ...). Or, you can set your own arbitrary "forecast period", which can overlap - recorded transactions, and need not be in the future, by providing an - option argument, like --forecast=PERIODEXPR. Note the equals sign is + recorded transactions, and need not be in the future, by providing an + option argument, like --forecast=PERIODEXPR. Note the equals sign is required, a space won't work. PERIODEXPR is a period expression, which - can specify the start date, end date, or both, like in a date: query. - (See also hledger.1 -> Report start & end date). Some examples: + can specify the start date, end date, or both, like in a date: query. + (See also hledger.1 -> Report start & end date). Some examples: --forecast=202001-202004, --forecast=jan-, --forecast=2020. Budgeting with periodic transactions - With the --budget flag, currently supported by the balance command, - each periodic transaction rule declares recurring budget goals for the - specified accounts. Eg the first example above declares a goal of - spending $2000 on rent (and also, a goal of depositing $2000 into - checking) every month. Goals and actual performance can then be com- + With the --budget flag, currently supported by the balance command, + each periodic transaction rule declares recurring budget goals for the + specified accounts. Eg the first example above declares a goal of + spending $2000 on rent (and also, a goal of depositing $2000 into + checking) every month. Goals and actual performance can then be com- pared in budget reports. - For more details, see: balance: Budget report and Budgeting and Fore- + For more details, see: balance: Budget report and Budgeting and Fore- casting. Auto postings - "Automated postings" or "auto postings" are extra postings which get - added automatically to transactions which match certain queries, de- + "Automated postings" or "auto postings" are extra postings which get + added automatically to transactions which match certain queries, de- fined by "auto posting rules", when you use the --auto flag. An auto posting rule looks a bit like a transaction: @@ -1399,27 +1403,27 @@ FILE FORMAT ... ACCOUNT [AMOUNT] - except the first line is an equals sign (mnemonic: = suggests match- - ing), followed by a query (which matches existing postings), and each - "posting" line describes a posting to be generated, and the posting + except the first line is an equals sign (mnemonic: = suggests match- + ing), followed by a query (which matches existing postings), and each + "posting" line describes a posting to be generated, and the posting amounts can be: - o a normal amount with a commodity symbol, eg $2. This will be used + o a normal amount with a commodity symbol, eg $2. This will be used as-is. o a number, eg 2. The commodity symbol (if any) from the matched post- ing will be added to this. - o a numeric multiplier, eg *2 (a star followed by a number N). The + o a numeric multiplier, eg *2 (a star followed by a number N). The matched posting's amount (and total price, if any) will be multiplied by N. - o a multiplier with a commodity symbol, eg *$2 (a star, number N, and + o a multiplier with a commodity symbol, eg *$2 (a star, number N, and symbol S). The matched posting's amount will be multiplied by N, and its commodity symbol will be replaced with S. - Any query term containing spaces must be enclosed in single or double - quotes, as on the command line. Eg, note the quotes around the second + Any query term containing spaces must be enclosed in single or double + quotes, as on the command line. Eg, note the quotes around the second query term below: = expenses:groceries 'expenses:dining out' @@ -1458,24 +1462,24 @@ FILE FORMAT Auto postings and multiple files An auto posting rule can affect any transaction in the current file, or - in any parent file or child file. Note, currently it will not affect + in any parent file or child file. Note, currently it will not affect sibling files (when multiple -f/--file are used - see #1212). Auto postings and dates - A posting date (or secondary date) in the matched posting, or (taking - precedence) a posting date in the auto posting rule itself, will also + A posting date (or secondary date) in the matched posting, or (taking + precedence) a posting date in the auto posting rule itself, will also be used in the generated posting. Auto postings and transaction balancing / inferred amounts / balance asser- tions Currently, auto postings are added: - o after missing amounts are inferred, and transactions are checked for + o after missing amounts are inferred, and transactions are checked for balancedness, o but before balance assertions are checked. - Note this means that journal entries must be balanced both before and + Note this means that journal entries must be balanced both before and after auto postings are added. This changed in hledger 1.12+; see #893 for background. @@ -1485,11 +1489,11 @@ FILE FORMAT o generated-posting:= QUERY - shows this was generated by an auto post- ing rule, and the query - o _generated-posting:= QUERY - a hidden tag, which does not appear in + o _generated-posting:= QUERY - a hidden tag, which does not appear in hledger's output. This can be used to match postings generated "just now", rather than generated in the past and saved to the journal. - Also, any transaction that has been changed by auto posting rules will + Also, any transaction that has been changed by auto posting rules will have these tags added: o modified: - this transaction was modified @@ -1500,7 +1504,7 @@ FILE FORMAT REPORTING BUGS - Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel + Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -1514,7 +1518,7 @@ COPYRIGHT SEE ALSO - hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), + hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -1522,4 +1526,4 @@ SEE ALSO -hledger 1.18.99 July 2020 hledger_journal(5) +hledger 1.18.99 August 2020 hledger_journal(5) diff --git a/hledger-lib/hledger_timeclock.5 b/hledger-lib/hledger_timeclock.5 index 3048f0d2d..5301c8749 100644 --- a/hledger-lib/hledger_timeclock.5 +++ b/hledger-lib/hledger_timeclock.5 @@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "July 2020" "hledger 1.18.99" "hledger User Manuals" +.TH "hledger_timeclock" "5" "August 2020" "hledger 1.18.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_timeclock.txt b/hledger-lib/hledger_timeclock.txt index c9319d92e..3ddc77d3f 100644 --- a/hledger-lib/hledger_timeclock.txt +++ b/hledger-lib/hledger_timeclock.txt @@ -78,4 +78,4 @@ SEE ALSO -hledger 1.18.99 July 2020 hledger_timeclock(5) +hledger 1.18.99 August 2020 hledger_timeclock(5) diff --git a/hledger-lib/hledger_timedot.5 b/hledger-lib/hledger_timedot.5 index c1f54a22a..df97a7e60 100644 --- a/hledger-lib/hledger_timedot.5 +++ b/hledger-lib/hledger_timedot.5 @@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "July 2020" "hledger 1.18.99" "hledger User Manuals" +.TH "hledger_timedot" "5" "August 2020" "hledger 1.18.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_timedot.txt b/hledger-lib/hledger_timedot.txt index f08e552c6..768a25019 100644 --- a/hledger-lib/hledger_timedot.txt +++ b/hledger-lib/hledger_timedot.txt @@ -161,4 +161,4 @@ SEE ALSO -hledger 1.18.99 July 2020 hledger_timedot(5) +hledger 1.18.99 August 2020 hledger_timedot(5) diff --git a/hledger-ui/defs.m4 b/hledger-ui/defs.m4 index 91bb58d4c..628ffc87b 100644 --- a/hledger-ui/defs.m4 +++ b/hledger-ui/defs.m4 @@ -4,4 +4,4 @@ m4_dnl Program version. Updated by make setversion. m4_define({{_version_}}, {{1.18.99}})m4_dnl m4_dnl m4_dnl Date to show in man pages. Updated by make setdate. -m4_define({{_monthyear_}}, {{July 2020}})m4_dnl +m4_define({{_monthyear_}}, {{August 2020}})m4_dnl diff --git a/hledger-ui/hledger-ui.1 b/hledger-ui/hledger-ui.1 index 32891bc97..6b0e6f7a4 100644 --- a/hledger-ui/hledger-ui.1 +++ b/hledger-ui/hledger-ui.1 @@ -1,5 +1,5 @@ -.TH "hledger-ui" "1" "July 2020" "hledger-ui 1.18.99" "hledger User Manuals" +.TH "hledger-ui" "1" "August 2020" "hledger-ui 1.18.99" "hledger User Manuals" diff --git a/hledger-ui/hledger-ui.txt b/hledger-ui/hledger-ui.txt index 3276b54ac..84e0727bf 100644 --- a/hledger-ui/hledger-ui.txt +++ b/hledger-ui/hledger-ui.txt @@ -456,4 +456,4 @@ SEE ALSO -hledger-ui 1.18.99 July 2020 hledger-ui(1) +hledger-ui 1.18.99 August 2020 hledger-ui(1) diff --git a/hledger-web/defs.m4 b/hledger-web/defs.m4 index 91bb58d4c..628ffc87b 100644 --- a/hledger-web/defs.m4 +++ b/hledger-web/defs.m4 @@ -4,4 +4,4 @@ m4_dnl Program version. Updated by make setversion. m4_define({{_version_}}, {{1.18.99}})m4_dnl m4_dnl m4_dnl Date to show in man pages. Updated by make setdate. -m4_define({{_monthyear_}}, {{July 2020}})m4_dnl +m4_define({{_monthyear_}}, {{August 2020}})m4_dnl diff --git a/hledger-web/hledger-web.1 b/hledger-web/hledger-web.1 index 2965976f1..03d144890 100644 --- a/hledger-web/hledger-web.1 +++ b/hledger-web/hledger-web.1 @@ -1,5 +1,5 @@ -.TH "hledger-web" "1" "July 2020" "hledger-web 1.18.99" "hledger User Manuals" +.TH "hledger-web" "1" "August 2020" "hledger-web 1.18.99" "hledger User Manuals" diff --git a/hledger-web/hledger-web.txt b/hledger-web/hledger-web.txt index d82a2ce41..5d2cab2f8 100644 --- a/hledger-web/hledger-web.txt +++ b/hledger-web/hledger-web.txt @@ -545,4 +545,4 @@ SEE ALSO -hledger-web 1.18.99 July 2020 hledger-web(1) +hledger-web 1.18.99 August 2020 hledger-web(1) diff --git a/hledger/Hledger/Cli/Commands/Register.txt b/hledger/Hledger/Cli/Commands/Register.txt index 0d0ab9d3e..368789f2e 100644 --- a/hledger/Hledger/Cli/Commands/Register.txt +++ b/hledger/Hledger/Cli/Commands/Register.txt @@ -3,9 +3,16 @@ Show postings and their running total. _FLAGS -The register command displays postings in date order, one per line, and -their running total. This is typically used with a query selecting a -particular account, to see that account's activity: +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 +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 see +that account's activity: $ hledger register checking 2008/01/01 income assets:bank:checking $1 $1 diff --git a/hledger/defs.m4 b/hledger/defs.m4 index 91bb58d4c..628ffc87b 100644 --- a/hledger/defs.m4 +++ b/hledger/defs.m4 @@ -4,4 +4,4 @@ m4_dnl Program version. Updated by make setversion. m4_define({{_version_}}, {{1.18.99}})m4_dnl m4_dnl m4_dnl Date to show in man pages. Updated by make setdate. -m4_define({{_monthyear_}}, {{July 2020}})m4_dnl +m4_define({{_monthyear_}}, {{August 2020}})m4_dnl diff --git a/hledger/hledger.1 b/hledger/hledger.1 index e533b601a..766236d5b 100644 --- a/hledger/hledger.1 +++ b/hledger/hledger.1 @@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "July 2020" "hledger 1.18.99" "hledger User Manuals" +.TH "hledger" "1" "August 2020" "hledger 1.18.99" "hledger User Manuals" @@ -1470,6 +1470,23 @@ just that day; equivalent to \[lq]2009/1/1 to 2009/1/2\[rq] T} .TE .PP +Or you can specify a single quarter like so: +.PP +.TS +tab(@); +l l. +T{ +\f[C]-p \[dq]2009Q1\[dq]\f[R] +T}@T{ +first quarter of 2009, equivalent to \[lq]2009/1/1 to 2009/4/1\[rq] +T} +T{ +\f[C]-p \[dq]q4\[dq]\f[R] +T}@T{ +fourth quarter of the current year +T} +.TE +.PP The argument of \f[C]-p\f[R] can also begin with, or be, a report interval expression. The basic report intervals are \f[C]daily\f[R], \f[C]weekly\f[R], @@ -3223,16 +3240,16 @@ balancesheet, bs .PD 0 .P .PD -This command displays a simple balance sheet, showing historical ending -balances of asset and liability accounts (ignoring any report begin -date). -It assumes that these accounts are under a top-level \f[C]asset\f[R] or -\f[C]liability\f[R] account (case insensitive, plural forms also -allowed). +This command displays a balance sheet, showing historical ending +balances of asset and liability accounts. +(To see equity as well, use the balancesheetequity command.) Amounts are +shown with normal positive sign, as in conventional financial +statements. .PP -Note this report shows all account balances with normal positive sign -(like conventional financial statements, unlike balance/print/register) -(experimental). +The asset and liability accounts shown are those accounts declared with +the \f[C]Asset\f[R] or \f[C]Cash\f[R] or \f[C]Liability\f[R] type, or +otherwise all accounts under a top-level \f[C]asset\f[R] or +\f[C]liability\f[R] account (case insensitive, plurals allowed). .PP Example: .IP @@ -3279,8 +3296,16 @@ balancesheetequity, bse .PD 0 .P .PD -Just like balancesheet, but also reports Equity (which it assumes is -under a top-level \f[C]equity\f[R] account). +This command displays a balance sheet, showing historical ending +balances of asset, liability and equity accounts. +Amounts are shown with normal positive sign, as in conventional +financial statements. +.PP +The asset, liability and equity accounts shown are those accounts +declared with the \f[C]Asset\f[R], \f[C]Cash\f[R], \f[C]Liability\f[R] +or \f[C]Equity\f[R] type, or otherwise all accounts under a top-level +\f[C]asset\f[R], \f[C]liability\f[R] or \f[C]equity\f[R] account (case +insensitive, plurals allowed). .PP Example: .IP @@ -3321,14 +3346,16 @@ cashflow, cf .PD 0 .P .PD -This command displays a simple cashflow statement, showing changes in -\[dq]cash\[dq] accounts. -It assumes that these accounts are under a top-level \f[C]asset\f[R] -account (case insensitive, plural forms also allowed) and do not contain -\f[C]receivable\f[R] or \f[C]A/R\f[R] in their name. -Note this report shows all account balances with normal positive sign -(like conventional financial statements, unlike balance/print/register) -(experimental). +This command displays a cashflow statement, showing the inflows and +outflows affecting \[dq]cash\[dq] (ie, liquid) assets. +Amounts are shown with normal positive sign, as in conventional +financial statements. +.PP +The \[dq]cash\[dq] accounts shown are those accounts declared with the +\f[C]Cash\f[R] type, or otherwise all accounts under a top-level +\f[C]asset\f[R] account (case insensitive, plural allowed) which do not +have \f[C]fixed\f[R], \f[C]investment\f[R], \f[C]receivable\f[R] or +\f[C]A/R\f[R] in their name. .PP Example: .IP @@ -3744,19 +3771,18 @@ incomestatement, is .PD 0 .P .PD -This command displays a simple income statement, showing revenues and -expenses during a period. -It assumes that these accounts are under a top-level \f[C]revenue\f[R] -or \f[C]income\f[R] or \f[C]expense\f[R] account (case insensitive, -plural forms also allowed). -Note this report shows all account balances with normal positive sign -(like conventional financial statements, unlike balance/print/register) -(experimental). .PP -This command displays a simple income statement. -It currently assumes that you have top-level accounts named -\f[C]income\f[R] (or \f[C]revenue\f[R]) and \f[C]expense\f[R] (plural -forms also allowed.) +This command displays an income statement, showing revenues and expenses +during one or more periods. +Amounts are shown with normal positive sign, as in conventional +financial statements. +.PP +The revenue and expense accounts shown are those accounts declared with +the \f[C]Revenue\f[R] or \f[C]Expense\f[R] type, or otherwise all +accounts under a top-level \f[C]revenue\f[R] or \f[C]income\f[R] or +\f[C]expense\f[R] account (case insensitive, plurals allowed). +.PP +Example: .IP .nf \f[C] @@ -4019,10 +4045,16 @@ register, reg, r .PD Show postings and their running total. .PP -The register command displays postings in date order, one per line, and -their running total. -This is typically used with a query selecting a particular account, to -see that account\[aq]s activity: +The register command displays matched postings, across all accounts, in +date order, with their running total or running historical balance. +(See also the \f[C]aregister\f[R] command, which shows matched +transactions in a specific account.) +.PP +register normally shows line per posting, but note that multi-commodity +amounts will occupy multiple lines (one line per commodity). +.PP +It is typically used with a query selecting a particular account, to see +that account\[aq]s activity: .IP .nf \f[C] diff --git a/hledger/hledger.info b/hledger/hledger.info index f65c47fcd..4c95b6fe7 100644 --- a/hledger/hledger.info +++ b/hledger/hledger.info @@ -1245,6 +1245,11 @@ date like so: '-p "2009/1"' the month of jan; equivalent to “2009/1/1 to 2009/2/1” '-p "2009/1/1"' just that day; equivalent to “2009/1/1 to 2009/1/2” + Or you can specify a single quarter like so: + +'-p "2009Q1"' first quarter of 2009, equivalent to “2009/1/1 to 2009/4/1” +'-p "q4"' fourth quarter of the current year + The argument of '-p' can also begin with, or be, a report interval expression. The basic report intervals are 'daily', 'weekly', 'monthly', 'quarterly', or 'yearly', which have the same effect as the @@ -2706,14 +2711,15 @@ File: hledger.info, Node: balancesheet, Next: balancesheetequity, Prev: balan ================ balancesheet, bs -This command displays a simple balance sheet, showing historical ending -balances of asset and liability accounts (ignoring any report begin -date). It assumes that these accounts are under a top-level 'asset' or -'liability' account (case insensitive, plural forms also allowed). +This command displays a balance sheet, showing historical ending +balances of asset and liability accounts. (To see equity as well, use +the balancesheetequity command.) Amounts are shown with normal positive +sign, as in conventional financial statements. - Note this report shows all account balances with normal positive sign -(like conventional financial statements, unlike balance/print/register) -(experimental). + The asset and liability accounts shown are those accounts declared +with the 'Asset' or 'Cash' or 'Liability' type, or otherwise all +accounts under a top-level 'asset' or 'liability' account (case +insensitive, plurals allowed). Example: @@ -2756,8 +2762,14 @@ File: hledger.info, Node: balancesheetequity, Next: cashflow, Prev: balancesh ====================== balancesheetequity, bse -Just like balancesheet, but also reports Equity (which it assumes is -under a top-level 'equity' account). +This command displays a balance sheet, showing historical ending +balances of asset, liability and equity accounts. Amounts are shown +with normal positive sign, as in conventional financial statements. + + The asset, liability and equity accounts shown are those accounts +declared with the 'Asset', 'Cash', 'Liability' or 'Equity' type, or +otherwise all accounts under a top-level 'asset', 'liability' or +'equity' account (case insensitive, plurals allowed). Example: @@ -2796,12 +2808,14 @@ File: hledger.info, Node: cashflow, Next: check-dates, Prev: balancesheetequi ============ cashflow, cf -This command displays a simple cashflow statement, showing changes in -"cash" accounts. It assumes that these accounts are under a top-level -'asset' account (case insensitive, plural forms also allowed) and do not -contain 'receivable' or 'A/R' in their name. Note this report shows all -account balances with normal positive sign (like conventional financial -statements, unlike balance/print/register) (experimental). +This command displays a cashflow statement, showing the inflows and +outflows affecting "cash" (ie, liquid) assets. Amounts are shown with +normal positive sign, as in conventional financial statements. + + The "cash" accounts shown are those accounts declared with the 'Cash' +type, or otherwise all accounts under a top-level 'asset' account (case +insensitive, plural allowed) which do not have 'fixed', 'investment', +'receivable' or 'A/R' in their name. Example: @@ -3180,16 +3194,17 @@ File: hledger.info, Node: incomestatement, Next: notes, Prev: import, Up: CO ==================== incomestatement, is -This command displays a simple income statement, showing revenues and -expenses during a period. It assumes that these accounts are under a -top-level 'revenue' or 'income' or 'expense' account (case insensitive, -plural forms also allowed). Note this report shows all account balances -with normal positive sign (like conventional financial statements, -unlike balance/print/register) (experimental). - This command displays a simple income statement. It currently -assumes that you have top-level accounts named 'income' (or 'revenue') -and 'expense' (plural forms also allowed.) + This command displays an income statement, showing revenues and +expenses during one or more periods. Amounts are shown with normal +positive sign, as in conventional financial statements. + + The revenue and expense accounts shown are those accounts declared +with the 'Revenue' or 'Expense' type, or otherwise all accounts under a +top-level 'revenue' or 'income' or 'expense' account (case insensitive, +plurals allowed). + + Example: $ hledger incomestatement Income Statement @@ -3416,9 +3431,17 @@ File: hledger.info, Node: register, Next: register-match, Prev: print-unique, register, reg, r Show postings and their running total. - The register command displays postings in date order, one per line, -and their running total. This is typically used with a query selecting -a particular account, to see that account's activity: + 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 +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 +see that account's activity: $ hledger register checking 2008/01/01 income assets:bank:checking $1 $1 @@ -4086,150 +4109,150 @@ Node: Report intervals40503 Ref: #report-intervals40668 Node: Period expressions41058 Ref: #period-expressions41218 -Node: Depth limiting45369 -Ref: #depth-limiting45513 -Node: Pivoting45845 -Ref: #pivoting45968 -Node: Valuation47644 -Ref: #valuation47746 -Node: -B Cost48435 -Ref: #b-cost48539 -Node: -V Value48672 -Ref: #v-value48818 -Node: -X Value in specified commodity49013 -Ref: #x-value-in-specified-commodity49212 -Node: Valuation date49361 -Ref: #valuation-date49529 -Node: Market prices49939 -Ref: #market-prices50119 -Node: --infer-value market prices from transactions50896 -Ref: #infer-value-market-prices-from-transactions51145 -Node: Valuation commodity52427 -Ref: #valuation-commodity52636 -Node: Simple valuation examples53862 -Ref: #simple-valuation-examples54064 -Node: --value Flexible valuation54723 -Ref: #value-flexible-valuation54931 -Node: More valuation examples56878 -Ref: #more-valuation-examples57087 -Node: Effect of valuation on reports59092 -Ref: #effect-of-valuation-on-reports59280 -Node: COMMANDS64801 -Ref: #commands64909 -Node: accounts66017 -Ref: #accounts66115 -Node: activity66814 -Ref: #activity66924 -Node: add67307 -Ref: #add67408 -Node: aregister70201 -Ref: #aregister70313 -Node: aregister and custom posting dates71686 -Ref: #aregister-and-custom-posting-dates71859 -Ref: #output-format-172452 -Node: balance72857 -Ref: #balance72974 -Node: Classic balance report74432 -Ref: #classic-balance-report74605 -Node: Customising the classic balance report76039 -Ref: #customising-the-classic-balance-report76267 -Node: Colour support78343 -Ref: #colour-support78510 -Node: Flat mode78606 -Ref: #flat-mode78754 -Node: Depth limited balance reports79167 -Ref: #depth-limited-balance-reports79352 -Node: Percentages79808 -Ref: #percentages79974 -Node: Multicolumn balance report81111 -Ref: #multicolumn-balance-report81291 -Node: Budget report86888 -Ref: #budget-report87031 -Node: Nested budgets92297 -Ref: #nested-budgets92409 -Ref: #output-format-295890 -Node: balancesheet96087 -Ref: #balancesheet96223 -Node: balancesheetequity97689 -Ref: #balancesheetequity97838 -Node: cashflow98561 -Ref: #cashflow98689 -Node: check-dates99868 -Ref: #check-dates99995 -Node: check-dupes100274 -Ref: #check-dupes100400 -Node: close100693 -Ref: #close100801 -Node: close usage102323 -Ref: #close-usage102416 -Node: codes105229 -Ref: #codes105337 -Node: commodities106049 -Ref: #commodities106176 -Node: descriptions106258 -Ref: #descriptions106386 -Node: diff106690 -Ref: #diff106796 -Node: files107843 -Ref: #files107943 -Node: help108090 -Ref: #help108190 -Node: import109271 -Ref: #import109385 -Node: Importing balance assignments110278 -Ref: #importing-balance-assignments110426 -Node: incomestatement111075 -Ref: #incomestatement111208 -Node: notes112695 -Ref: #notes112808 -Node: payees113176 -Ref: #payees113282 -Node: prices113702 -Ref: #prices113808 -Node: print114149 -Ref: #print114259 -Node: print-unique119055 -Ref: #print-unique119181 -Node: register119466 -Ref: #register119593 -Node: Custom register output123765 -Ref: #custom-register-output123894 -Node: register-match125231 -Ref: #register-match125365 -Node: rewrite125716 -Ref: #rewrite125831 -Node: Re-write rules in a file127686 -Ref: #re-write-rules-in-a-file127820 -Node: Diff output format129030 -Ref: #diff-output-format129199 -Node: rewrite vs print --auto130291 -Ref: #rewrite-vs.-print---auto130470 -Node: roi131026 -Ref: #roi131124 -Node: stats132136 -Ref: #stats132235 -Node: tags133023 -Ref: #tags133121 -Node: test133640 -Ref: #test133748 -Node: Add-on commands134495 -Ref: #add-on-commands134612 -Node: ui135955 -Ref: #ui136043 -Node: web136097 -Ref: #web136200 -Node: iadd136316 -Ref: #iadd136427 -Node: interest136509 -Ref: #interest136616 -Node: ENVIRONMENT136856 -Ref: #environment136968 -Node: FILES137953 -Ref: #files-1138056 -Node: LIMITATIONS138269 -Ref: #limitations138388 -Node: TROUBLESHOOTING139130 -Ref: #troubleshooting139243 +Node: Depth limiting45550 +Ref: #depth-limiting45694 +Node: Pivoting46026 +Ref: #pivoting46149 +Node: Valuation47825 +Ref: #valuation47927 +Node: -B Cost48616 +Ref: #b-cost48720 +Node: -V Value48853 +Ref: #v-value48999 +Node: -X Value in specified commodity49194 +Ref: #x-value-in-specified-commodity49393 +Node: Valuation date49542 +Ref: #valuation-date49710 +Node: Market prices50120 +Ref: #market-prices50300 +Node: --infer-value market prices from transactions51077 +Ref: #infer-value-market-prices-from-transactions51326 +Node: Valuation commodity52608 +Ref: #valuation-commodity52817 +Node: Simple valuation examples54043 +Ref: #simple-valuation-examples54245 +Node: --value Flexible valuation54904 +Ref: #value-flexible-valuation55112 +Node: More valuation examples57059 +Ref: #more-valuation-examples57268 +Node: Effect of valuation on reports59273 +Ref: #effect-of-valuation-on-reports59461 +Node: COMMANDS64982 +Ref: #commands65090 +Node: accounts66198 +Ref: #accounts66296 +Node: activity66995 +Ref: #activity67105 +Node: add67488 +Ref: #add67589 +Node: aregister70382 +Ref: #aregister70494 +Node: aregister and custom posting dates71867 +Ref: #aregister-and-custom-posting-dates72040 +Ref: #output-format-172633 +Node: balance73038 +Ref: #balance73155 +Node: Classic balance report74613 +Ref: #classic-balance-report74786 +Node: Customising the classic balance report76220 +Ref: #customising-the-classic-balance-report76448 +Node: Colour support78524 +Ref: #colour-support78691 +Node: Flat mode78787 +Ref: #flat-mode78935 +Node: Depth limited balance reports79348 +Ref: #depth-limited-balance-reports79533 +Node: Percentages79989 +Ref: #percentages80155 +Node: Multicolumn balance report81292 +Ref: #multicolumn-balance-report81472 +Node: Budget report87069 +Ref: #budget-report87212 +Node: Nested budgets92478 +Ref: #nested-budgets92590 +Ref: #output-format-296071 +Node: balancesheet96268 +Ref: #balancesheet96404 +Node: balancesheetequity97916 +Ref: #balancesheetequity98065 +Node: cashflow99141 +Ref: #cashflow99269 +Node: check-dates100485 +Ref: #check-dates100612 +Node: check-dupes100891 +Ref: #check-dupes101017 +Node: close101310 +Ref: #close101418 +Node: close usage102940 +Ref: #close-usage103033 +Node: codes105846 +Ref: #codes105954 +Node: commodities106666 +Ref: #commodities106793 +Node: descriptions106875 +Ref: #descriptions107003 +Node: diff107307 +Ref: #diff107413 +Node: files108460 +Ref: #files108560 +Node: help108707 +Ref: #help108807 +Node: import109888 +Ref: #import110002 +Node: Importing balance assignments110895 +Ref: #importing-balance-assignments111043 +Node: incomestatement111692 +Ref: #incomestatement111825 +Node: notes113170 +Ref: #notes113283 +Node: payees113651 +Ref: #payees113757 +Node: prices114177 +Ref: #prices114283 +Node: print114624 +Ref: #print114734 +Node: print-unique119530 +Ref: #print-unique119656 +Node: register119941 +Ref: #register120068 +Node: Custom register output124517 +Ref: #custom-register-output124646 +Node: register-match125983 +Ref: #register-match126117 +Node: rewrite126468 +Ref: #rewrite126583 +Node: Re-write rules in a file128438 +Ref: #re-write-rules-in-a-file128572 +Node: Diff output format129782 +Ref: #diff-output-format129951 +Node: rewrite vs print --auto131043 +Ref: #rewrite-vs.-print---auto131222 +Node: roi131778 +Ref: #roi131876 +Node: stats132888 +Ref: #stats132987 +Node: tags133775 +Ref: #tags133873 +Node: test134392 +Ref: #test134500 +Node: Add-on commands135247 +Ref: #add-on-commands135364 +Node: ui136707 +Ref: #ui136795 +Node: web136849 +Ref: #web136952 +Node: iadd137068 +Ref: #iadd137179 +Node: interest137261 +Ref: #interest137368 +Node: ENVIRONMENT137608 +Ref: #environment137720 +Node: FILES138705 +Ref: #files-1138808 +Node: LIMITATIONS139021 +Ref: #limitations139140 +Node: TROUBLESHOOTING139882 +Ref: #troubleshooting139995  End Tag Table diff --git a/hledger/hledger.txt b/hledger/hledger.txt index 8d02af0b5..8771a3c2e 100644 --- a/hledger/hledger.txt +++ b/hledger/hledger.txt @@ -1078,48 +1078,56 @@ OPTIONS -p "2009/1/1" just that day; equivalent to "2009/1/1 to 2009/1/2" - The argument of -p can also begin with, or be, a report interval ex- + Or you can specify a single quarter like so: + + -p "2009Q1" first quarter of 2009, + equivalent to "2009/1/1 to + 2009/4/1" + -p "q4" fourth quarter of the cur- + rent year + + The argument of -p can also begin with, or be, a report interval ex- pression. The basic report intervals are daily, weekly, monthly, quar- - terly, or yearly, which have the same effect as the -D,-W,-M,-Q, or -Y - flags. Between report interval and start/end dates (if any), the word + terly, or yearly, which have the same effect as the -D,-W,-M,-Q, or -Y + flags. Between report interval and start/end dates (if any), the word in is optional. Examples: -p "weekly from 2009/1/1 to 2009/4/1" -p "monthly in 2008" -p "quarterly" - Note that weekly, monthly, quarterly and yearly intervals will always + Note that weekly, monthly, quarterly and yearly intervals will always start on the first day on week, month, quarter or year accordingly, and - will end on the last day of same period, even if associated period ex- + will end on the last day of same period, even if associated period ex- pression specifies different explicit start and end date. For example: - -p "weekly from 2009/1/1 starts on 2008/12/29, closest preceding Mon- + -p "weekly from 2009/1/1 starts on 2008/12/29, closest preceding Mon- to 2009/4/1" day - -p "monthly in starts on 2018/11/01 + -p "monthly in starts on 2018/11/01 2008/11/25" - -p "quarterly from starts on 2009/04/01, ends on 2009/06/30, + -p "quarterly from starts on 2009/04/01, ends on 2009/06/30, 2009-05-05 to 2009-06-01" which are first and last days of Q2 2009 -p "yearly from starts on 2009/01/01, first day of 2009 2009-12-29" - The following more complex report intervals are also supported: bi- - weekly, fortnightly, bimonthly, every day|week|month|quarter|year, ev- + The following more complex report intervals are also supported: bi- + weekly, fortnightly, bimonthly, every day|week|month|quarter|year, ev- ery N days|weeks|months|quarters|years. - All of these will start on the first day of the requested period and + All of these will start on the first day of the requested period and end on the last one, as described above. Examples: - -p "bimonthly from 2008" periods will have boundaries on 2008/01/01, + -p "bimonthly from 2008" periods will have boundaries on 2008/01/01, 2008/03/01, ... -p "every 2 weeks" starts on closest preceding Monday - -p "every 5 month from periods will have boundaries on 2009/03/01, + -p "every 5 month from periods will have boundaries on 2009/03/01, 2009/03" 2009/08/01, ... - If you want intervals that start on arbitrary day of your choosing and + If you want intervals that start on arbitrary day of your choosing and span a week, month or year, you need to use any of the following: every Nth day of week, every , every Nth day [of month], every @@ -1131,42 +1139,44 @@ OPTIONS -p "every 2nd day of periods will go from Tue to Tue week" -p "every Tue" same - -p "every 15th day" period boundaries will be on 15th of each + + + -p "every 15th day" period boundaries will be on 15th of each month - -p "every 2nd Monday" period boundaries will be on second Monday of + -p "every 2nd Monday" period boundaries will be on second Monday of each month -p "every 11/05" yearly periods with boundaries on 5th of Nov -p "every 5th Nov" same -p "every Nov 5th" same - Show historical balances at end of 15th each month (N is exclusive end + Show historical balances at end of 15th each month (N is exclusive end date): hledger balance -H -p "every 16th day" - Group postings from start of wednesday to end of next tuesday (N is + Group postings from start of wednesday to end of next tuesday (N is start date and exclusive end date): hledger register checking -p "every 3rd day of week" Depth limiting With the --depth N option (short form: -N), commands like account, bal- - ance and register will show only the uppermost accounts in the account - tree, down to level N. Use this when you want a summary with less de- + ance and register will show only the uppermost accounts in the account + tree, down to level N. Use this when you want a summary with less de- tail. This flag has the same effect as a depth: query argument (so -2, --depth=2 or depth:2 are equivalent). Pivoting Normally hledger sums amounts, and organizes them in a hierarchy, based - on account name. The --pivot FIELD option causes it to sum and orga- - nize hierarchy based on the value of some other field instead. FIELD + on account name. The --pivot FIELD option causes it to sum and orga- + nize hierarchy based on the value of some other field instead. FIELD can be: code, description, payee, note, or the full name (case insensi- tive) of any tag. As with account names, values containing colon:sepa- rated:parts will be displayed hierarchically in reports. - --pivot is a general option affecting all reports; you can think of + --pivot is a general option affecting all reports; you can think of hledger transforming the journal before any other processing, replacing - every posting's account name with the value of the specified field on + every posting's account name with the value of the specified field on that posting, inheriting it from the transaction or using a blank value if it's not present. @@ -1192,7 +1202,7 @@ OPTIONS -------------------- 0 - One way to show only amounts with a member: value (using a query, de- + One way to show only amounts with a member: value (using a query, de- scribed below): $ hledger balance --pivot member tag:member=. @@ -1200,7 +1210,7 @@ OPTIONS -------------------- -2 EUR - Another way (the acct: query matches against the pivoted "account + Another way (the acct: query matches against the pivoted "account name"): $ hledger balance --pivot member acct:. @@ -1209,56 +1219,56 @@ OPTIONS -2 EUR Valuation - Instead of reporting amounts in their original commodity, hledger can + Instead of reporting amounts in their original commodity, hledger can convert them to cost/sale amount (using the conversion rate recorded in the transaction), or to market value (using some market price on a cer- tain date). This is controlled by the --value=TYPE[,COMMODITY] option, - but we also provide the simpler -B/-V/-X flags, and usually one of + but we also provide the simpler -B/-V/-X flags, and usually one of those is all you need. -B: Cost - The -B/--cost flag converts amounts to their cost or sale amount at + The -B/--cost flag converts amounts to their cost or sale amount at transaction time, if they have a transaction price specified. -V: Value - The -V/--market flag converts amounts to market value in their default + The -V/--market flag converts amounts to market value in their default valuation commodity, using the market prices in effect on the valuation date(s), if any. More on these in a minute. -X: Value in specified commodity The -X/--exchange=COMM option is like -V, except you tell it which cur- - rency you want to convert to, and it tries to convert everything to + rency you want to convert to, and it tries to convert everything to that. Valuation date - Since market prices can change from day to day, market value reports + Since market prices can change from day to day, market value reports have a valuation date (or more than one), which determines which market prices will be used. For single period reports, if an explicit report end date is specified, - that will be used as the valuation date; otherwise the valuation date + that will be used as the valuation date; otherwise the valuation date is "today". - For multiperiod reports, each column/period is valued on the last day + For multiperiod reports, each column/period is valued on the last day of the period. Market prices (experimental) - To convert a commodity A to its market value in another commodity B, - hledger looks for a suitable market price (exchange rate) as follows, + To convert a commodity A to its market value in another commodity B, + hledger looks for a suitable market price (exchange rate) as follows, in this order of preference : - 1. A declared market price or inferred market price: A's latest market + 1. A declared market price or inferred market price: A's latest market price in B on or before the valuation date as declared by a P direc- - tive, or (if the --infer-value flag is used) inferred from transac- + tive, or (if the --infer-value flag is used) inferred from transac- tion prices. 2. A reverse market price: the inverse of a declared or inferred market price from B to A. - 3. A chained market price: a synthetic price formed by combining the - shortest chain of market prices (any of the above types) leading + 3. A chained market price: a synthetic price formed by combining the + shortest chain of market prices (any of the above types) leading from A to B. Amounts for which no applicable market price can be found, are not con- @@ -1269,17 +1279,17 @@ OPTIONS Normally, market value in hledger is fully controlled by, and requires, P directives in your journal. Since adding and updating those can be a - chore, and since transactions usually take place at close to market + chore, and since transactions usually take place at close to market value, why not use the recorded transaction prices as additional market prices (as Ledger does) ? We could produce value reports without need- ing P directives at all. - Adding the --infer-value flag to -V, -X or --value enables this. So - for example, hledger bs -V --infer-value will get market prices both + Adding the --infer-value flag to -V, -X or --value enables this. So + for example, hledger bs -V --infer-value will get market prices both from P directives and from transactions. There is a downside: value reports can sometimes be affected in confus- - ing/undesired ways by your journal entries. If this happens to you, + ing/undesired ways by your journal entries. If this happens to you, read all of this Valuation section carefully, and try adding --debug or --debug=2 to troubleshoot. @@ -1287,45 +1297,45 @@ OPTIONS o multicommodity transactions with explicit prices (@/@@) - o multicommodity transactions with implicit prices (no @, two commodi- - ties, unbalanced). (With these, the order of postings matters. + o multicommodity transactions with implicit prices (no @, two commodi- + ties, unbalanced). (With these, the order of postings matters. hledger print -x can be useful for troubleshooting.) - o but not, currently, from "more correct" multicommodity transactions + o but not, currently, from "more correct" multicommodity transactions (no @, multiple commodities, balanced). Valuation commodity (experimental) When you specify a valuation commodity (-X COMM or --value TYPE,COMM): - hledger will convert all amounts to COMM, wherever it can find a suit- + hledger will convert all amounts to COMM, wherever it can find a suit- able market price (including by reversing or chaining prices). - When you leave the valuation commodity unspecified (-V or --value + When you leave the valuation commodity unspecified (-V or --value TYPE): - For each commodity A, hledger picks a default valuation commodity as + For each commodity A, hledger picks a default valuation commodity as follows, in this order of preference: 1. The price commodity from the latest P-declared market price for A on or before valuation date. 2. The price commodity from the latest P-declared market price for A on - any date. (Allows conversion to proceed when there are inferred + any date. (Allows conversion to proceed when there are inferred prices before the valuation date.) - 3. If there are no P directives at all (any commodity or date) and the - --infer-value flag is used: the price commodity from the latest + 3. If there are no P directives at all (any commodity or date) and the + --infer-value flag is used: the price commodity from the latest transaction-inferred price for A on or before valuation date. This means: - o If you have P directives, they determine which commodities -V will + o If you have P directives, they determine which commodities -V will convert, and to what. o If you have no P directives, and use the --infer-value flag, transac- tion prices determine it. - Amounts for which no valuation commodity can be found are not con- + Amounts for which no valuation commodity can be found are not con- verted. Simple valuation examples @@ -1352,7 +1362,7 @@ OPTIONS $ hledger -f t.j bal -N euros -V -e 2016/11/4 $110.00 assets:euros - What are they worth after 2016/12/21 ? (no report end date specified, + What are they worth after 2016/12/21 ? (no report end date specified, defaults to today) $ hledger -f t.j bal -N euros -V @@ -1373,36 +1383,36 @@ OPTIONS The TYPE part selects cost or value and valuation date: --value=cost - Convert amounts to cost, using the prices recorded in transac- + Convert amounts to cost, using the prices recorded in transac- tions. --value=then - Convert amounts to their value in the default valuation commod- - ity, using market prices on each posting's date. This is cur- + Convert amounts to their value in the default valuation commod- + ity, using market prices on each posting's date. This is cur- rently supported only by the print and register commands. --value=end - Convert amounts to their value in the default valuation commod- - ity, using market prices on the last day of the report period - (or if unspecified, the journal's end date); or in multiperiod + Convert amounts to their value in the default valuation commod- + ity, using market prices on the last day of the report period + (or if unspecified, the journal's end date); or in multiperiod reports, market prices on the last day of each subperiod. --value=now - Convert amounts to their value in the default valuation commod- - ity using current market prices (as of when report is gener- + Convert amounts to their value in the default valuation commod- + ity using current market prices (as of when report is gener- ated). --value=YYYY-MM-DD - Convert amounts to their value in the default valuation commod- + Convert amounts to their value in the default valuation commod- ity using market prices on this date. To select a different valuation commodity, add the optional ,COMM part: - a comma, then the target commodity's symbol. Eg: --value=now,EUR. + a comma, then the target commodity's symbol. Eg: --value=now,EUR. hledger will do its best to convert amounts to this commodity, deducing market prices as described above. More valuation examples - Here are some examples showing the effect of --value, as seen with + Here are some examples showing the effect of --value, as seen with print: P 2000-01-01 A 1 B @@ -1440,7 +1450,7 @@ OPTIONS 2000-02-01 (a) 2 B - With no report period specified, that shows the value as of the last + With no report period specified, that shows the value as of the last day of the journal (2000-03-01): $ hledger -f- print --value=end @@ -1477,7 +1487,7 @@ OPTIONS 2000-03-01 (a) 1 B - You may need to explicitly set a commodity's display style, when re- + You may need to explicitly set a commodity's display style, when re- verse prices are used. Eg this output might be surprising: P 2000-01-01 A 2B @@ -1491,10 +1501,10 @@ OPTIONS a 0 b 0 - Explanation: because there's no amount or commodity directive specify- - ing a display style for A, 0.5A gets the default style, which shows no + Explanation: because there's no amount or commodity directive specify- + ing a display style for A, 0.5A gets the default style, which shows no decimal digits. Because the displayed amount looks like zero, the com- - modity symbol and minus sign are not displayed either. Adding a com- + modity symbol and minus sign are not displayed either. Adding a com- modity directive sets a more useful display style for A: P 2000-01-01 A 2B @@ -1510,9 +1520,9 @@ OPTIONS b -0.50A Effect of valuation on reports - Here is a reference for how valuation is supposed to affect each part - of hledger's reports (and a glossary). (It's wide, you'll have to - scroll sideways.) It may be useful when troubleshooting. If you find + Here is a reference for how valuation is supposed to affect each part + of hledger's reports (and a glossary). (It's wide, you'll have to + scroll sideways.) It may be useful when troubleshooting. If you find problems, please report them, ideally with a reproducible example. Re- lated: #329, #1083. @@ -1521,7 +1531,7 @@ OPTIONS ------------------------------------------------------------------------------------------ print posting cost value at re- value at value at re- value at - amounts port end or posting date port or DATE/today + amounts port end or posting date port or DATE/today today journal end balance as- unchanged unchanged unchanged unchanged unchanged sertions / @@ -1534,14 +1544,17 @@ OPTIONS journal journal start start posting cost value at re- value at value at re- value at - amounts (no port end or posting date port or DATE/today + amounts (no port end or posting date port or DATE/today report in- today journal end terval) - summary summarised value at pe- sum of post- value at pe- value at + summary summarised value at pe- sum of post- value at pe- value at posting cost riod ends ings in in- riod ends DATE/today amounts terval, val- (with report ued at inter- interval) val start + + + running to- sum/average sum/average sum/average sum/average sum/average tal/average of displayed of displayed of displayed of displayed of displayed values values values values values @@ -1550,7 +1563,7 @@ OPTIONS bse, cf, is..) balances (no sums of value at re- not supported value at re- value at - report in- costs port end or port or DATE/today of + report in- costs port end or port or DATE/today of terval) today of journal end sums of post- sums of of sums of ings postings postings @@ -1558,9 +1571,6 @@ OPTIONS (with report costs riod ends of riod ends of DATE/today of interval) sums of sums of sums of post- postings postings ings - - - starting sums of sums of not supported sums of sums of post- balances costs of postings be- postings be- ings before (with report postings be- fore report fore report report start @@ -1569,7 +1579,7 @@ OPTIONS budget like bal- like bal- not supported like bal- like balances amounts with ances ances ances --budget - grand total sum of dis- sum of dis- not supported sum of dis- sum of dis- + grand total sum of dis- sum of dis- not supported sum of dis- sum of dis- (no report played val- played val- played val- played values interval) ues ues ues row to- sums/aver- sums/aver- not supported sums/aver- sums/averages @@ -1577,7 +1587,7 @@ OPTIONS ages (with played val- played val- played val- values report in- ues ues ues terval) - column to- sums of dis- sums of dis- not supported sums of dis- sums of dis- + column to- sums of dis- sums of dis- not supported sums of dis- sums of dis- tals played val- played val- played val- played values ues ues ues grand to- sum/average sum/average not supported sum/average sum/average @@ -1589,60 +1599,60 @@ OPTIONS cost calculated using price(s) recorded in the transaction(s). - value market value using available market price declarations, or the + value market value using available market price declarations, or the unchanged amount if no conversion rate can be found. report start - the first day of the report period specified with -b or -p or + the first day of the report period specified with -b or -p or date:, otherwise today. report or journal start - the first day of the report period specified with -b or -p or - date:, otherwise the earliest transaction date in the journal, + the first day of the report period specified with -b or -p or + date:, otherwise the earliest transaction date in the journal, otherwise today. report end - the last day of the report period specified with -e or -p or + the last day of the report period specified with -e or -p or date:, otherwise today. report or journal end - the last day of the report period specified with -e or -p or - date:, otherwise the latest transaction date in the journal, + the last day of the report period specified with -e or -p or + date:, otherwise the latest transaction date in the journal, otherwise today. report interval - a flag (-D/-W/-M/-Q/-Y) or period expression that activates the + a flag (-D/-W/-M/-Q/-Y) or period expression that activates the report's multi-period mode (whether showing one or many subperi- ods). COMMANDS - hledger provides a number of subcommands; hledger with no arguments + hledger provides a number of subcommands; hledger with no arguments shows a list. If you install additional hledger-* packages, or if you put programs or - scripts named hledger-NAME in your PATH, these will also be listed as + scripts named hledger-NAME in your PATH, these will also be listed as subcommands. - Run a subcommand by writing its name as first argument (eg hledger in- - comestatement). You can also write one of the standard short aliases - displayed in parentheses in the command list (hledger b), or any any + Run a subcommand by writing its name as first argument (eg hledger in- + comestatement). You can also write one of the standard short aliases + displayed in parentheses in the command list (hledger b), or any any unambiguous prefix of a command name (hledger inc). - Here are all the builtin commands in alphabetical order. See also - hledger for a more organised command list, and hledger CMD -h for de- + Here are all the builtin commands in alphabetical order. See also + hledger for a more organised command list, and hledger CMD -h for de- tailed command help. accounts accounts, a Show account names. - This command lists account names, either declared with account direc- - tives (--declared), posted to (--used), or both (the default). With - query arguments, only matched account names and account names refer- - enced by matched postings are shown. 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 com- - ponents. Account names can be depth-clipped with depth:N or --depth N + This command lists account names, either declared with account direc- + tives (--declared), posted to (--used), or both (the default). With + query arguments, only matched account names and account names refer- + enced by matched postings are shown. 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 com- + ponents. Account names can be depth-clipped with depth:N or --depth N or -N. Examples: @@ -1661,8 +1671,8 @@ 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: @@ -1675,25 +1685,25 @@ COMMANDS add 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- + 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 journal file (if there are multiple -f - FILE options, the first file is used.) Existing transactions are not - changed. This is the only hledger command that writes to the journal + FILE options, the first file is used.) Existing transactions are not + changed. This is the only hledger command that writes to the journal file. 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 de- - scription) recent transaction (filtered by the query, if any) as a + o add tries to provide useful defaults, using the most similar (by de- + scription) recent transaction (filtered by the query, if any) as a template. o You can also set the initial defaults with command line arguments. @@ -1701,10 +1711,10 @@ COMMANDS o Readline-style edit keys can be used during data entry. o The tab key will auto-complete whenever possible - accounts, descrip- - tions, dates (yesterday, today, tomorrow). If the input area is + tions, 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. @@ -1713,7 +1723,7 @@ 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 the tutorial for a detailed explanation): @@ -1743,16 +1753,16 @@ 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 aregister, areg - Show transactions affecting a particular account, and the account's + Show transactions affecting a particular account, and the account's running balance. - aregister shows the transactions affecting a particular account (and - its subaccounts), from the point of view of that account. Each line + aregister shows the transactions affecting a particular account (and + its subaccounts), from the point of view of that account. Each line shows: o the transaction's (or posting's, see below) date @@ -1761,35 +1771,35 @@ COMMANDS o the net change to this account's balance - o the account's historical running balance (including balance from + o the account's historical running balance (including balance from transactions before the report start date). - With aregister, each line represents a whole transaction - as in - hledger-ui, hledger-web, and your bank statement. By contrast, the - register command shows individual postings, across all accounts. You - might prefer aregister for reconciling with real-world asset/liability + With aregister, each line represents a whole transaction - as in + hledger-ui, hledger-web, and your bank statement. By contrast, the + register command shows individual postings, across all accounts. You + might prefer aregister for reconciling with real-world asset/liability accounts, and register for reviewing detailed revenues/expenses. An account must be specified as the first argument, which should be the - full account name or an account pattern (regular expression). aregis- - ter will show transactions in this account (the first one matched) and + full account name or an account pattern (regular expression). aregis- + ter will show transactions in this account (the first one matched) and any of its subaccounts. - Any additional arguments form a query which will filter the transac- + Any additional arguments form a query which will filter the transac- tions shown. - 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. 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. Output format @@ -1798,12 +1808,12 @@ COMMANDS Examples: - Show all transactions and historical running balance in the first ac- + Show all transactions and historical running balance in the first ac- count whose name contains "checking": $ hledger areg checking - Show transactions and historical running balance in all asset accounts + Show transactions and historical running balance in all asset accounts during july: $ hledger areg assets date:jul @@ -1813,29 +1823,29 @@ COMMANDS Show accounts and their balances. The balance command is hledger's most versatile command. Note, despite - the name, it is not always used for showing real-world account bal- - ances; the more accounting-aware balancesheet and incomestatement may + the name, it is not always used for showing real-world account bal- + ances; the more accounting-aware balancesheet and incomestatement may be more convenient for that. By default, it displays all accounts, and each account's change in bal- ance during the entire period of the journal. Balance changes are cal- - culated by adding up the postings in each account. You can limit the - postings matched, by a query, to see fewer accounts, changes over a + culated by adding up the postings in each account. You can limit the + postings matched, by a query, to see fewer accounts, changes over a different time period, changes from only cleared transactions, etc. If you include an account's complete history of postings in the report, - the balance change is equivalent to the account's current ending bal- - ance. For a real-world account, typically you won't have all transac- + the balance change is equivalent to the account's current ending bal- + ance. For a real-world account, typically you won't have all transac- tions in the journal; instead you'll have all transactions after a cer- - tain date, and an "opening balances" transaction setting the correct - starting balance on that date. Then the balance command will show + tain date, and an "opening balances" transaction setting the correct + starting balance on that date. Then the balance command will show real-world account balances. In some cases the -H/--historical flag is used to ensure this (more below). The balance command can produce several styles of report: Classic balance report - This is the original balance report, as found in Ledger. It usually + This is the original balance report, as found in Ledger. It usually looks like this: $ hledger balance @@ -1853,23 +1863,23 @@ COMMANDS 0 By default, accounts are displayed hierarchically, with subaccounts in- - dented below their parent. At each level of the tree, accounts are - sorted by account code if any, then by account name. Or with - -S/--sort-amount, by their balance amount, largest first. (Note: -S + dented below their parent. At each level of the tree, accounts are + sorted by account code if any, then by account name. Or with + -S/--sort-amount, by their balance amount, largest first. (Note: -S has a problem in hledger 1.11-1.18). "Boring" accounts, which contain a single interesting subaccount and no - balance of their own, are elided into the following line for more com- - pact output. (Eg above, the "liabilities" account.) Use --no-elide to + balance of their own, are elided into the following line for more com- + pact output. (Eg above, the "liabilities" account.) Use --no-elide to prevent this. - Account balances are "inclusive" - they include the balances of any + Account balances are "inclusive" - they include the balances of any subaccounts. - Accounts which have zero balance (and no non-zero subaccounts) are + Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use -E/--empty to show them. - A final total is displayed by default; use -N/--no-total to suppress + A final total is displayed by default; use -N/--no-total to suppress it, eg: $ hledger balance -p 2008/6 expenses --no-total @@ -1878,7 +1888,7 @@ COMMANDS $1 supplies Customising the classic balance report - You can customise the layout of classic balance reports with --format + You can customise the layout of classic balance reports with --format FMT: $ hledger balance --format "%20(account) %12(total)" @@ -1896,7 +1906,7 @@ COMMANDS 0 The FMT format string (plus a newline) specifies the formatting applied - to each account/balance pair. It may contain any suitable text, with + to each account/balance pair. It may contain any suitable text, with data fields interpolated like so: %[MIN][.MAX](FIELDNAME) @@ -1907,14 +1917,14 @@ 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) @@ -1931,24 +1941,24 @@ COMMANDS 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 Colour support - In terminal output, when colour is enabled, the balance command shows + In terminal output, when colour is enabled, the balance command shows negative amounts in red. Flat mode - To see a flat list instead of the default hierarchical display, use - --flat. In this mode, accounts (unless depth-clipped) show their full - names and "exclusive" balance, excluding any subaccount balances. In + To see a flat list instead of the default hierarchical display, use + --flat. In this mode, accounts (unless depth-clipped) show their full + names and "exclusive" balance, excluding any subaccount balances. In this mode, you can also use --drop N to omit the first few account name components. @@ -1957,8 +1967,8 @@ COMMANDS $1 supplies Depth limited balance reports - With --depth N or depth:N or just -N, balance reports show accounts - only to the specified numeric depth. This is very useful to summarise + With --depth N or depth:N or just -N, balance reports show accounts + only to the specified numeric depth. This is very useful to summarise a complex set of accounts and get an overview. $ hledger balance -N -1 @@ -1971,9 +1981,9 @@ COMMANDS inclusive balances at the depth limit. Percentages - With -% or --percent, balance reports show each account's value ex- - pressed as a percentage of the column's total. This is useful to get - an overview of the relative sizes of account balances. For example to + With -% or --percent, balance reports show each account's value ex- + pressed as a percentage of the column's total. This is useful to get + an overview of the relative sizes of account balances. For example to obtain an overview of expenses: $ hledger balance expenses -% @@ -1983,32 +1993,32 @@ COMMANDS -------------------- 100.0 % - Note that --tree does not have an effect on -%. The percentages are - always relative to the total sum of each column, they are never rela- + Note that --tree does not have an effect on -%. The percentages are + always relative to the total sum of each column, they are never rela- tive to the parent account. - Since the percentages are relative to the columns sum, it is usually - not useful to calculate percentages if the signs of the amounts are - mixed. Although the results are technically correct, they are most - likely useless. Especially in a balance report that sums up to zero + Since the percentages are relative to the columns sum, it is usually + not useful to calculate percentages if the signs of the amounts are + mixed. Although the results are technically correct, they are most + likely useless. Especially in a balance report that sums up to zero (eg hledger balance -B) all percentage values will be zero. - This flag does not work if the report contains any mixed commodity ac- + This flag does not work if the report contains any mixed commodity ac- counts. If there are mixed commodity accounts in the report be sure to use -V or -B to coerce the report into using a single commodity. Multicolumn balance report - Multicolumn or tabular balance reports are a very useful hledger fea- - ture, and usually the preferred style. They share many of the above - features, but they show the report as a table, with columns represent- - ing time periods. This mode is activated by providing a reporting in- + Multicolumn or tabular balance reports are a very useful hledger fea- + ture, and usually the preferred style. They share many of the above + features, but they show the report as a table, with columns represent- + ing time periods. This mode is activated by providing a reporting in- terval. - There are three types of multicolumn balance report, showing different + There are three types of multicolumn balance report, showing different information: 1. By default: each column shows the sum of postings in that period, ie - the account's change of balance in that period. This is useful eg + the account's change of balance in that period. This is useful eg for a monthly income statement: $ hledger balance --quarterly income expenses -E @@ -2024,7 +2034,7 @@ COMMANDS || $-1 $1 0 0 2. With --cumulative: each column shows the ending balance for that pe- - riod, accumulating the changes across periods, starting from 0 at + riod, accumulating the changes across periods, starting from 0 at the report start date: $ hledger balance --quarterly income expenses -E --cumulative @@ -2040,8 +2050,8 @@ COMMANDS || $-1 0 0 0 3. With --historical/-H: each column shows the actual historical ending - balance for that period, accumulating the changes across periods, - starting from the actual balance at the report start date. This is + balance for that period, accumulating the changes across periods, + starting from the actual balance at the report start date. This is useful eg for a multi-period balance sheet, and when you are showing only the data after a certain start date: @@ -2060,26 +2070,26 @@ COMMANDS Note that --cumulative or --historical/-H disable --row-total/-T, since summing end balances generally does not make sense. - Multicolumn balance reports display accounts in flat mode by default; + Multicolumn balance reports display accounts in flat mode by default; to see the hierarchy, use --tree. - With a reporting interval (like --quarterly above), the report - start/end dates will be adjusted if necessary so that they encompass + With a reporting interval (like --quarterly above), the report + start/end dates will be adjusted if necessary so that they encompass the displayed report periods. This is so that the first and last peri- ods will be "full" and comparable to the others. - The -E/--empty flag does two things in multicolumn balance reports: + The -E/--empty flag does two things in multicolumn balance reports: first, the report will show all columns within the specified report pe- - riod (without -E, leading and trailing columns with all zeroes are not - shown). Second, all accounts which existed at the report start date - will be considered, not just the ones with activity during the report - period (use -E to include low-activity accounts which would otherwise + riod (without -E, leading and trailing columns with all zeroes are not + shown). Second, all accounts which existed at the report start date + will be considered, not just the ones with activity during the report + period (use -E to include low-activity accounts which would otherwise would be omitted). The -T/--row-total flag adds an additional column showing the total for each row. - The -A/--average flag adds a column showing the average value in each + The -A/--average flag adds a column showing the average value in each row. Here's an example of all three: @@ -2100,27 +2110,27 @@ COMMANDS (Average is rounded to the dollar here since all journal amounts are) - The --transpose flag can be used to exchange the rows and columns of a + The --transpose flag can be used to exchange the rows and columns of a multicolumn report. - When showing multicommodity amounts, multicolumn balance reports will + When showing multicommodity amounts, multicolumn balance reports will elide any amounts which have more than two commodities, since otherwise - columns could get very wide. The --no-elide flag disables this. Hid- - ing totals with the -N/--no-total flag can also help reduce the width + columns could get very wide. The --no-elide flag disables this. Hid- + ing totals with the -N/--no-total flag can also help reduce the width of multicommodity reports. When the report is still too wide, a good workaround is to pipe it into - less -RS (-R for colour, -S to chop long lines). Eg: hledger bal -D + less -RS (-R for colour, -S to chop long lines). Eg: hledger bal -D --color=yes | less -RS. Budget report - With --budget, extra columns are displayed showing budget goals for - each account and period, if any. Budget goals are defined by periodic + With --budget, extra columns are displayed showing budget goals for + each account and period, if any. Budget goals are defined by periodic transactions. This is very useful for comparing planned and actual in- - come, expenses, time usage, etc. --budget is most often combined with + come, expenses, time usage, etc. --budget is most often combined with a report interval. - For example, you can take average monthly expenses in the common ex- + For example, you can take average monthly expenses in the common ex- pense categories to construct a minimal monthly budget: ;; Budget @@ -2167,26 +2177,26 @@ 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 flat mode. Eg assets, + o All parent accounts are always shown, even in flat 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 flat mode. This means that the numbers displayed will not always add up! Eg above, - the expenses actual amount includes the gifts and supplies transac- - tions, but the expenses:gifts and expenses:supplies accounts are not + the expenses actual amount includes the gifts and supplies transac- + tions, 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 @@ -2228,12 +2238,12 @@ COMMANDS For more examples, see Budgeting and Forecasting. Nested budgets - 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: @@ -2243,13 +2253,13 @@ 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 to- + Transactions in expenses:personal:electronics will be counted both to- wards its $100 budget and $1100 of expenses:personal , and transactions - in any other subaccount of expenses:personal would be counted towards + 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: @@ -2275,9 +2285,9 @@ 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: @@ -2293,7 +2303,7 @@ 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 @@ -2312,19 +2322,20 @@ COMMANDS Output format This command also supports the output destination and output format op- - tions The output formats supported are txt, csv, (multicolumn non-bud- + tions The output formats supported are txt, csv, (multicolumn non-bud- get reports only) html, and (experimental) json. balancesheet balancesheet, bs - This command displays a simple balance sheet, showing historical ending - balances of asset and liability accounts (ignoring any report begin - date). It assumes that these accounts are under a top-level asset or - liability account (case insensitive, plural forms also allowed). + 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 + sign, as in conventional financial statements. - Note this report shows all account balances with normal positive sign - (like conventional financial statements, unlike balance/print/register) - (experimental). + The asset and liability accounts shown are those accounts declared with + the Asset or Cash or Liability type, or otherwise all accounts under a + top-level asset or liability account (case insensitive, plurals al- + lowed). Example: @@ -2362,8 +2373,14 @@ COMMANDS balancesheetequity balancesheetequity, bse - Just like balancesheet, but also reports Equity (which it assumes is - under a top-level equity account). + 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. + + The asset, liability and equity accounts shown are those accounts de- + clared with the Asset, Cash, Liability or Equity type, or otherwise all + accounts under a top-level asset, liability or equity account (case in- + sensitive, plurals allowed). Example: @@ -2397,12 +2414,14 @@ COMMANDS cashflow cashflow, cf - This command displays a simple cashflow statement, showing changes in - "cash" accounts. It assumes that these accounts are under a top-level - asset account (case insensitive, plural forms also allowed) and do not - contain receivable or A/R in their name. Note this report shows all - account balances with normal positive sign (like conventional financial - statements, unlike balance/print/register) (experimental). + This command displays a cashflow statement, showing the inflows and + outflows affecting "cash" (ie, liquid) assets. Amounts are shown with + normal positive sign, as in conventional financial statements. + + The "cash" accounts shown are those accounts declared with the Cash + type, or otherwise all accounts under a top-level asset account (case + insensitive, plural allowed) which do not have fixed, investment, re- + ceivable or A/R in their name. Example: @@ -2706,16 +2725,16 @@ COMMANDS incomestatement incomestatement, is - This command displays a simple income statement, showing revenues and - expenses during a period. It assumes that these accounts are under a - top-level revenue or income or expense account (case insensitive, plu- - ral forms also allowed). Note this report shows all account balances - with normal positive sign (like conventional financial statements, un- - like balance/print/register) (experimental). + This command displays an income statement, showing revenues and ex- + penses during one or more periods. Amounts are shown with normal posi- + tive sign, as in conventional financial statements. - This command displays a simple income statement. It currently assumes - that you have top-level accounts named income (or revenue) and expense - (plural forms also allowed.) + The revenue and expense accounts shown are those accounts declared with + the Revenue or Expense type, or otherwise all accounts under a top- + level revenue or income or expense account (case insensitive, plurals + allowed). + + Example: $ hledger incomestatement Income Statement @@ -2914,9 +2933,16 @@ COMMANDS register, reg, r Show postings and their running total. - The register command displays postings in date order, one per line, and - their running total. This is typically used with a query selecting a - particular account, to see that account's activity: + 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 + 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 + see that account's activity: $ hledger register checking 2008/01/01 income assets:bank:checking $1 $1 @@ -2926,8 +2952,8 @@ COMMANDS With --date2, it shows and sorts by secondary date instead. - 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 @@ -2937,18 +2963,18 @@ 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 ac- + the whole report period). This flag implies --empty (see below). It + is affected by --historical. It works best when showing just one ac- count 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 to- + bers. It's also useful to show postings on the checking account to- gether with the related account: $ hledger register --related --invert assets:checking @@ -2960,7 +2986,7 @@ COMMANDS 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 @@ -2977,7 +3003,7 @@ COMMANDS 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth op- + Often, you'll want to see just one line per interval. The --depth op- tion helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h @@ -2985,17 +3011,17 @@ 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 in- - tervals. 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 in- + tervals. This ensures that the first and last intervals are full length and comparable to the others in the report. 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 + The description and account columns normally share the space equally (about half of (width - 40) each). You can adjust this by adding a de- scription width as part of --width's argument, comma-separated: --width W,D . Here's a diagram (won't display correctly in --help): @@ -3014,27 +3040,27 @@ COMMANDS $ hledger reg -w $COLUMNS,40 # use terminal width, & description width 40 This command also supports the output destination and output format op- - tions The output formats supported are txt, csv, and (experimental) + tions The output formats supported are txt, csv, and (experimental) json. register-match register-match Print the one posting whose transaction description is closest to DESC, - in the style of the register command. If there are multiple equally - good matches, it shows the most recent. Query options (options, not - arguments) can be used to restrict the search space. Helps ledger-au- + in the style of the register command. If there are multiple equally + good matches, it shows the most recent. Query options (options, not + arguments) can be used to restrict the search space. Helps ledger-au- tosync detect already-seen transactions when importing. rewrite 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: @@ -3050,7 +3076,7 @@ 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: @@ -3060,16 +3086,16 @@ 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 in- + factor for an amount of original matched posting. If the amount in- cludes a commodity name, the new posting amount will be in the new com- - modity; otherwise, it will be in the matched posting amount's commod- + modity; otherwise, it will be in the matched posting amount's commod- ity. 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. @@ -3084,7 +3110,7 @@ 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. @@ -3097,12 +3123,12 @@ 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' @@ -3126,10 +3152,10 @@ 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: @@ -3137,48 +3163,48 @@ 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 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. - This command assumes that you have account(s) that hold nothing but + This command assumes that you have account(s) that hold nothing but your investments and whenever you record current appraisal/valuation of these investments you offset unrealized profit and loss into account(s) that, again, hold nothing but unrealized profit and loss. - Any transactions affecting balance of investment account(s) and not - originating from unrealized profit and loss account(s) are assumed to + Any transactions affecting balance of investment account(s) and not + originating from unrealized profit and loss account(s) are assumed to be your investments or withdrawals. - At a minimum, you need to supply a query (which could be just an ac- + At a minimum, you need to supply a query (which could be just an ac- count name) to select your investments with --inv, and another query to identify your profit and loss transactions with --pnl. - It 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, + It 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. stats stats Show some journal 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. Example: @@ -3196,35 +3222,35 @@ COMMANDS Commodities : 1 ($) Market prices : 12 ($) - This command also supports output destination and output format selec- + This command also supports output destination and output format selec- tion. tags tags - List the unique tag names used in the journal. With a TAGREGEX argu- + List the unique tag names used in the journal. With a TAGREGEX argu- ment, only tag names matching the regular expression (case insensitive) - are shown. With QUERY arguments, only transactions matching the query + are shown. With QUERY arguments, only transactions matching the query are considered. With the --values flag, the tags' unique values are listed instead. - With --parsed flag, all tags or values are shown in the order they are + With --parsed flag, all tags or values are shown in the order they are parsed from the input data, including duplicates. - With -E/--empty, any blank/empty values will also be shown, otherwise + With -E/--empty, any blank/empty values will also be shown, otherwise they are omitted. test 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 -- @@ -3233,35 +3259,35 @@ 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). Add-on commands - hledger also searches for external add-on commands, and will include + hledger also searches for external add-on commands, and will include these in the commands list. These are programs or scripts in your PATH - whose name starts with hledger- and ends with a recognised file exten- + whose name starts with hledger- and ends with a recognised file exten- sion (currently: no extension, bat,com,exe, hs,lhs,pl,py,rb,rkt,sh). - Add-ons can be invoked like any hledger command, but there are a few + Add-ons can be invoked like any hledger command, but there are a few things to be aware of. Eg if the hledger-web add-on is installed, - o hledger -h web shows hledger's help, while hledger web -h shows + o hledger -h web shows hledger's help, while hledger web -h shows hledger-web's help. - o Flags specific to the add-on must have a preceding -- to hide them - from hledger. So hledger web --serve --port 9000 will be rejected; + o Flags specific to the add-on must have a preceding -- to hide them + from hledger. So hledger web --serve --port 9000 will be rejected; you must use hledger web -- --serve --port 9000. o You can always run add-ons directly if preferred: hledger-web --serve --port 9000. - Add-ons are a relatively easy way to add local features or experiment - with new ideas. They can be written in any language, but haskell - scripts have a big advantage: they can use the same hledger (and - haskell) library functions that built-in commands do, for command-line + Add-ons are a relatively easy way to add local features or experiment + with new ideas. They can be written in any language, but haskell + scripts have a big advantage: they can use the same hledger (and + haskell) library functions that built-in commands do, for command-line options, journal parsing, reporting, etc. - Two important add-ons are the hledger-ui and hledger-web user inter- + Two important add-ons are the hledger-ui and hledger-web user inter- faces. These are maintained and released along with hledger: ui @@ -3280,20 +3306,20 @@ COMMANDS hledger-interest generates interest transactions for an account accord- ing to various schemes. - A few more experimental or old add-ons can be found in hledger's bin/ + A few more experimental or old add-ons can be found in hledger's bin/ directory. These are typically prototypes and not guaranteed to work. ENVIRONMENT LEDGER_FILE The journal file path when not specified with -f. Default: - ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- + ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). - A typical value is ~/DIR/YYYY.journal, where DIR is a version-con- - trolled finance directory and YYYY is the current year. Or ~/DIR/cur- + A typical value is ~/DIR/YYYY.journal, where DIR is a version-con- + trolled finance directory and YYYY is the current year. Or ~/DIR/cur- rent.journal, where current.journal is a symbolic link to YYYY.journal. On Mac computers, you can set this and other environment variables in a - more thorough way that also affects applications started from the GUI + more thorough way that also affects applications started from the GUI (say, an Emacs dock icon). Eg on MacOS Catalina I have a ~/.MacOSX/en- vironment.plist file containing @@ -3303,21 +3329,21 @@ ENVIRONMENT To see the effect you may need to killall Dock, or reboot. - COLUMNS The screen width used by the register command. Default: the + COLUMNS The screen width used by the register command. Default: the full terminal width. - NO_COLOR If this variable exists with any value, hledger will not use - ANSI color codes in terminal output. This overrides the + NO_COLOR If this variable exists with any value, hledger will not use + ANSI color codes in terminal output. This overrides the --color/--colour option. FILES - Reads data from one or more files in hledger journal, timeclock, time- - dot, or CSV format specified with -f, or $LEDGER_FILE, or - $HOME/.hledger.journal (on windows, perhaps + Reads data from one or more files in hledger journal, timeclock, time- + dot, or CSV format specified with -f, or $LEDGER_FILE, or + $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). LIMITATIONS - The need to precede addon command options with -- when invoked from + The need to precede addon command options with -- when invoked from hledger is awkward. When input data contains non-ascii characters, a suitable system locale @@ -3333,36 +3359,36 @@ LIMITATIONS In a Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add. - Not all of Ledger's journal file syntax is supported. See file format + Not all of Ledger's journal file syntax is supported. See file format differences. - On large data files, hledger is slower and uses more memory than + On large data files, hledger is slower and uses more memory than Ledger. TROUBLESHOOTING - Here are some issues you might encounter when you run hledger (and re- - member you can also seek help from the IRC channel, mail list or bug + Here are some issues you might encounter when you run hledger (and re- + member you can also seek help from the IRC channel, mail list or bug tracker): Successfully installed, but "No command 'hledger' found" stack and cabal install binaries into a special directory, which should - be added to your PATH environment variable. Eg on unix-like systems, + be added to your PATH environment variable. Eg on unix-like systems, that is ~/.local/bin and ~/.cabal/bin respectively. I set a custom LEDGER_FILE, but hledger is still using the default file - LEDGER_FILE should be a real environment variable, not just a shell - variable. The command env | grep LEDGER_FILE should show it. You may + LEDGER_FILE should be a real environment variable, not just a shell + variable. The command env | grep LEDGER_FILE should show it. You may need to use export. Here's an explanation. - Getting errors like "Illegal byte sequence" or "Invalid or incomplete - multibyte or wide character" or "commitAndReleaseBuffer: invalid argu- + Getting errors like "Illegal byte sequence" or "Invalid or incomplete + multibyte or wide character" or "commitAndReleaseBuffer: invalid argu- ment (invalid character)" Programs compiled with GHC (hledger, haskell build tools, etc.) need to have a UTF-8-aware locale configured in the environment, otherwise they - will fail with these kinds of errors when they encounter non-ascii + will fail with these kinds of errors when they encounter non-ascii characters. - To fix it, set the LANG environment variable to some locale which sup- + To fix it, set the LANG environment variable to some locale which sup- ports UTF-8. The locale you choose must be installed on your system. Here's an example of setting LANG temporarily, on Ubuntu GNU/Linux: @@ -3377,8 +3403,8 @@ TROUBLESHOOTING POSIX $ LANG=en_US.utf8 hledger -f my.journal print # ensure it is used for this command - If available, C.UTF-8 will also work. If your preferred locale isn't - listed by locale -a, you might need to install it. Eg on Ubuntu/De- + If available, C.UTF-8 will also work. If your preferred locale isn't + listed by locale -a, you might need to install it. Eg on Ubuntu/De- bian: $ apt-get install language-pack-fr @@ -3398,8 +3424,8 @@ TROUBLESHOOTING $ echo "export LANG=en_US.utf8" >>~/.bash_profile $ bash --login - Exact spelling and capitalisation may be important. Note the differ- - ence on MacOS (UTF-8, not utf8). Some platforms (eg ubuntu) allow + Exact spelling and capitalisation may be important. Note the differ- + ence on MacOS (UTF-8, not utf8). Some platforms (eg ubuntu) allow variant spellings, but others (eg macos) require it to be exact: $ locale -a | grep -iE en_us.*utf @@ -3409,7 +3435,7 @@ TROUBLESHOOTING REPORTING BUGS - Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel + Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -3423,7 +3449,7 @@ COPYRIGHT SEE ALSO - hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), + hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -3431,4 +3457,4 @@ SEE ALSO -hledger 1.18.99 July 2020 hledger(1) +hledger 1.18.99 August 2020 hledger(1)