diff --git a/doc/lib.m4 b/doc/lib.m4 index c09293839..ecc18153c 100644 --- a/doc/lib.m4 +++ b/doc/lib.m4 @@ -92,8 +92,8 @@ m4_define({{_inputoptions_}}, {{ `--anon` : anonymize accounts and payees -`--pivot TAGNAME` -: use some other field/tag for account names +`--pivot FIELDNAME` +: use some other field or tag for the account name `-I --ignore-assertions` : ignore any failing balance assertions diff --git a/hledger-lib/doc/hledger_journal.5 b/hledger-lib/doc/hledger_journal.5 index 31075d279..707697e56 100644 --- a/hledger-lib/doc/hledger_journal.5 +++ b/hledger-lib/doc/hledger_journal.5 @@ -77,7 +77,10 @@ This can be followed by any of the following, separated by spaces: parentheses) .IP \[bu] 2 (optional) a transaction description (any remaining text until end of -line) +line or a semicolon) +.IP \[bu] 2 +(optional) a transaction comment (any remaining text following a +semicolon until end of line) .PP Then comes zero or more (but usually at least 2) indented lines representing... @@ -300,6 +303,23 @@ With this scheme, you would use \f[C]\-PC\f[] to see the current balance at your bank, \f[C]\-U\f[] to see things which will probably hit your bank soon (like uncashed checks), and no flags to see the most up\-to\-date state of your finances. +.SS Description, payee and note +.PP +As mentioned, a transaction\[aq]s description is the rest of the line +following the date and status mark (or, the rest of line until a comment +begins). +Sometimes called the "narration" in traditional bookkeeping, it can be +used for whatever you wish, or left blank. +The description can be queried, unlike comments. +.PP +Including a \f[C]|\f[] (pipe) character in the description will +subdivide it into a payee/payer name (on the left) and additional notes +(on the right). +This is entirely optional, but it can allow more precise +.PD 0 +.P +.PD +querying and pivoting. .SS Account names .PP Account names typically have several parts separated by a full colon, @@ -797,24 +817,6 @@ For example, the following transaction has three tags (\f[C]A\f[], .PP Tags are like Ledger\[aq]s metadata feature, except hledger\[aq]s tag values are simple strings. -.SS Implicit tags -.PP -Some predefined "implicit" tags are also provided: -.IP \[bu] 2 -\f[C]code\f[] \- the transaction\[aq]s code field -.IP \[bu] 2 -\f[C]description\f[] \- the transaction\[aq]s description -.IP \[bu] 2 -\f[C]payee\f[] \- the part of description before \f[C]|\f[], or all of -it -.IP \[bu] 2 -\f[C]note\f[] \- the part of description after \f[C]|\f[], or all of it -.PP -\f[C]payee\f[] and \f[C]note\f[] support descriptions written in a -special \f[C]PAYEE\ |\ NOTE\f[] format, accessing the parts before and -after the pipe character respectively. -For descriptions not containing a pipe character they are the same as -\f[C]description\f[]. .SS Directives .SS Account aliases .PP diff --git a/hledger-lib/doc/hledger_journal.5.info b/hledger-lib/doc/hledger_journal.5.info index c14cf2362..458cc7fd4 100644 --- a/hledger-lib/doc/hledger_journal.5.info +++ b/hledger-lib/doc/hledger_journal.5.info @@ -71,6 +71,7 @@ File: hledger_journal.5.info, Node: FILE FORMAT, Next: EDITOR SUPPORT, Prev: * Postings:: * Dates:: * Status:: +* Description payee and note:: * Account names:: * Amounts:: * Virtual Postings:: @@ -96,7 +97,9 @@ following, separated by spaces: * (optional) a transaction code (any short number or text, enclosed in parentheses) * (optional) a transaction description (any remaining text until end - of line) + of line or a semicolon) + * (optional) a transaction comment (any remaining text following a + semicolon until end of line) Then comes zero or more (but usually at least 2) indented lines representing... @@ -231,7 +234,7 @@ characters in this way. With this syntax, DATE infers its year from the transaction and DATE2 infers its year from DATE.  -File: hledger_journal.5.info, Node: Status, Next: Account names, Prev: Dates, Up: FILE FORMAT +File: hledger_journal.5.info, Node: Status, Next: Description payee and note, Prev: Dates, Up: FILE FORMAT 1.4 Status ========== @@ -281,9 +284,26 @@ your bank, '-U' to see things which will probably hit your bank soon your finances.  -File: hledger_journal.5.info, Node: Account names, Next: Amounts, Prev: Status, Up: FILE FORMAT +File: hledger_journal.5.info, Node: Description payee and note, Next: Account names, Prev: Status, Up: FILE FORMAT -1.5 Account names +1.5 Description, payee and note +=============================== + +As mentioned, a transaction's description is the rest of the line +following the date and status mark (or, the rest of line until a comment +begins). Sometimes called the "narration" in traditional bookkeeping, +it can be used for whatever you wish, or left blank. The description +can be queried, unlike comments. + + Including a '|' (pipe) character in the description will subdivide it +into a payee/payer name (on the left) and additional notes (on the +right). This is entirely optional, but it can allow more precise +querying and pivoting. + + +File: hledger_journal.5.info, Node: Account names, Next: Amounts, Prev: Description payee and note, Up: FILE FORMAT + +1.6 Account names ================= Account names typically have several parts separated by a full colon, @@ -301,7 +321,7 @@ more spaces* (or newline).  File: hledger_journal.5.info, Node: Amounts, Next: Virtual Postings, Prev: Account names, Up: FILE FORMAT -1.6 Amounts +1.7 Amounts =========== After the account name, there is usually an amount. Important: between @@ -356,7 +376,7 @@ format with a commodity directive.  File: hledger_journal.5.info, Node: Virtual Postings, Next: Balance Assertions, Prev: Amounts, Up: FILE FORMAT -1.7 Virtual Postings +1.8 Virtual Postings ==================== When you parenthesise the account name in a posting, we call that a @@ -391,7 +411,7 @@ is more correct and provides better error checking.  File: hledger_journal.5.info, Node: Balance Assertions, Next: Balance Assignments, Prev: Virtual Postings, Up: FILE FORMAT -1.8 Balance Assertions +1.9 Balance Assertions ====================== hledger supports Ledger-style balance assertions in journal files. @@ -425,7 +445,7 @@ or for reading Ledger files.  File: hledger_journal.5.info, Node: Assertions and ordering, Next: Assertions and included files, Up: Balance Assertions -1.8.1 Assertions and ordering +1.9.1 Assertions and ordering ----------------------------- hledger sorts an account's postings and assertions first by date and @@ -444,7 +464,7 @@ can assert intra-day balances.  File: hledger_journal.5.info, Node: Assertions and included files, Next: Assertions and multiple -f options, Prev: Assertions and ordering, Up: Balance Assertions -1.8.2 Assertions and included files +1.9.2 Assertions and included files ----------------------------------- With included files, things are a little more complicated. Including @@ -456,7 +476,7 @@ you'll have to put the assertion in the right file.  File: hledger_journal.5.info, Node: Assertions and multiple -f options, Next: Assertions and commodities, Prev: Assertions and included files, Up: Balance Assertions -1.8.3 Assertions and multiple -f options +1.9.3 Assertions and multiple -f options ---------------------------------------- Balance assertions don't work well across files specified with multiple @@ -465,7 +485,7 @@ Balance assertions don't work well across files specified with multiple  File: hledger_journal.5.info, Node: Assertions and commodities, Next: Assertions and subaccounts, Prev: Assertions and multiple -f options, Up: Balance Assertions -1.8.4 Assertions and commodities +1.9.4 Assertions and commodities -------------------------------- The asserted balance must be a simple single-commodity amount, and in @@ -484,7 +504,7 @@ for this kind of total balance assertion if there's demand.)  File: hledger_journal.5.info, Node: Assertions and subaccounts, Next: Assertions and virtual postings, Prev: Assertions and commodities, Up: Balance Assertions -1.8.5 Assertions and subaccounts +1.9.5 Assertions and subaccounts -------------------------------- Balance assertions do not count the balance from subaccounts; they check @@ -507,7 +527,7 @@ $ hledger bal checking --flat  File: hledger_journal.5.info, Node: Assertions and virtual postings, Prev: Assertions and subaccounts, Up: Balance Assertions -1.8.6 Assertions and virtual postings +1.9.6 Assertions and virtual postings ------------------------------------- Balance assertions are checked against all postings, both real and @@ -517,8 +537,8 @@ query.  File: hledger_journal.5.info, Node: Balance Assignments, Next: Prices, Prev: Balance Assertions, Up: FILE FORMAT -1.9 Balance Assignments -======================= +1.10 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 @@ -550,7 +570,7 @@ hledger or do the calculations yourself, instead of just reading it.  File: hledger_journal.5.info, Node: Prices, Next: Comments, Prev: Balance Assignments, Up: FILE FORMAT -1.10 Prices +1.11 Prices =========== * Menu: @@ -561,7 +581,7 @@ File: hledger_journal.5.info, Node: Prices, Next: Comments, Prev: Balance Ass  File: hledger_journal.5.info, Node: Transaction prices, Next: Market prices, Up: Prices -1.10.1 Transaction prices +1.11.1 Transaction prices ------------------------- Within a transaction, you can note an amount's price in another @@ -622,7 +642,7 @@ $ hledger bal -N --flat -B  File: hledger_journal.5.info, Node: Market prices, Prev: Transaction prices, Up: Prices -1.10.2 Market prices +1.11.2 Market prices -------------------- Market prices are not tied to a particular transaction; they represent @@ -651,7 +671,7 @@ P 2010/1/1 € $1.40  File: hledger_journal.5.info, Node: Comments, Next: Tags, Prev: Prices, Up: FILE FORMAT -1.11 Comments +1.12 Comments ============= Lines in the journal beginning with a semicolon (';') or hash ('#') or @@ -691,7 +711,7 @@ end comment  File: hledger_journal.5.info, Node: Tags, Next: Directives, Prev: Comments, Up: FILE FORMAT -1.12 Tags +1.13 Tags ========= Tags are a way to add extra labels or labelled data to postings and @@ -730,32 +750,11 @@ example, the following transaction has three tags ('A', 'TAG2', Tags are like Ledger's metadata feature, except hledger's tag values are simple strings. -* Menu: - -* Implicit tags:: - - -File: hledger_journal.5.info, Node: Implicit tags, Up: Tags - -1.12.1 Implicit tags --------------------- - -Some predefined "implicit" tags are also provided: - - * 'code' - the transaction's code field - * 'description' - the transaction's description - * 'payee' - the part of description before '|', or all of it - * 'note' - the part of description after '|', or all of it - - 'payee' and 'note' support descriptions written in a special 'PAYEE | -NOTE' format, accessing the parts before and after the pipe character -respectively. For descriptions not containing a pipe character they are -the same as 'description'.  File: hledger_journal.5.info, Node: Directives, Prev: Tags, Up: FILE FORMAT -1.13 Directives +1.14 Directives =============== * Menu: @@ -772,7 +771,7 @@ File: hledger_journal.5.info, Node: Directives, Prev: Tags, Up: FILE FORMAT  File: hledger_journal.5.info, Node: Account aliases, Next: account directive, Up: Directives -1.13.1 Account aliases +1.14.1 Account aliases ---------------------- You can define aliases which rewrite your account names (after reading @@ -797,7 +796,7 @@ be useful for:  File: hledger_journal.5.info, Node: Basic aliases, Next: Regex aliases, Up: Account aliases -1.13.1.1 Basic aliases +1.14.1.1 Basic aliases ...................... To set an account alias, use the 'alias' directive in your journal file. @@ -820,7 +819,7 @@ alias checking = assets:bank:wells fargo:checking  File: hledger_journal.5.info, Node: Regex aliases, Next: Multiple aliases, Prev: Basic aliases, Up: Account aliases -1.13.1.2 Regex aliases +1.14.1.2 Regex aliases ...................... There is also a more powerful variant that uses a regular expression, @@ -843,7 +842,7 @@ alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3  File: hledger_journal.5.info, Node: Multiple aliases, Next: end aliases, Prev: Regex aliases, Up: Account aliases -1.13.1.3 Multiple aliases +1.14.1.3 Multiple aliases ......................... You can define as many aliases as you like using directives or @@ -859,7 +858,7 @@ following order:  File: hledger_journal.5.info, Node: end aliases, Prev: Multiple aliases, Up: Account aliases -1.13.1.4 end aliases +1.14.1.4 end aliases .................... You can clear (forget) all currently defined aliases with the 'end @@ -870,7 +869,7 @@ end aliases  File: hledger_journal.5.info, Node: account directive, Next: apply account directive, Prev: Account aliases, Up: Directives -1.13.2 account directive +1.14.2 account directive ------------------------ The 'account' directive predefines account names, as in Ledger and @@ -891,7 +890,7 @@ account expenses:food  File: hledger_journal.5.info, Node: apply account directive, Next: Multi-line comments, Prev: account directive, Up: Directives -1.13.3 apply account directive +1.14.3 apply account directive ------------------------------ You can specify a parent account which will be prepended to all accounts @@ -927,7 +926,7 @@ supported.  File: hledger_journal.5.info, Node: Multi-line comments, Next: commodity directive, Prev: apply account directive, Up: Directives -1.13.4 Multi-line comments +1.14.4 Multi-line comments -------------------------- A line containing just 'comment' starts a multi-line comment, and a line @@ -936,7 +935,7 @@ containing just 'end comment' ends it. See comments.  File: hledger_journal.5.info, Node: commodity directive, Next: Default commodity, Prev: Multi-line comments, Up: Directives -1.13.5 commodity directive +1.14.5 commodity directive -------------------------- The 'commodity' directive predefines commodities (currently this is just @@ -968,7 +967,7 @@ commodity INR  File: hledger_journal.5.info, Node: Default commodity, Next: Default year, Prev: commodity directive, Up: Directives -1.13.6 Default commodity +1.14.6 Default commodity ------------------------ The D directive sets a default commodity (and display format), to be @@ -988,7 +987,7 @@ D $1,000.00  File: hledger_journal.5.info, Node: Default year, Next: Including other files, Prev: Default commodity, Up: Directives -1.13.7 Default year +1.14.7 Default year ------------------- You can set a default year to be used for subsequent dates which don't @@ -1014,7 +1013,7 @@ Y2010 ; change default year to 2010  File: hledger_journal.5.info, Node: Including other files, Prev: Default year, Up: Directives -1.13.8 Including other files +1.14.8 Including other files ---------------------------- You can pull in the content of additional journal files by writing an @@ -1055,81 +1054,81 @@ Tag Table: Node: Top78 Node: FILE FORMAT2380 Ref: #file-format2506 -Node: Transactions2713 -Ref: #transactions2836 -Node: Postings3401 -Ref: #postings3530 -Node: Dates4525 -Ref: #dates4642 -Node: Simple dates4707 -Ref: #simple-dates4835 -Node: Secondary dates5201 -Ref: #secondary-dates5357 -Node: Posting dates6920 -Ref: #posting-dates7051 -Node: Status8425 -Ref: #status8549 -Node: Account names10263 -Ref: #account-names10403 -Node: Amounts10890 -Ref: #amounts11028 -Node: Virtual Postings13129 -Ref: #virtual-postings13290 -Node: Balance Assertions14510 -Ref: #balance-assertions14687 -Node: Assertions and ordering15583 -Ref: #assertions-and-ordering15771 -Node: Assertions and included files16471 -Ref: #assertions-and-included-files16714 -Node: Assertions and multiple -f options17047 -Ref: #assertions-and-multiple--f-options17303 -Node: Assertions and commodities17435 -Ref: #assertions-and-commodities17672 -Node: Assertions and subaccounts18368 -Ref: #assertions-and-subaccounts18602 -Node: Assertions and virtual postings19123 -Ref: #assertions-and-virtual-postings19332 -Node: Balance Assignments19474 -Ref: #balance-assignments19643 -Node: Prices20762 -Ref: #prices20897 -Node: Transaction prices20948 -Ref: #transaction-prices21095 -Node: Market prices23251 -Ref: #market-prices23388 -Node: Comments24348 -Ref: #comments24472 -Node: Tags25585 -Ref: #tags25705 -Node: Implicit tags27134 -Ref: #implicit-tags27242 -Node: Directives27759 -Ref: #directives27874 -Node: Account aliases28067 -Ref: #account-aliases28213 -Node: Basic aliases28817 -Ref: #basic-aliases28962 -Node: Regex aliases29652 -Ref: #regex-aliases29822 -Node: Multiple aliases30537 -Ref: #multiple-aliases30711 -Node: end aliases31209 -Ref: #end-aliases31351 -Node: account directive31452 -Ref: #account-directive31634 -Node: apply account directive31930 -Ref: #apply-account-directive32128 -Node: Multi-line comments32787 -Ref: #multi-line-comments32979 -Node: commodity directive33107 -Ref: #commodity-directive33293 -Node: Default commodity34165 -Ref: #default-commodity34340 -Node: Default year34877 -Ref: #default-year35044 -Node: Including other files35467 -Ref: #including-other-files35626 -Node: EDITOR SUPPORT36023 -Ref: #editor-support36143 +Node: Transactions2744 +Ref: #transactions2867 +Node: Postings3551 +Ref: #postings3680 +Node: Dates4675 +Ref: #dates4792 +Node: Simple dates4857 +Ref: #simple-dates4985 +Node: Secondary dates5351 +Ref: #secondary-dates5507 +Node: Posting dates7070 +Ref: #posting-dates7201 +Node: Status8575 +Ref: #status8712 +Node: Description payee and note10426 +Ref: #description-payee-and-note10613 +Node: Account names11157 +Ref: #account-names11317 +Node: Amounts11804 +Ref: #amounts11942 +Node: Virtual Postings14043 +Ref: #virtual-postings14204 +Node: Balance Assertions15424 +Ref: #balance-assertions15601 +Node: Assertions and ordering16497 +Ref: #assertions-and-ordering16685 +Node: Assertions and included files17385 +Ref: #assertions-and-included-files17628 +Node: Assertions and multiple -f options17961 +Ref: #assertions-and-multiple--f-options18217 +Node: Assertions and commodities18349 +Ref: #assertions-and-commodities18586 +Node: Assertions and subaccounts19282 +Ref: #assertions-and-subaccounts19516 +Node: Assertions and virtual postings20037 +Ref: #assertions-and-virtual-postings20246 +Node: Balance Assignments20388 +Ref: #balance-assignments20559 +Node: Prices21678 +Ref: #prices21813 +Node: Transaction prices21864 +Ref: #transaction-prices22011 +Node: Market prices24167 +Ref: #market-prices24304 +Node: Comments25264 +Ref: #comments25388 +Node: Tags26501 +Ref: #tags26621 +Node: Directives28023 +Ref: #directives28138 +Node: Account aliases28331 +Ref: #account-aliases28477 +Node: Basic aliases29081 +Ref: #basic-aliases29226 +Node: Regex aliases29916 +Ref: #regex-aliases30086 +Node: Multiple aliases30801 +Ref: #multiple-aliases30975 +Node: end aliases31473 +Ref: #end-aliases31615 +Node: account directive31716 +Ref: #account-directive31898 +Node: apply account directive32194 +Ref: #apply-account-directive32392 +Node: Multi-line comments33051 +Ref: #multi-line-comments33243 +Node: commodity directive33371 +Ref: #commodity-directive33557 +Node: Default commodity34429 +Ref: #default-commodity34604 +Node: Default year35141 +Ref: #default-year35308 +Node: Including other files35731 +Ref: #including-other-files35890 +Node: EDITOR SUPPORT36287 +Ref: #editor-support36407  End Tag Table diff --git a/hledger-lib/doc/hledger_journal.5.m4.md b/hledger-lib/doc/hledger_journal.5.m4.md index 53edfbe34..13cb16711 100644 --- a/hledger-lib/doc/hledger_journal.5.m4.md +++ b/hledger-lib/doc/hledger_journal.5.m4.md @@ -75,7 +75,8 @@ This can be followed by any of the following, separated by spaces: - (optional) a [status](#status) character (empty, `!`, or `*`) - (optional) a transaction code (any short number or text, enclosed in parentheses) -- (optional) a transaction description (any remaining text until end of line) +- (optional) a transaction description (any remaining text until end of line or a semicolon) +- (optional) a transaction comment (any remaining text following a semicolon until end of line) Then comes zero or more (but usually at least 2) indented lines representing... @@ -228,6 +229,18 @@ With this scheme, you would use `-U` to see things which will probably hit your bank soon (like uncashed checks), and no flags to see the most up-to-date state of your finances. +## Description, payee and note + +As mentioned, a transaction's description is the rest of the line following the date and status mark +(or, the rest of line until a comment begins). +Sometimes called the "narration" in traditional bookkeeping, it can be used for whatever you wish, +or left blank. The description can be queried, unlike [comments](#comments). + +Including a `|` (pipe) character in the description will subdivide it +into a payee/payer name (on the left) and additional notes (on the right). +This is entirely optional, but it can allow more precise +[querying](/hledger.html#queries) and [pivoting](/hledger.html#pivoting). + ## Account names Account names typically have several parts separated by a full colon, from @@ -604,19 +617,6 @@ Tags are like Ledger's [metadata](http://ledger-cli.org/3.0/doc/ledger3.html#Metadata) feature, except hledger's tag values are simple strings. -### Implicit tags - -Some predefined "implicit" tags are also provided: - -- `code` - the transaction's code field -- `description` - the transaction's description -- `payee` - the part of description before `|`, or all of it -- `note` - the part of description after `|`, or all of it - -`payee` and `note` support descriptions written in a special `PAYEE | NOTE` format, -accessing the parts before and after the pipe character respectively. -For descriptions not containing a pipe character they are the same as `description`. - ## Directives ### Account aliases diff --git a/hledger-lib/doc/hledger_journal.5.txt b/hledger-lib/doc/hledger_journal.5.txt index bfbfa9855..95285f32c 100644 --- a/hledger-lib/doc/hledger_journal.5.txt +++ b/hledger-lib/doc/hledger_journal.5.txt @@ -68,59 +68,62 @@ FILE FORMAT parentheses) o (optional) a transaction description (any remaining text until end of - line) + line or a semicolon) - Then comes zero or more (but usually at least 2) indented lines repre- + o (optional) a transaction comment (any remaining text following a + semicolon until end of line) + + Then comes zero or more (but usually at least 2) indented lines repre- senting... Postings - A posting is an addition of some amount to, or removal of some amount - from, an account. Each posting line begins with at least one space or + A posting is an addition of some amount to, or removal of some amount + from, an account. Each posting line begins with at least one space or tab (2 or 4 spaces is common), followed by: o (optional) a status character (empty, !, or *), followed by a space - o (required) an account name (any text, optionally containing single + o (required) an account name (any text, optionally containing single spaces, until end of line or a double space) o (optional) two or more spaces or tabs followed by an amount. - Positive amounts are being added to the account, negative amounts are + Positive amounts are being added to the account, negative amounts are being removed. The amounts within a transaction must always sum up to zero. As a con- - venience, one amount may be left blank; it will be inferred so as to + venience, one amount may be left blank; it will be inferred so as to balance the transaction. - Be sure to note the unusual two-space delimiter between account name - and amount. This makes it easy to write account names containing spa- - ces. But if you accidentally leave only one space (or tab) before the + Be sure to note the unusual two-space delimiter between account name + and amount. This makes it easy to write account names containing spa- + ces. But if you accidentally leave only one space (or tab) before the amount, the amount will be considered part of the account name. Dates Simple dates - Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D) - Leading zeros are optional. The year may be omitted, in which case it - will be inferred from the context - the current transaction, the - default year set with a default year directive, or the current date - when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31, + Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D) + Leading zeros are optional. The year may be omitted, in which case it + will be inferred from the context - the current transaction, the + default year set with a default year directive, or the current date + when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31, 2010.1.31. Secondary dates - Real-life transactions sometimes involve more than one date - eg the + Real-life transactions sometimes involve more than one date - eg the date you write a cheque, and the date it clears in your bank. When you - want to model this, eg for more accurate balances, you can specify - individual posting dates, which I recommend. Or, you can use the sec- - ondary dates (aka auxiliary/effective dates) feature, supported for + want to model this, eg for more accurate balances, you can specify + individual posting dates, which I recommend. Or, you can use the sec- + ondary dates (aka auxiliary/effective dates) feature, supported for compatibility with Ledger. A secondary date can be written after the primary date, separated by an - equals sign. The primary date, on the left, is used by default; the - secondary date, on the right, is used when the --date2 flag is speci- + equals sign. The primary date, on the left, is used by default; the + secondary date, on the right, is used when the --date2 flag is speci- fied (--aux-date or --effective also work). - The meaning of secondary dates is up to you, but it's best to follow a - consistent rule. Eg write the bank's clearing date as primary, and + The meaning of secondary dates is up to you, but it's best to follow a + consistent rule. Eg write the bank's clearing date as primary, and when needed, the date the transaction was initiated as secondary. Here's an example. Note that a secondary date will use the year of the @@ -136,18 +139,18 @@ FILE FORMAT $ hledger register checking --date2 2010/02/19 movie ticket assets:checking $-10 $-10 - Secondary dates require some effort; you must use them consistently in + Secondary dates require some effort; you must use them consistently in your journal entries and remember whether to use or not use the --date2 flag for your reports. They are included in hledger for Ledger compat- - ibility, but posting dates are a more powerful and less confusing + ibility, but posting dates are a more powerful and less confusing alternative. Posting dates - You can give individual postings a different date from their parent - transaction, by adding a posting comment containing a tag (see below) + You can give individual postings a different date from their parent + transaction, by adding a posting comment containing a tag (see below) like date:DATE. This is probably the best way to control posting dates - precisely. Eg in this example the expense should appear in May - reports, and the deduction from checking should be reported on 6/1 for + precisely. Eg in this example the expense should appear in May + reports, and the deduction from checking should be reported on 6/1 for easy bank reconciliation: 2015/5/30 @@ -160,22 +163,22 @@ FILE FORMAT $ hledger -f t.j register checking 2015/06/01 assets:checking $-10 $-10 - DATE should be a simple date; if the year is not specified it will use - the year of the transaction's date. You can set the secondary date - similarly, with date2:DATE2. The date: or date2: tags must have a - valid simple date value if they are present, eg a date: tag with no + DATE should be a simple date; if the year is not specified it will use + the year of the transaction's date. You can set the secondary date + similarly, with date2:DATE2. The date: or date2: tags must have a + valid simple date value if they are present, eg a date: tag with no value is not allowed. Ledger's earlier, more compact bracketed date syntax is also supported: - [DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any + [DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any square-bracketed sequence of the 0123456789/-.= characters in this way. - With this syntax, DATE infers its year from the transaction and DATE2 + With this syntax, DATE infers its year from the transaction and DATE2 infers its year from DATE. Status - Transactions, or individual postings within a transaction, can have a - status mark, which is a single character before the transaction - description or posting account name, separated from it by a space, + Transactions, or individual postings within a transaction, can have a + status mark, which is a single character before the transaction + description or posting account name, separated from it by a space, indicating one of three statuses: @@ -185,47 +188,59 @@ FILE FORMAT ! pending * cleared - When reporting, you can filter by status with the -U/--unmarked, - -P/--pending, and -C/--cleared flags; or the status:, status:!, and + When reporting, you can filter by status with the -U/--unmarked, + -P/--pending, and -C/--cleared flags; or the status:, status:!, and status:* queries; or the U, P, C keys in hledger-ui. - Note, in Ledger and in older versions of hledger, the "unmarked" state - is called "uncleared". As of hledger 1.3 we have renamed it to + Note, in Ledger and in older versions of hledger, the "unmarked" state + is called "uncleared". As of hledger 1.3 we have renamed it to unmarked for clarity. - To replicate Ledger and old hledger's behaviour of also matching pend- + To replicate Ledger and old hledger's behaviour of also matching pend- ing, combine -U and -P. - Status marks are optional, but can be helpful eg for reconciling with + Status marks are optional, but can be helpful eg for reconciling with real-world accounts. Some editor modes provide highlighting and short- - cuts for working with status. Eg in Emacs ledger-mode, you can toggle + cuts for working with status. Eg in Emacs ledger-mode, you can toggle transaction status with C-c C-e, or posting status with C-c C-c. - What "uncleared", "pending", and "cleared" actually mean is up to you. + What "uncleared", "pending", and "cleared" actually mean is up to you. Here's one suggestion: status meaning -------------------------------------------------------------------------- uncleared recorded but not yet reconciled; needs review - pending tentatively reconciled (if needed, eg during a big recon- + pending tentatively reconciled (if needed, eg during a big recon- ciliation) - cleared complete, reconciled as far as possible, and considered + cleared complete, reconciled as far as possible, and considered correct - With this scheme, you would use -PC to see the current balance at your - bank, -U to see things which will probably hit your bank soon (like + With this scheme, you would use -PC to see the current balance at your + bank, -U to see things which will probably hit your bank soon (like uncashed checks), and no flags to see the most up-to-date state of your finances. - Account names - Account names typically have several parts separated by a full colon, - from which hledger derives a hierarchical chart of accounts. They can - be anything you like, but in finance there are traditionally five - top-level accounts: assets, liabilities, income, expenses, and equity. + Description, payee and note + As mentioned, a transaction's description is the rest of the line fol- + lowing the date and status mark (or, the rest of line until a comment + begins). Sometimes called the "narration" in traditional bookkeeping, + it can be used for whatever you wish, or left blank. The description + can be queried, unlike comments. - Account names may contain single spaces, eg: assets:accounts receiv- - able. Because of this, they must always be followed by two or more + Including a | (pipe) character in the description will subdivide it + into a payee/payer name (on the left) and additional notes (on the + right). This is entirely optional, but it can allow more precise + querying and pivoting. + + Account names + Account names typically have several parts separated by a full colon, + from which hledger derives a hierarchical chart of accounts. They can + be anything you like, but in finance there are traditionally five + top-level accounts: assets, liabilities, income, expenses, and equity. + + Account names may contain single spaces, eg: assets:accounts receiv- + able. Because of this, they must always be followed by two or more spaces (or newline). Account names can be aliased. @@ -234,7 +249,7 @@ FILE FORMAT After the account name, there is usually an amount. Important: between account name and amount, there must be two or more spaces. - Amounts consist of a number and (usually) a currency symbol or commod- + Amounts consist of a number and (usually) a currency symbol or commod- ity name. Some examples: 2.00001 @@ -247,53 +262,53 @@ FILE FORMAT As you can see, the amount format is somewhat flexible: - o amounts are a number (the "quantity") and optionally a currency sym- + o amounts are a number (the "quantity") and optionally a currency sym- bol/commodity name (the "commodity"). - o the commodity is a symbol, word, or phrase, on the left or right, - with or without a separating space. If the commodity contains num- - bers, spaces or non-word punctuation it must be enclosed in double + o the commodity is a symbol, word, or phrase, on the left or right, + with or without a separating space. If the commodity contains num- + bers, spaces or non-word punctuation it must be enclosed in double quotes. o negative amounts with a commodity on the left can have the minus sign before or after it - o digit groups (thousands, or any other grouping) can be separated by - commas (in which case period is used for decimal point) or periods + o digit groups (thousands, or any other grouping) can be separated by + commas (in which case period is used for decimal point) or periods (in which case comma is used for decimal point) - You can use any of these variations when recording data, but when - hledger displays amounts, it will choose a consistent format for each - commodity. (Except for price amounts, which are always formatted as + You can use any of these variations when recording data, but when + hledger displays amounts, it will choose a consistent format for each + commodity. (Except for price amounts, which are always formatted as written). The display format is chosen as follows: o if there is a commodity directive specifying the format, that is used - o otherwise the format is inferred from the first posting amount in - that commodity in the journal, and the precision (number of decimal + o otherwise the format is inferred from the first posting amount in + that commodity in the journal, and the precision (number of decimal places) will be the maximum from all posting amounts in that commmod- ity - o or if there are no such amounts in the journal, a default format is + o or if there are no such amounts in the journal, a default format is used (like $1000.00). - Price amounts and amounts in D directives usually don't affect amount - format inference, but in some situations they can do so indirectly. - (Eg when D's default commodity is applied to a commodity-less amount, + Price amounts and amounts in D directives usually don't affect amount + format inference, but in some situations they can do so indirectly. + (Eg when D's default commodity is applied to a commodity-less amount, or when an amountless posting is balanced using a price's commodity, or - when -V is used.) If you find this causing problems, set the desired + when -V is used.) If you find this causing problems, set the desired format with a commodity directive. Virtual Postings - When you parenthesise the account name in a posting, we call that a + When you parenthesise the account name in a posting, we call that a virtual posting, which means: o it is ignored when checking that the transaction is balanced - o it is excluded from reports when the --real/-R flag is used, or the + o it is excluded from reports when the --real/-R flag is used, or the real:1 query. - You could use this, eg, to set an account's opening balance without + You could use this, eg, to set an account's opening balance without needing to use the equity:opening balances account: 1/1 special unbalanced posting to set initial balance @@ -301,8 +316,8 @@ FILE FORMAT When the account name is bracketed, we call it a balanced virtual post- ing. This is like an ordinary virtual posting except the balanced vir- - tual postings in a transaction must balance to 0, like the real post- - ings (but separately from them). Balanced virtual postings are also + tual postings in a transaction must balance to 0, like the real post- + ings (but separately from them). Balanced virtual postings are also excluded by --real/-R or real:1. 1/1 buy food with cash, and update some budget-tracking subaccounts elsewhere @@ -312,13 +327,13 @@ FILE FORMAT [assets:checking:budget:food] $-10 Virtual postings have some legitimate uses, but those are few. You can - usually find an equivalent journal entry using real postings, which is + usually find an equivalent journal entry using real postings, which is more correct and provides better error checking. Balance Assertions - hledger supports Ledger-style balance assertions in journal files. - These look like =EXPECTEDBALANCE following a posting's amount. Eg in - this example we assert the expected dollar balance in accounts a and b + hledger supports Ledger-style balance assertions in journal files. + These look like =EXPECTEDBALANCE following a posting's amount. Eg in + this example we assert the expected dollar balance in accounts a and b after each posting: 2013/1/1 @@ -330,31 +345,31 @@ 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 - --ignore-assertions flag, which can be useful for troubleshooting or + 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 + --ignore-assertions flag, which can be useful for troubleshooting or for reading Ledger files. 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 differ- - ently-dated transactions within the journal. But if you reorder + So, hledger balance assertions keep working if you reorder differ- + ently-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 con- + updating. This order dependence does bring an advantage: precise con- trol 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 @@ -362,21 +377,21 @@ 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. We could call this a par- - tial balance assertion. This is compatible with Ledger, and makes it + 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. We could call this a par- + tial balance assertion. This is compatible with Ledger, and makes it possible to make assertions about accounts containing multiple commodi- ties. - To assert each commodity's balance in such a multi-commodity account, - you can add multiple postings (with amount 0 if necessary). But note - that no matter how many assertions you add, you can't be sure the + To assert each commodity's balance in such a multi-commodity account, + you can add multiple postings (with amount 0 if necessary). But note + that no matter how many assertions you add, you can't be sure the account does not contain some unexpected commodity. (We'll add support for this kind of total balance assertion if there's demand.) Assertions and subaccounts - Balance assertions do not count the balance from subaccounts; they + Balance assertions do not count the balance from subaccounts; they check the posted account's exclusive balance. For example: 1/1 @@ -384,7 +399,7 @@ FILE FORMAT checking 1 = 1 ; post to the parent account, its exclusive balance is now 1 equity - The balance report's flat mode shows these exclusive balances more + The balance report's flat mode shows these exclusive balances more clearly: $ hledger bal checking --flat @@ -398,10 +413,10 @@ FILE FORMAT tual. They are not affected by the --real/-R flag or real: query. 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 @@ -419,8 +434,8 @@ 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. @@ -428,12 +443,12 @@ FILE FORMAT Prices Transaction prices Within a transaction, you can note an amount's price in another commod- - ity. This can be used to document the cost (in a purchase) or selling - price (in a sale). For example, transaction prices are useful to + ity. This can be used to document the cost (in a purchase) or selling + price (in a sale). For example, transaction prices are useful to record purchases of a foreign currency. - Transaction prices are fixed, and do not change over time. (Ledger - users: Ledger uses a different syntax for fixed prices, {=UNITPRICE}, + Transaction prices are fixed, and do not change over time. (Ledger + users: Ledger uses a different syntax for fixed prices, {=UNITPRICE}, which hledger currently ignores). There are several ways to record a transaction price: @@ -457,9 +472,9 @@ FILE FORMAT assets:euros 100 ; one hundred euros purchased assets:dollars $-135 ; for $135 - Amounts with transaction prices can be displayed in the transaction + Amounts with transaction prices can be displayed in the transaction price's commodity by using the -B/--cost flag (except for #551) ("B" is - from "cost Basis"). Eg for the above, here is how -B affects the bal- + from "cost Basis"). Eg for the above, here is how -B affects the bal- ance report: $ hledger bal -N --flat @@ -469,8 +484,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: @@ -483,41 +498,41 @@ FILE FORMAT 100 assets:euros Market prices - Market prices are not tied to a particular transaction; they represent - historical exchange rates between two commodities. (Ledger calls them - historical prices.) For example, the prices published by a stock - exchange or the foreign exchange market. hledger can use these prices + Market prices are not tied to a particular transaction; they represent + historical exchange rates between two commodities. (Ledger calls them + historical prices.) For example, the prices published by a stock + exchange or the foreign exchange market. hledger can use these prices to show the market value of things at a given date, see market value. - To record market prices, use P directives in the main journal or in an + To record market prices, use P directives in the main journal or in an included file. Their format is: P DATE COMMODITYBEINGPRICED UNITPRICE - DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of - the commodity being priced. UNITPRICE is an ordinary amount (symbol - and quantity) in a second commodity, specifying the unit price or con- - version rate for the first commodity in terms of the second, on the + DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of + the commodity being priced. UNITPRICE is an ordinary amount (symbol + and quantity) in a second commodity, specifying the unit price or con- + version rate for the first commodity in terms of the second, on the given date. - For example, the following directives say that one euro was worth 1.35 + For example, the following directives say that one euro was worth 1.35 US dollars during 2009, and $1.40 from 2010 onward: P 2009/1/1 $1.35 P 2010/1/1 $1.40 Comments - Lines in the journal beginning with a semicolon (;) or hash (#) or - asterisk (*) are comments, and will be ignored. (Asterisk comments - make it easy to treat your journal like an org-mode outline in emacs.) + Lines in the journal beginning with a semicolon (;) or hash (#) or + asterisk (*) are comments, and will be ignored. (Asterisk comments + make it easy to treat your journal like an org-mode outline in emacs.) - Also, anything between comment and end comment directives is a - (multi-line) comment. If there is no end comment, the comment extends + Also, anything between comment and end comment directives is a + (multi-line) comment. If there is no end comment, the comment extends to the end of the file. - You can attach comments to a transaction by writing them after the - description and/or indented on the following lines (before the post- - ings). Similarly, you can attach comments to an individual posting by + You can attach comments to a transaction by writing them after the + description and/or indented on the following lines (before the post- + ings). Similarly, you can attach comments to an individual posting by writing them after the amount and/or indented on the following lines. Some examples: @@ -542,20 +557,20 @@ FILE FORMAT ; a journal comment (because not indented) Tags - Tags are a way to add extra labels or labelled data to postings and + Tags are a way to add extra labels or labelled data to postings and transactions, which you can then search or pivot on. - A simple tag is a word (which may contain hyphens) followed by a full + A simple tag is a word (which may contain hyphens) followed by a full colon, written inside a transaction or posting comment line: 2017/1/16 bought groceries ; sometag: - Tags can have a value, which is the text after the colon, up to the + Tags can have a value, which is the text after the colon, up to the next comma or end of line, with leading/trailing whitespace removed: expenses:food $10 ; a-posting-tag: the tag value - Note this means hledger's tag values can not contain commas or new- + Note this means hledger's tag values can not contain commas or new- lines. Ending at commas means you can write multiple short tags on one line, comma separated: @@ -569,34 +584,18 @@ FILE FORMAT o "tag2" is another tag, whose value is "some value ..." - Tags in a transaction comment affect the transaction and all of its - postings, while tags in a posting comment affect only that posting. - For example, the following transaction has three tags (A, TAG2, + Tags in a transaction comment affect the transaction and all of its + postings, while tags in a posting comment affect only that posting. + For example, the following transaction has three tags (A, TAG2, third-tag) and the posting has four (those plus posting-tag): 1/1 a transaction ; A:, TAG2: ; third-tag: a third transaction tag, <- with a value (a) $1 ; posting-tag: - Tags are like Ledger's metadata feature, except hledger's tag values + Tags are like Ledger's metadata feature, except hledger's tag values are simple strings. - Implicit tags - Some predefined "implicit" tags are also provided: - - o code - the transaction's code field - - o description - the transaction's description - - o payee - the part of description before |, or all of it - - o note - the part of description after |, or all of it - - payee and note support descriptions written in a special PAYEE | NOTE - format, accessing the parts before and after the pipe character respec- - tively. For descriptions not containing a pipe character they are the - same as description. - Directives Account aliases You can define aliases which rewrite your account names (after reading @@ -809,8 +808,6 @@ EDITOR SUPPORT ting-started Sublime Text https://github.com/ledger/ledger/wiki/Using-Sub- lime-Text - - Textmate https://github.com/ledger/ledger/wiki/Using-Text- Mate-2 Text Wrangler https://github.com/ledger/ledger/wiki/Edit- diff --git a/hledger-ui/doc/hledger-ui.1 b/hledger-ui/doc/hledger-ui.1 index 33eb3a427..0e378f262 100644 --- a/hledger-ui/doc/hledger-ui.1 +++ b/hledger-ui/doc/hledger-ui.1 @@ -88,8 +88,8 @@ anonymize accounts and payees .RS .RE .TP -.B \f[C]\-\-pivot\ TAGNAME\f[] -use some other field/tag for account names +.B \f[C]\-\-pivot\ FIELDNAME\f[] +use some other field or tag for the account name .RS .RE .TP diff --git a/hledger-ui/doc/hledger-ui.1.info b/hledger-ui/doc/hledger-ui.1.info index 7a785abec..73dfe4de1 100644 --- a/hledger-ui/doc/hledger-ui.1.info +++ b/hledger-ui/doc/hledger-ui.1.info @@ -67,9 +67,9 @@ the data. '--anon' anonymize accounts and payees -'--pivot TAGNAME' +'--pivot FIELDNAME' - use some other field/tag for account names + use some other field or tag for the account name '-I --ignore-assertions' ignore any failing balance assertions @@ -358,17 +358,17 @@ Tag Table: Node: Top73 Node: OPTIONS831 Ref: #options930 -Node: KEYS3479 -Ref: #keys3576 -Node: SCREENS6372 -Ref: #screens6459 -Node: Accounts screen6549 -Ref: #accounts-screen6679 -Node: Register screen8909 -Ref: #register-screen9066 -Node: Transaction screen11140 -Ref: #transaction-screen11300 -Node: Error screen12170 -Ref: #error-screen12294 +Node: KEYS3487 +Ref: #keys3584 +Node: SCREENS6380 +Ref: #screens6467 +Node: Accounts screen6557 +Ref: #accounts-screen6687 +Node: Register screen8917 +Ref: #register-screen9074 +Node: Transaction screen11148 +Ref: #transaction-screen11308 +Node: Error screen12178 +Ref: #error-screen12302  End Tag Table diff --git a/hledger-ui/doc/hledger-ui.1.txt b/hledger-ui/doc/hledger-ui.1.txt index f02aebf01..980854e1b 100644 --- a/hledger-ui/doc/hledger-ui.1.txt +++ b/hledger-ui/doc/hledger-ui.1.txt @@ -65,8 +65,8 @@ OPTIONS --anon anonymize accounts and payees - --pivot TAGNAME - use some other field/tag for account names + --pivot FIELDNAME + use some other field or tag for the account name -I --ignore-assertions ignore any failing balance assertions diff --git a/hledger-web/doc/hledger-web.1 b/hledger-web/doc/hledger-web.1 index 14876ecdb..80c22978c 100644 --- a/hledger-web/doc/hledger-web.1 +++ b/hledger-web/doc/hledger-web.1 @@ -144,8 +144,8 @@ anonymize accounts and payees .RS .RE .TP -.B \f[C]\-\-pivot\ TAGNAME\f[] -use some other field/tag for account names +.B \f[C]\-\-pivot\ FIELDNAME\f[] +use some other field or tag for the account name .RS .RE .TP diff --git a/hledger-web/doc/hledger-web.1.info b/hledger-web/doc/hledger-web.1.info index 2b1e5ce54..b9230c71c 100644 --- a/hledger-web/doc/hledger-web.1.info +++ b/hledger-web/doc/hledger-web.1.info @@ -112,9 +112,9 @@ options as shown above. '--anon' anonymize accounts and payees -'--pivot TAGNAME' +'--pivot FIELDNAME' - use some other field/tag for account names + use some other field or tag for the account name '-I --ignore-assertions' ignore any failing balance assertions diff --git a/hledger-web/doc/hledger-web.1.txt b/hledger-web/doc/hledger-web.1.txt index bc4e6cf1e..c2804aad0 100644 --- a/hledger-web/doc/hledger-web.1.txt +++ b/hledger-web/doc/hledger-web.1.txt @@ -110,8 +110,8 @@ OPTIONS --anon anonymize accounts and payees - --pivot TAGNAME - use some other field/tag for account names + --pivot FIELDNAME + use some other field or tag for the account name -I --ignore-assertions ignore any failing balance assertions diff --git a/hledger/doc/hledger.1 b/hledger/doc/hledger.1 index de3b65bb0..b73d9597e 100644 --- a/hledger/doc/hledger.1 +++ b/hledger/doc/hledger.1 @@ -199,8 +199,8 @@ anonymize accounts and payees .RS .RE .TP -.B \f[C]\-\-pivot\ TAGNAME\f[] -use some other field/tag for account names +.B \f[C]\-\-pivot\ FIELDNAME\f[] +use some other field or tag for the account name .RS .RE .TP @@ -750,21 +750,17 @@ Use this when you want a summary with less detail. .PP Normally hledger sums amounts, and organizes them in a hierarchy, based on account name. -The \f[C]\-\-pivot\ TAGNAME\f[] option causes it to sum and organize -hierarchy based on some other field instead. -.PP -TAGNAME is the full, case\-insensitive name of a tag you have defined, -or one of the built\-in implicit tags (like \f[C]code\f[] or -\f[C]payee\f[]). -As with account names, when tag values have -\f[C]multiple:colon\-separated:parts\f[] hledger will build hierarchy, -displayed in tree\-mode reports, summarisable with a depth limit, and so -on. +The \f[C]\-\-pivot\ FIELD\f[] option causes it to sum and organize +hierarchy based on the value of some other field instead. +FIELD can be: \f[C]code\f[], \f[C]description\f[], \f[C]payee\f[], +\f[C]note\f[], or the full name (case insensitive) of any tag. +As with account names, values containing \f[C]colon:separated:parts\f[] +will be displayed hierarchically in reports. .PP \f[C]\-\-pivot\f[] is a general option affecting all reports; you can think of hledger transforming the journal before any other processing, replacing every posting\[aq]s account name with the value of the -specified tag on that posting, inheriting it from the transaction or +specified field on that posting, inheriting it from the transaction or using a blank value if it\[aq]s not present. .PP An example: @@ -1007,7 +1003,7 @@ quoting to hide it from the shell, so eg do: .RE .TP .B \f[B]\f[C]desc:REGEX\f[]\f[] -match transaction descriptions +match transaction descriptions. .RS .RE .TP @@ -1031,6 +1027,18 @@ match (or display, depending on command) accounts at or above this depth .RS .RE .TP +.B \f[B]\f[C]note:REGEX\f[]\f[] +match transaction notes (part of description right of \f[C]|\f[], or +whole description when there\[aq]s no \f[C]|\f[]) +.RS +.RE +.TP +.B \f[B]\f[C]payee:REGEX\f[]\f[] +match transaction payee/payer names (part of description left of +\f[C]|\f[], or whole description when there\[aq]s no \f[C]|\f[]) +.RS +.RE +.TP .B \f[B]\f[C]real:,\ real:0\f[]\f[] match real or virtual postings respectively .RS diff --git a/hledger/doc/hledger.1.info b/hledger/doc/hledger.1.info index 5346708f4..f66b4cdd7 100644 --- a/hledger/doc/hledger.1.info +++ b/hledger/doc/hledger.1.info @@ -167,9 +167,9 @@ different, like git.) '--anon' anonymize accounts and payees -'--pivot TAGNAME' +'--pivot FIELDNAME' - use some other field/tag for account names + use some other field or tag for the account name '-I --ignore-assertions' ignore any failing balance assertions @@ -507,20 +507,17 @@ File: hledger.1.info, Node: Pivoting, Next: Cost, Prev: Depth limiting, Up: ============= Normally hledger sums amounts, and organizes them in a hierarchy, based -on account name. The '--pivot TAGNAME' option causes it to sum and -organize hierarchy based on some other field instead. - - TAGNAME is the full, case-insensitive name of a tag you have defined, -or one of the built-in implicit tags (like 'code' or 'payee'). As with -account names, when tag values have 'multiple:colon-separated:parts' -hledger will build hierarchy, displayed in tree-mode reports, -summarisable with a depth limit, and so on. +on account name. The '--pivot FIELD' option causes it to sum and +organize hierarchy based on the value of some other field instead. +FIELD can be: 'code', 'description', 'payee', 'note', or the full name +(case insensitive) of any tag. As with account names, values containing +'colon:separated:parts' will be displayed hierarchically in reports. '--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 tag on that -posting, inheriting it from the transaction or using a blank value if -it's not present. +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. An example: @@ -717,7 +714,7 @@ match (or negatively match) print cur:'\$'' or 'hledger print cur:\\$'. *'desc:REGEX'* - match transaction descriptions + match transaction descriptions. *'date:PERIODEXPR'* match dates within the specified period. PERIODEXPR is a period @@ -732,6 +729,14 @@ match (or negatively match) match (or display, depending on command) accounts at or above this depth +*'note:REGEX'* + + match transaction notes (part of description right of '|', or whole + description when there's no '|') +*'payee:REGEX'* + + match transaction payee/payer names (part of description left of + '|', or whole description when there's no '|') *'real:, real:0'* match real or virtual postings respectively @@ -2129,123 +2134,123 @@ Node: OPTIONS3640 Ref: #options3744 Node: General options4025 Ref: #general-options4152 -Node: Command options6498 -Ref: #command-options6651 -Node: Command arguments7049 -Ref: #command-arguments7209 -Node: Special characters7330 -Ref: #special-characters7488 -Node: Input files8656 -Ref: #input-files8794 -Node: Smart dates10757 -Ref: #smart-dates10900 -Node: Report start & end date11879 -Ref: #report-start-end-date12051 -Node: Report intervals13117 -Ref: #report-intervals13282 -Node: Period expressions13683 -Ref: #period-expressions13843 -Node: Depth limiting16183 -Ref: #depth-limiting16329 -Node: Pivoting16530 -Ref: #pivoting16650 -Node: Cost18421 -Ref: #cost18531 -Node: Market value18649 -Ref: #market-value18786 -Node: Regular expressions20086 -Ref: #regular-expressions20224 -Node: QUERIES21585 -Ref: #queries21689 -Node: COMMANDS25354 -Ref: #commands25468 -Node: accounts26147 -Ref: #accounts26247 -Node: activity27229 -Ref: #activity27341 -Node: add27700 -Ref: #add27801 -Node: balance30459 -Ref: #balance30572 -Node: Flat mode33587 -Ref: #flat-mode33714 -Node: Depth limited balance reports34134 -Ref: #depth-limited-balance-reports34337 -Node: Multicolumn balance reports34757 -Ref: #multicolumn-balance-reports34968 -Node: Custom balance output39616 -Ref: #custom-balance-output39800 -Node: Colour support41893 -Ref: #colour-support42054 -Node: Output destination42227 -Ref: #output-destination42385 -Node: CSV output42655 -Ref: #csv-output42774 -Node: balancesheet43171 -Ref: #balancesheet43309 -Node: balancesheetequity45216 -Ref: #balancesheetequity45367 -Node: cashflow46156 -Ref: #cashflow46279 -Node: help48130 -Ref: #help48242 -Node: incomestatement49316 -Ref: #incomestatement49447 -Node: print51339 -Ref: #print51456 -Node: register55212 -Ref: #register55325 -Node: Custom register output59821 -Ref: #custom-register-output59952 -Node: stats61249 -Ref: #stats61355 -Node: test62236 -Ref: #test62323 -Node: ADD-ON COMMANDS62691 -Ref: #add-on-commands62803 -Node: Official add-ons64090 -Ref: #official-add-ons64232 -Node: api64319 -Ref: #api64410 -Node: ui64462 -Ref: #ui64563 -Node: web64621 -Ref: #web64712 -Node: Third party add-ons64758 -Ref: #third-party-add-ons64935 -Node: diff65070 -Ref: #diff65169 -Node: iadd65268 -Ref: #iadd65384 -Node: interest65467 -Ref: #interest65590 -Node: irr65685 -Ref: #irr65785 -Node: Experimental add-ons65863 -Ref: #experimental-add-ons66017 -Node: autosync66419 -Ref: #autosync66533 -Node: budget66772 -Ref: #budget66896 -Node: chart66962 -Ref: #chart67081 -Node: check67152 -Ref: #check67276 -Node: check-dates67343 -Ref: #check-dates67485 -Node: check-dupes67558 -Ref: #check-dupes67701 -Node: equity67778 -Ref: #equity67906 -Node: prices68025 -Ref: #prices68154 -Node: print-unique68209 -Ref: #print-unique68358 -Node: register-match68451 -Ref: #register-match68607 -Node: rewrite68705 -Ref: #rewrite68839 -Node: tags68917 -Ref: #tags69022 +Node: Command options6506 +Ref: #command-options6659 +Node: Command arguments7057 +Ref: #command-arguments7217 +Node: Special characters7338 +Ref: #special-characters7496 +Node: Input files8664 +Ref: #input-files8802 +Node: Smart dates10765 +Ref: #smart-dates10908 +Node: Report start & end date11887 +Ref: #report-start-end-date12059 +Node: Report intervals13125 +Ref: #report-intervals13290 +Node: Period expressions13691 +Ref: #period-expressions13851 +Node: Depth limiting16191 +Ref: #depth-limiting16337 +Node: Pivoting16538 +Ref: #pivoting16658 +Node: Cost18334 +Ref: #cost18444 +Node: Market value18562 +Ref: #market-value18699 +Node: Regular expressions19999 +Ref: #regular-expressions20137 +Node: QUERIES21498 +Ref: #queries21602 +Node: COMMANDS25534 +Ref: #commands25648 +Node: accounts26327 +Ref: #accounts26427 +Node: activity27409 +Ref: #activity27521 +Node: add27880 +Ref: #add27981 +Node: balance30639 +Ref: #balance30752 +Node: Flat mode33767 +Ref: #flat-mode33894 +Node: Depth limited balance reports34314 +Ref: #depth-limited-balance-reports34517 +Node: Multicolumn balance reports34937 +Ref: #multicolumn-balance-reports35148 +Node: Custom balance output39796 +Ref: #custom-balance-output39980 +Node: Colour support42073 +Ref: #colour-support42234 +Node: Output destination42407 +Ref: #output-destination42565 +Node: CSV output42835 +Ref: #csv-output42954 +Node: balancesheet43351 +Ref: #balancesheet43489 +Node: balancesheetequity45396 +Ref: #balancesheetequity45547 +Node: cashflow46336 +Ref: #cashflow46459 +Node: help48310 +Ref: #help48422 +Node: incomestatement49496 +Ref: #incomestatement49627 +Node: print51519 +Ref: #print51636 +Node: register55392 +Ref: #register55505 +Node: Custom register output60001 +Ref: #custom-register-output60132 +Node: stats61429 +Ref: #stats61535 +Node: test62416 +Ref: #test62503 +Node: ADD-ON COMMANDS62871 +Ref: #add-on-commands62983 +Node: Official add-ons64270 +Ref: #official-add-ons64412 +Node: api64499 +Ref: #api64590 +Node: ui64642 +Ref: #ui64743 +Node: web64801 +Ref: #web64892 +Node: Third party add-ons64938 +Ref: #third-party-add-ons65115 +Node: diff65250 +Ref: #diff65349 +Node: iadd65448 +Ref: #iadd65564 +Node: interest65647 +Ref: #interest65770 +Node: irr65865 +Ref: #irr65965 +Node: Experimental add-ons66043 +Ref: #experimental-add-ons66197 +Node: autosync66599 +Ref: #autosync66713 +Node: budget66952 +Ref: #budget67076 +Node: chart67142 +Ref: #chart67261 +Node: check67332 +Ref: #check67456 +Node: check-dates67523 +Ref: #check-dates67665 +Node: check-dupes67738 +Ref: #check-dupes67881 +Node: equity67958 +Ref: #equity68086 +Node: prices68205 +Ref: #prices68334 +Node: print-unique68389 +Ref: #print-unique68538 +Node: register-match68631 +Ref: #register-match68787 +Node: rewrite68885 +Ref: #rewrite69019 +Node: tags69097 +Ref: #tags69202  End Tag Table diff --git a/hledger/doc/hledger.1.txt b/hledger/doc/hledger.1.txt index bdfc6330f..c45c4a905 100644 --- a/hledger/doc/hledger.1.txt +++ b/hledger/doc/hledger.1.txt @@ -140,8 +140,8 @@ OPTIONS --anon anonymize accounts and payees - --pivot TAGNAME - use some other field/tag for account names + --pivot FIELDNAME + use some other field or tag for the account name -I --ignore-assertions ignore any failing balance assertions @@ -460,18 +460,15 @@ OPTIONS Pivoting Normally hledger sums amounts, and organizes them in a hierarchy, based - on account name. The --pivot TAGNAME option causes it to sum and orga- - nize hierarchy based on some other field instead. + 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. - TAGNAME is the full, case-insensitive name of a tag you have defined, - or one of the built-in implicit tags (like code or payee). As with - account names, when tag values have multiple:colon-separated:parts - hledger will build hierarchy, displayed in tree-mode reports, summaris- - able with a depth limit, and so on. - - --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 tag 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. @@ -497,7 +494,7 @@ OPTIONS -------------------- 0 - One way to show only amounts with a member: value (using a query, + One way to show only amounts with a member: value (using a query, described below): $ hledger balance --pivot member tag:member=. @@ -505,7 +502,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:. @@ -514,16 +511,16 @@ OPTIONS -2 EUR Cost - The -B/--cost flag converts amounts to their cost at transaction time, + The -B/--cost flag converts amounts to their cost at transaction time, if they have a transaction price specified. Market value The -V/--value flag converts the reported amounts to their market value on the report end date, using the most recent applicable market prices, - when known. Specifically, when there is a market price (P directive) + when known. Specifically, when there is a market price (P directive) for the amount's commodity, dated on or before the report end date (see - hledger -> Report start & end date), the amount will be converted to - the price's commodity. If multiple applicable prices are defined, the + hledger -> Report start & end date), the amount will be converted to + the price's commodity. If multiple applicable prices are defined, the latest-dated one is used (and if dates are equal, the one last parsed). For example: @@ -555,7 +552,7 @@ OPTIONS $ hledger -f t.j bal euros -V -e 2016/12/21 $103.00 assets:euros - Currently, hledger's -V only uses market prices recorded with P direc- + Currently, hledger's -V only uses market prices recorded with P direc- tives, not transaction prices (unlike Ledger). Using -B and -V together is allowed. @@ -563,55 +560,55 @@ OPTIONS Regular expressions hledger uses regular expressions in a number of places: - o query terms, on the command line and in the hledger-web search form: + o query terms, on the command line and in the hledger-web search form: REGEX, desc:REGEX, cur:REGEX, tag:...=REGEX o CSV rules conditional blocks: if REGEX ... - o account alias directives and options: alias /REGEX/ = REPLACEMENT, + o account alias directives and options: alias /REGEX/ = REPLACEMENT, --alias /REGEX/=REPLACEMENT - hledger's regular expressions come from the regex-tdfa library. In + hledger's regular expressions come from the regex-tdfa library. In general they: o are case insensitive - o are infix matching (do not need to match the entire thing being + o are infix matching (do not need to match the entire thing being matched) o are POSIX extended regular expressions o also support GNU word boundaries (\<, \>, \b, \B) - o and parenthesised capturing groups and numeric backreferences in + o and parenthesised capturing groups and numeric backreferences in replacement strings o do not support mode modifiers like (?s) Some things to note: - o In the alias directive and --alias option, regular expressions must - be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, + o In the alias directive and --alias option, regular expressions must + be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, these are not required. - o In queries, to match a regular expression metacharacter like $ as a - literal character, prepend a backslash. Eg to search for amounts + o In queries, to match a regular expression metacharacter like $ as a + literal character, prepend a backslash. Eg to search for amounts with the dollar sign in hledger-web, write cur:\$. - o On the command line, some metacharacters like $ have a special mean- + o On the command line, some metacharacters like $ have a special mean- ing to the shell and so must be escaped at least once more. See Spe- cial characters. QUERIES - One of hledger's strengths is being able to quickly report on precise - subsets of your data. Most commands accept an optional query expres- - sion, written as arguments after the command name, to filter the data - by date, account name or other criteria. The syntax is similar to a + One of hledger's strengths is being able to quickly report on precise + subsets of your data. Most commands accept an optional query expres- + sion, written as arguments after the command name, to filter the data + by date, account name or other criteria. The syntax is similar to a web search: one or more space-separated search terms, quotes to enclose - whitespace, optional prefixes to match specific fields. Multiple + whitespace, optional prefixes to match specific fields. Multiple search terms are combined as follows: - All commands except print: show transactions/postings/accounts which + All commands except print: show transactions/postings/accounts which match (or negatively match) o any of the description terms AND @@ -640,42 +637,50 @@ QUERIES same as above amt:N, amt:N, amt:>=N - match postings with a single-commodity amount that is equal to, - less than, or greater than N. (Multi-commodity amounts are not + match postings with a single-commodity amount that is equal to, + less than, or greater than N. (Multi-commodity amounts are not tested, and will always match.) The comparison has two modes: if N is preceded by a + or - sign (or is 0), the two signed numbers - are compared. Otherwise, the absolute magnitudes are compared, + are compared. Otherwise, the absolute magnitudes are compared, ignoring sign. code:REGEX match by transaction code (eg check number) cur:REGEX - match postings or transactions including any amounts whose cur- - rency/commodity symbol is fully matched by REGEX. (For a par- + match postings or transactions including any amounts whose cur- + rency/commodity symbol is fully matched by REGEX. (For a par- tial match, use .*REGEX.*). Note, to match characters which are regex-significant, like the dollar sign ($), you need to prepend - \. And when using the command line you need to add one more + \. And when using the command line you need to add one more level of quoting to hide it from the shell, so eg do: hledger print cur:'\$' or hledger print cur:\\$. desc:REGEX - match transaction descriptions + match transaction descriptions. date:PERIODEXPR match dates within the specified period. PERIODEXPR is a period - expression (with no report interval). Examples: date:2016, - date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the - --date2 command line flag is present, this matches secondary + expression (with no report interval). Examples: date:2016, + date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the + --date2 command line flag is present, this matches secondary dates instead. date2:PERIODEXPR match secondary dates within the specified period. depth:N - match (or display, depending on command) accounts at or above + match (or display, depending on command) accounts at or above this depth + note:REGEX + match transaction notes (part of description right of |, or + whole description when there's no |) + + payee:REGEX + match transaction payee/payer names (part of description left of + |, or whole description when there's no |) + real:, real:0 match real or virtual postings respectively @@ -683,9 +688,9 @@ QUERIES match unmarked, pending, or cleared transactions respectively tag:REGEX[=REGEX] - match by tag name, and optionally also by tag value. Note a - tag: query is considered to match a transaction if it matches - any of the postings. Also remember that postings inherit the + match by tag name, and optionally also by tag value. Note a + tag: query is considered to match a transaction if it matches + any of the postings. Also remember that postings inherit the tags of their parent transaction. not: before any of the above negates the match. @@ -693,24 +698,24 @@ QUERIES inacct:ACCTNAME a special term used automatically when you click an account name in hledger-web, specifying the account register we are currently - in (selects the transactions of that account and how to show - them, can be filtered further with acct etc). Not supported + in (selects the transactions of that account and how to show + them, can be filtered further with acct etc). Not supported elsewhere in hledger. Some of these can also be expressed as command-line options (eg depth:2 - is equivalent to --depth 2). Generally you can mix options and query - arguments, and the resulting query will be their intersection (perhaps + is equivalent to --depth 2). Generally you can mix options and query + arguments, and the resulting query will be their intersection (perhaps excluding the -p/--period option). 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 + Run a subcommand by writing its name as first argument (eg hledger incomestatement). You can also write any unambiguous prefix of a command name (hledger inc), or one of the standard short aliases dis- played in the command list (hledger is). @@ -725,14 +730,14 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command lists all account names that are in use (ie, all the - accounts which have at least one transaction posting to them). With + This command lists all account names that are in use (ie, all the + accounts which have at least one transaction posting to them). With query arguments, only matched account names are shown. - It shows a flat list by default. With --tree, it uses indentation to + 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 + In flat mode you can add --drop N to omit the first few account name components. Examples: @@ -775,8 +780,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. $ hledger activity --quarterly @@ -789,24 +794,24 @@ COMMANDS Prompt for transactions and add them to the journal. --no-new-accounts - don't allow creating new accounts; helps prevent typos when + don't allow creating new accounts; helps prevent typos when entering account names - 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 + 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 + 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 recent + o add tries to provide useful defaults, using the most similar recent transaction (by description) as a template. o You can also set the initial defaults with command line arguments. @@ -814,20 +819,20 @@ 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. o Comments and tags may be entered following a description or amount. - o If you make a mistake, enter < at any prompt to restart the transac- + o If you make a mistake, enter < at any prompt to restart the transac- tion. - 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): @@ -864,7 +869,7 @@ COMMANDS show balance change in each period (default) --cumulative - show balance change accumulated across periods (in multicolumn + show balance change accumulated across periods (in multicolumn reports) -H --historical @@ -899,13 +904,13 @@ COMMANDS select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. --pretty-tables Use unicode to display prettier tables. - The balance command displays accounts and balances. It is hledger's + The balance command displays accounts and balances. It is hledger's most featureful and versatile command. $ hledger balance @@ -922,25 +927,25 @@ COMMANDS -------------------- 0 - More precisely, the balance command shows the change to each account's + More precisely, the balance command shows the change to each account's balance caused by all (matched) postings. In the common case where you - do not filter by date and your journal sets the correct opening bal- + do not filter by date and your journal sets the correct opening bal- ances, this is the same as the account's ending balance. - By default, accounts are displayed hierarchically, with subaccounts + By default, accounts are displayed hierarchically, with subaccounts indented below their parent. "Boring" accounts, which contain a single interesting subaccount and no balance of their own, are elided into the - following line for more compact output. (Use --no-elide to prevent - this. Eliding of boring accounts is not yet supported in multicolumn + following line for more compact output. (Use --no-elide to prevent + this. Eliding of boring accounts is not yet supported in multicolumn reports.) - Each account's balance is the "inclusive" balance - it includes the + Each account's balance is the "inclusive" balance - it includes 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: $ hledger balance -p 2008/6 expenses --no-total @@ -950,9 +955,9 @@ COMMANDS Flat mode To see a flat list of full account names instead of the default hierar- - chical display, use --flat. In this mode, accounts (unless + chical display, use --flat. In this mode, accounts (unless depth-clipped) show their "exclusive" balance, excluding any subaccount - balances. In this mode, you can also use --drop N to omit the first + balances. In this mode, you can also use --drop N to omit the first few account name components. $ hledger balance -p 2008/6 expenses -N --flat --drop 1 @@ -960,9 +965,9 @@ COMMANDS $1 supplies Depth limited balance reports - With --depth N, balance shows accounts only to the specified depth. - This is very useful to show a complex charts of accounts in less - detail. In flat mode, balances from accounts below the depth limit + With --depth N, balance shows accounts only to the specified depth. + This is very useful to show a complex charts of accounts in less + detail. In flat mode, balances from accounts below the depth limit will be shown as part of a parent account at the depth limit. $ hledger balance -N --depth 1 @@ -972,12 +977,12 @@ COMMANDS $1 liabilities Multicolumn balance reports - With a reporting interval, multiple balance columns will be shown, one - for each report period. There are three types of multi-column balance + With a reporting interval, multiple balance columns will be shown, one + for each report period. There are three types of multi-column 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 @@ -992,8 +997,8 @@ COMMANDS -------------------++--------------------------------- || $-1 $1 0 0 - 2. With --cumulative: each column shows the ending balance for that - period, accumulating the changes across periods, starting from 0 at + 2. With --cumulative: each column shows the ending balance for that + period, accumulating the changes across periods, starting from 0 at the report start date: $ hledger balance --quarterly income expenses -E --cumulative @@ -1009,8 +1014,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: @@ -1026,26 +1031,26 @@ COMMANDS ----------------------++------------------------------------- || 0 0 0 - Multi-column balance reports display accounts in flat mode by default; + Multi-column 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: - first, the report will show all columns within the specified report - period (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 + The -E/--empty flag does two things in multicolumn balance reports: + first, the report will show all columns within the specified report + period (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 oth- erwise 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: @@ -1067,7 +1072,7 @@ COMMANDS # Average is rounded to the dollar here since all journal amounts are Custom balance output - In simple (non-multi-column) balance reports, you can customise the + In simple (non-multi-column) balance reports, you can customise the output with --format FMT: $ hledger balance --format "%20(account) %12(total)" @@ -1085,7 +1090,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) @@ -1096,14 +1101,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) @@ -1112,7 +1117,7 @@ COMMANDS o %, - render on one line, comma-separated - There are some quirks. Eg in one-line mode, %(depth_spacer) has no + There are some quirks. Eg in one-line mode, %(depth_spacer) has no effect, instead %(account) has indentation built in. Experimentation may be needed to get pleasing results. @@ -1120,14 +1125,14 @@ 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 @@ -1138,8 +1143,8 @@ COMMANDS o the output is not being redirected or piped anywhere Output destination - The balance, print, register and stats commands can write their output - to a destination other than the console. This is controlled by the + The balance, print, register and stats commands can write their output + to a destination other than the console. This is controlled by the -o/--output-file option. $ hledger balance -o - # write to stdout (the default) @@ -1147,8 +1152,8 @@ COMMANDS CSV output The balance, print and register commands can write their output as CSV. - This is useful for exporting data to other applications, eg to make - charts in a spreadsheet. This is controlled by the -O/--output-format + This is useful for exporting data to other applications, eg to make + charts in a spreadsheet. This is controlled by the -O/--output-format option, or by specifying a .csv file extension with -o/--output-file. $ hledger balance -O csv # write CSV to stdout @@ -1162,7 +1167,7 @@ COMMANDS balances --cumulative - show balance change accumulated across periods (in multicolumn + show balance change accumulated across periods (in multicolumn reports), instead of historical ending balances -H --historical @@ -1193,8 +1198,8 @@ COMMANDS --format=LINEFORMAT in single-column balance reports: use this custom line format - This command displays a simple balance sheet. It currently assumes - that you have top-level accounts named asset and liability (plural + This command displays a simple balance sheet. It currently assumes + that you have top-level accounts named asset and liability (plural forms also allowed.) $ hledger balancesheet @@ -1217,19 +1222,19 @@ COMMANDS 0 With a reporting interval, multiple columns will be shown, one for each - report period. As with multicolumn balance reports, you can alter the - report mode with --change/--cumulative/--historical. Normally bal- - ancesheet shows historical ending balances, which is what you need for + report period. As with multicolumn balance reports, you can alter the + report mode with --change/--cumulative/--historical. Normally bal- + ancesheet shows historical ending balances, which is what you need for a balance sheet; note this means it ignores report begin dates. balancesheetequity Show a balance sheet including equity. Alias: bse. - Other than showing the equity accounts, this command is exactly the + Other than showing the equity accounts, this command is exactly the same as the command balancesheet. Please refer to it for the available options. - This command displays a balancesheet. It currently assumes that you + This command displays a balancesheet. It currently assumes that you have top-level accounts named asset, liability and equity (plural forms also allowed.) @@ -1264,7 +1269,7 @@ COMMANDS show balance change in each period (default) --cumulative - show balance change accumulated across periods (in multicolumn + show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical @@ -1295,9 +1300,9 @@ COMMANDS --format=LINEFORMAT in single-column balance reports: use this custom line format - This command displays a simple cashflow statement It shows the change - in all "cash" (ie, liquid assets) accounts for the period. It cur- - rently assumes that cash accounts are under a top-level account named + This command displays a simple cashflow statement It shows the change + in all "cash" (ie, liquid assets) accounts for the period. It cur- + rently assumes that cash accounts are under a top-level account named asset and do not contain receivable, :A/R or :fixed. $ hledger cashflow @@ -1315,20 +1320,20 @@ COMMANDS $-1 With a reporting interval, multiple columns will be shown, one for each - report period. Normally cashflow shows changes in assets per period, - though as with multicolumn balance reports you can alter the report + report period. Normally cashflow shows changes in assets per period, + though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. help Show any of the hledger manuals. - The help command displays any of the main hledger manuals, in one of - several ways. Run it with no argument to list the manuals, or provide + The help command displays any of the main hledger manuals, in one of + several ways. Run it with no argument to list the manuals, or provide a full or partial manual name to select one. - hledger manuals are available in several formats. hledger help will - use the first of these display methods that it finds: info, man, - $PAGER, less, stdout (or when non-interactive, just stdout). You can + hledger manuals are available in several formats. hledger help will + use the first of these display methods that it finds: info, man, + $PAGER, less, stdout (or when non-interactive, just stdout). You can force a particular viewer with the --info, --man, --pager, --cat flags. $ hledger help @@ -1358,7 +1363,7 @@ COMMANDS show balance change in each period (default) --cumulative - show balance change accumulated across periods (in multicolumn + show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical @@ -1389,8 +1394,8 @@ COMMANDS --format=LINEFORMAT in single-column balance reports: use this custom line format - This command displays a simple income statement. It currently assumes - that you have top-level accounts named income (or revenue) and expense + 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.) $ hledger incomestatement @@ -1415,8 +1420,8 @@ COMMANDS 0 With a reporting interval, multiple columns will be shown, one for each - report period. Normally incomestatement shows revenues/expenses per - period, though as with multicolumn balance reports you can alter the + report period. Normally incomestatement shows revenues/expenses per + period, though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. print @@ -1426,14 +1431,14 @@ COMMANDS show all amounts explicitly -m STR --match=STR - show the transaction whose description is most similar to STR, + show the transaction whose description is most similar to STR, and is most recent -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. $ hledger print @@ -1461,23 +1466,23 @@ COMMANDS The print command displays full journal entries (transactions) from the journal file, tidily formatted. - As of hledger 1.2, print's output is always a valid hledger journal. - However it may not preserve all original content, eg it does not print + As of hledger 1.2, print's output is always a valid hledger journal. + However it may not preserve all original content, eg it does not print directives or inter-transaction comments. - Normally, transactions' implicit/explicit amount style is preserved: - when an amount is omitted in the journal, it will be omitted in the - output. You can use the -x/--explicit flag to make all amounts - explicit, which can be useful for troubleshooting or for making your - journal more readable and robust against data entry errors. Note, in - this mode postings with a multi-commodity amount (possible with an - implicit amount in a multi-commodity transaction) will be split into + Normally, transactions' implicit/explicit amount style is preserved: + when an amount is omitted in the journal, it will be omitted in the + output. You can use the -x/--explicit flag to make all amounts + explicit, which can be useful for troubleshooting or for making your + journal more readable and robust against data entry errors. Note, in + this mode postings with a multi-commodity amount (possible with an + implicit amount in a multi-commodity transaction) will be split into multiple single-commodity postings, for valid journal output. - With -B/--cost, amounts with transaction prices are converted to cost + With -B/--cost, amounts with transaction prices are converted to cost (using the transaction price). - The print command also supports output destination and CSV output. + The print command also supports output destination and CSV output. Here's an example of print's CSV output: $ hledger print -Ocsv @@ -1494,20 +1499,20 @@ COMMANDS "5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","","" "5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","","" - o There is one CSV record per posting, with the parent transaction's + o There is one CSV record per posting, with the parent transaction's fields repeated. o The "txnidx" (transaction index) field shows which postings belong to - the same transaction. (This number might change if transactions are - reordered within the file, files are parsed/included in a different + the same transaction. (This number might change if transactions are + reordered within the file, files are parsed/included in a different order, etc.) - o The amount is separated into "commodity" (the symbol) and "amount" + o The amount is separated into "commodity" (the symbol) and "amount" (numeric quantity) fields. o The numeric amount is repeated in either the "credit" or "debit" col- - umn, for convenience. (Those names are not accurate in the account- - ing sense; it just puts negative amounts under credit and zero or + umn, for convenience. (Those names are not accurate in the account- + ing sense; it just puts negative amounts under credit and zero or greater amounts under debit.) register @@ -1517,7 +1522,7 @@ COMMANDS show running total from report start date (default) -H --historical - show historical running total/balance (includes postings before + show historical running total/balance (includes postings before report start date) -A --average @@ -1528,18 +1533,18 @@ COMMANDS show postings' siblings instead -w N --width=N - set output width (default: terminal width or COLUMNS. -wN,M + set output width (default: terminal width or COLUMNS. -wN,M sets description width as well) -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. The register command displays postings, one per line, and their running - total. This is typically used with a query selecting a particular + total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking @@ -1548,8 +1553,8 @@ COMMANDS 2008/06/02 save assets:bank:checking $-1 $1 2008/12/31 pay off assets:bank:checking $-1 0 - 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 @@ -1559,23 +1564,23 @@ COMMANDS The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead + The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for - the whole report period). This flag implies --empty (see below). It - is affected by --historical. It works best when showing just one + the whole report period). This flag implies --empty (see below). It + is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of + The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - With a reporting interval, register shows summary postings, one per + With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are + Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E @@ -1592,7 +1597,7 @@ COMMANDS 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth + Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h @@ -1600,19 +1605,19 @@ COMMANDS 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these - will be adjusted outward if necessary to contain a whole number of - intervals. This ensures that the first and last intervals are full + Note when using report intervals, if you specify start/end dates these + will be adjusted outward if necessary to contain a whole number of + intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. Custom register output - register uses the full terminal width by default, except on windows. - You can override this by setting the COLUMNS environment variable (not + register uses the full terminal width by default, except on windows. + You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally - (about half of (width - 40) each). You can adjust this by adding a - description width as part of --width's argument, comma-separated: + The description and account columns normally share the space equally + (about half of (width - 40) each). You can adjust this by adding a + description width as part of --width's argument, comma-separated: --width W,D . Here's a diagram: <--------------------------------- width (W) ----------------------------------> @@ -1628,14 +1633,14 @@ COMMANDS $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width - The register command also supports the -o/--output-file and -O/--out- + The register command also supports the -o/--output-file and -O/--out- put-format options for controlling output destination and CSV output. stats Show some journal statistics. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. $ hledger stats @@ -1650,8 +1655,8 @@ COMMANDS Accounts : 8 (depth 3) Commodities : 1 ($) - 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. The stats command also supports -o/--output-file for controlling output @@ -1663,34 +1668,34 @@ COMMANDS $ hledger test Cases: 74 Tried: 74 Errors: 0 Failures: 0 - This command runs hledger's built-in unit tests and displays a quick + This command runs hledger's built-in unit tests and displays a quick report. With a regular expression argument, it selects only tests with matching names. It's mainly used in development, but it's also nice to be able to check your hledger executable for smoke at any time. 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 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: + 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. Here are some hledger add-ons available: @@ -1708,7 +1713,7 @@ ADD-ON COMMANDS hledger-web provides a simple web interface. Third party add-ons - These are maintained separately, and usually updated shortly after a + These are maintained separately, and usually updated shortly after a hledger release. diff @@ -1716,7 +1721,7 @@ ADD-ON COMMANDS journal file and another. iadd - hledger-iadd is a curses-style, more interactive replacement for the + hledger-iadd is a curses-style, more interactive replacement for the add command. interest @@ -1724,19 +1729,19 @@ ADD-ON COMMANDS ing to various schemes. irr - hledger-irr calculates the internal rate of return of an investment + hledger-irr calculates the internal rate of return of an investment account. Experimental add-ons - These are available in source form in the hledger repo's bin/ direc- + These are available in source form in the hledger repo's bin/ direc- tory; installing them is pretty easy. They may be less mature and doc- - umented than built-in commands. Reading and tweaking these is a good + umented than built-in commands. Reading and tweaking these is a good way to start making your own! autosync hledger-autosync is a symbolic link for easily running ledger-autosync, - if installed. ledger-autosync does deduplicating conversion of OFX - data and some CSV formats, and can also download the data if your bank + if installed. ledger-autosync does deduplicating conversion of OFX + data and some CSV formats, and can also download the data if your bank offers OFX Direct Connect. budget @@ -1752,18 +1757,18 @@ ADD-ON COMMANDS hledger-check-dates.hs checks that journal entries are ordered by date. check-dupes - hledger-check-dupes.hs checks for account names sharing the same leaf + hledger-check-dupes.hs checks for account names sharing the same leaf name. equity - hledger-equity.hs prints balance-resetting transactions, useful for + hledger-equity.hs prints balance-resetting transactions, useful for bringing account balances across file boundaries. prices hledger-prices.hs prints all prices from the journal. print-unique - hledger-print-unique.hs prints transactions which do not reuse an + hledger-print-unique.hs prints transactions which do not reuse an already-seen description. register-match @@ -1778,21 +1783,21 @@ ADD-ON COMMANDS hledger-tags.hs Lists tag names in use. ENVIRONMENT - 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. 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). 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). BUGS - 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 @@ -1805,33 +1810,33 @@ BUGS 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 - remember 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 + remember 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. - "Illegal byte sequence" or "Invalid or incomplete multibyte or wide + "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" errors In order to handle non-ascii letters and symbols (like ), hledger needs an appropriate locale. This is usually configured system-wide; you can also configure it temporarily. The locale may need to be one that sup- - ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, + ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, I'm not sure yet). Here's an example of setting the locale temporarily, on ubuntu @@ -1850,7 +1855,7 @@ TROUBLESHOOTING $ echo "export LANG=en_US.UTF-8" >>~/.bash_profile $ bash --login - If we preferred to use eg fr_FR.utf8, we might have to install that + If we preferred to use eg fr_FR.utf8, we might have to install that first: $ apt-get install language-pack-fr @@ -1871,7 +1876,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) @@ -1885,7 +1890,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) diff --git a/hledger/doc/options.m4.md b/hledger/doc/options.m4.md index 2050312d3..7dd10cf8d 100644 --- a/hledger/doc/options.m4.md +++ b/hledger/doc/options.m4.md @@ -265,16 +265,15 @@ tree, down to level N. Use this when you want a summary with less detail. ## Pivoting Normally hledger sums amounts, and organizes them in a hierarchy, based on account name. -The `--pivot TAGNAME` option causes it to sum and organize hierarchy based on some other field instead. - -TAGNAME is the full, case-insensitive name of a [tag](/journal.html#tags) you have defined, -or one of the built-in implicit tags (like `code` or `payee`). -As with account names, when tag values have `multiple:colon-separated:parts` hledger will build hierarchy, -displayed in tree-mode reports, summarisable with a depth limit, and so on. +The `--pivot FIELD` option causes it to sum and organize hierarchy based on the value of some other field instead. +FIELD can be: +`code`, `description`, `payee`, `note`, +or the full name (case insensitive) of any [tag](/journal.html#tags). +As with account names, values containing `colon:separated:parts` will be displayed hierarchically in reports. `--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 tag on that posting, inheriting it from the transaction +the value of the specified field on that posting, inheriting it from the transaction or using a blank value if it's not present. An example: diff --git a/hledger/doc/queries.m4.md b/hledger/doc/queries.m4.md index f1098a26e..c5ca8e3ed 100644 --- a/hledger/doc/queries.m4.md +++ b/hledger/doc/queries.m4.md @@ -54,7 +54,7 @@ quoting to hide it from the shell, so eg do: `hledger print cur:'\$'` or `hledger print cur:\\$`. **`desc:REGEX`** -: match transaction descriptions +: match transaction [descriptions](/manual.html#description-payee-and-note). **`date:PERIODEXPR`** : match dates within the specified period. @@ -68,6 +68,14 @@ If the `--date2` command line flag is present, this matches [secondary dates](ma **`depth:N`** : match (or display, depending on command) accounts at or above this depth +**`note:REGEX`** +: match transaction [notes](/manual.html#description-payee-and-note) +(part of description right of `|`, or whole description when there's no `|`) + +**`payee:REGEX`** +: match transaction [payee/payer names](/manual.html#description-payee-and-note) +(part of description left of `|`, or whole description when there's no `|`) + **`real:, real:0`** : match real or virtual postings respectively