From 37555617b7224e2b3298f4a94c723d07a6812310 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 23 Jan 2018 16:41:19 -0800 Subject: [PATCH] journal, bal: document account codes --- hledger-lib/hledger_journal.5 | 56 ++- hledger-lib/hledger_journal.info | 77 ++-- hledger-lib/hledger_journal.m4.md | 39 +- hledger-lib/hledger_journal.txt | 42 +- hledger/Hledger/Cli/Commands/Balance.hs | 2 +- hledger/Hledger/Cli/CompoundBalanceCommand.hs | 2 +- hledger/hledger.1 | 20 +- hledger/hledger.info | 193 ++++----- hledger/hledger.txt | 371 +++++++++--------- hledger/hledger_balance.m4.md | 18 +- hledger/hledger_commands.m4.md | 6 +- 11 files changed, 464 insertions(+), 362 deletions(-) diff --git a/hledger-lib/hledger_journal.5 b/hledger-lib/hledger_journal.5 index 72bb6a409..ae660c2d3 100644 --- a/hledger-lib/hledger_journal.5 +++ b/hledger-lib/hledger_journal.5 @@ -943,23 +943,55 @@ end\ aliases .fi .SS account directive .PP -The \f[C]account\f[] directive predefines account names, as in Ledger -and Beancount. -This may be useful for your own documentation; hledger doesn't make use -of it yet. +The \f[C]account\f[] directive predeclares account names. +The simplest form is \f[C]account\ ACCTNAME\f[], eg: .IP .nf \f[C] -;\ account\ ACCT -;\ \ \ OPTIONAL\ COMMENTS/TAGS... - account\ assets:bank:checking -\ a\ comment -\ acct\-no:12345 +\f[] +.fi +.PP +Currently this mainly helps with account name autocompletion in eg +hledger add, hledger\-iadd, hledger\-web, and ledger\-mode. +.PD 0 +.P +.PD +In future it will also help detect misspelled accounts. +.PP +Account names can be followed by a numeric account code: +.IP +.nf +\f[C] +account\ assets\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1000 +account\ assets:bank:checking\ \ \ \ 1110 +account\ liabilities\ \ \ \ \ \ \ \ \ \ \ \ \ 2000 +account\ revenues\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4000 +account\ expenses\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 6000 +\f[] +.fi +.PP +This affects account display order in reports: accounts with codes are +listed before accounts without codes, in increasing code order. +(Otherwise, accounts are listed alphabetically.) Account codes should be +all numeric digits, unique, and separated from the account name by at +least two spaces (since account names may contain single spaces). +By convention, often the first digit indicates the type of account, as +in this numbering scheme and the example above. +In future, we might use this to recognize account types. +.PP +An account directive can also have indented subdirectives following it, +which are currently ignored. +Here is the full syntax: +.IP +.nf +\f[C] +;\ account\ ACCTNAME\ \ [OPTIONALCODE] +;\ \ \ [OPTIONALSUBDIRECTIVES] -account\ expenses:food - -;\ etc. +account\ assets:bank:checking\ \ \ 1110 +\ \ a\ comment +\ \ some\-tag:12345 \f[] .fi .SS apply account directive diff --git a/hledger-lib/hledger_journal.info b/hledger-lib/hledger_journal.info index e36d78da3..630fc8739 100644 --- a/hledger-lib/hledger_journal.info +++ b/hledger-lib/hledger_journal.info @@ -903,20 +903,41 @@ File: hledger_journal.info, Node: account directive, Next: apply account direc 1.14.2 account directive ------------------------ -The 'account' directive predefines account names, as in Ledger and -Beancount. This may be useful for your own documentation; hledger -doesn't make use of it yet. - -; account ACCT -; OPTIONAL COMMENTS/TAGS... +The 'account' directive predeclares account names. The simplest form is +'account ACCTNAME', eg: account assets:bank:checking - a comment - acct-no:12345 -account expenses:food + Currently this mainly helps with account name autocompletion in eg +hledger add, hledger-iadd, hledger-web, and ledger-mode. +In future it will also help detect misspelled accounts. -; etc. + Account names can be followed by a numeric account code: + +account assets 1000 +account assets:bank:checking 1110 +account liabilities 2000 +account revenues 4000 +account expenses 6000 + + This affects account display order in reports: accounts with codes +are listed before accounts without codes, in increasing code order. +(Otherwise, accounts are listed alphabetically.) Account codes should +be all numeric digits, unique, and separated from the account name by at +least two spaces (since account names may contain single spaces). By +convention, often the first digit indicates the type of account, as in +this numbering scheme and the example above. In future, we might use +this to recognize account types. + + An account directive can also have indented subdirectives following +it, which are currently ignored. Here is the full syntax: + +; account ACCTNAME [OPTIONALCODE] +; [OPTIONALSUBDIRECTIVES] + +account assets:bank:checking 1110 + a comment + some-tag:12345  File: hledger_journal.info, Node: apply account directive, Next: Multi-line comments, Prev: account directive, Up: Directives @@ -1218,23 +1239,23 @@ Node: end aliases32215 Ref: #end-aliases32355 Node: account directive32456 Ref: #account-directive32636 -Node: apply account directive32932 -Ref: #apply-account-directive33128 -Node: Multi-line comments33787 -Ref: #multi-line-comments33977 -Node: commodity directive34105 -Ref: #commodity-directive34289 -Node: Default commodity35161 -Ref: #default-commodity35334 -Node: Default year35871 -Ref: #default-year36036 -Node: Including other files36459 -Ref: #including-other-files36616 -Node: Periodic transactions37013 -Ref: #periodic-transactions37184 -Node: Automated posting rules37927 -Ref: #automated-posting-rules38105 -Node: EDITOR SUPPORT39214 -Ref: #editor-support39344 +Node: apply account directive33983 +Ref: #apply-account-directive34179 +Node: Multi-line comments34838 +Ref: #multi-line-comments35028 +Node: commodity directive35156 +Ref: #commodity-directive35340 +Node: Default commodity36212 +Ref: #default-commodity36385 +Node: Default year36922 +Ref: #default-year37087 +Node: Including other files37510 +Ref: #including-other-files37667 +Node: Periodic transactions38064 +Ref: #periodic-transactions38235 +Node: Automated posting rules38978 +Ref: #automated-posting-rules39156 +Node: EDITOR SUPPORT40265 +Ref: #editor-support40395  End Tag Table diff --git a/hledger-lib/hledger_journal.m4.md b/hledger-lib/hledger_journal.m4.md index 6ae353cce..06e3bdb53 100644 --- a/hledger-lib/hledger_journal.m4.md +++ b/hledger-lib/hledger_journal.m4.md @@ -716,20 +716,39 @@ end aliases ### account directive -The `account` directive predefines account names, as in Ledger and Beancount. -This may be useful for your own documentation; hledger doesn't make use of it yet. - +The `account` directive predeclares account names. The simplest form is `account ACCTNAME`, eg: ```journal -; account ACCT -; OPTIONAL COMMENTS/TAGS... - account assets:bank:checking - a comment - acct-no:12345 +``` +Currently this mainly helps with account name autocompletion in eg +hledger add, hledger-iadd, hledger-web, and ledger-mode. +In future it will also help detect misspelled accounts. -account expenses:food +Account names can be followed by a numeric account code: +```journal +account assets 1000 +account assets:bank:checking 1110 +account liabilities 2000 +account revenues 4000 +account expenses 6000 +``` +This affects account display order in reports: accounts with codes are listed before accounts without codes, in increasing code order. +(Otherwise, accounts are listed alphabetically.) +Account codes should be all numeric digits, unique, and separated from the account name by at least two spaces (since account names may contain single spaces). +By convention, often the first digit indicates the type of account, +as in +[this numbering scheme](http://www.dwmbeancounter.com/BCTutorSite/Courses/ChartAccounts/lesson02-6.html) +and the example above. +In future, we might use this to recognize account types. -; etc. +An account directive can also have indented subdirectives following it, which are currently ignored. Here is the full syntax: +```journal +; account ACCTNAME [OPTIONALCODE] +; [OPTIONALSUBDIRECTIVES] + +account assets:bank:checking 1110 + a comment + some-tag:12345 ``` ### apply account directive diff --git a/hledger-lib/hledger_journal.txt b/hledger-lib/hledger_journal.txt index e7ef69589..129d51dfe 100644 --- a/hledger-lib/hledger_journal.txt +++ b/hledger-lib/hledger_journal.txt @@ -690,20 +690,41 @@ FILE FORMAT end aliases account directive - The account directive predefines account names, as in Ledger and Bean- - count. This may be useful for your own documentation; hledger doesn't - make use of it yet. - - ; account ACCT - ; OPTIONAL COMMENTS/TAGS... + The account directive predeclares account names. The simplest form is + account ACCTNAME, eg: account assets:bank:checking - a comment - acct-no:12345 - account expenses:food + Currently this mainly helps with account name autocompletion in eg + hledger add, hledger-iadd, hledger-web, and ledger-mode. + In future it will also help detect misspelled accounts. - ; etc. + Account names can be followed by a numeric account code: + + account assets 1000 + account assets:bank:checking 1110 + account liabilities 2000 + account revenues 4000 + account expenses 6000 + + This affects account display order in reports: accounts with codes are + listed before accounts without codes, in increasing code order. (Oth- + erwise, accounts are listed alphabetically.) Account codes should be + all numeric digits, unique, and separated from the account name by at + least two spaces (since account names may contain single spaces). By + convention, often the first digit indicates the type of account, as in + this numbering scheme and the example above. In future, we might use + this to recognize account types. + + An account directive can also have indented subdirectives following it, + which are currently ignored. Here is the full syntax: + + ; account ACCTNAME [OPTIONALCODE] + ; [OPTIONALSUBDIRECTIVES] + + account assets:bank:checking 1110 + a comment + some-tag:12345 apply account directive You can specify a parent account which will be prepended to all @@ -880,7 +901,6 @@ EDITOR SUPPORT Editor -------------------------------------------------------------------------- Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html - Vim https://github.com/ledger/ledger/wiki/Getting-started Sublime Text https://github.com/ledger/ledger/wiki/Edit- ing-Ledger-files-with-Sublime-Text-or-RubyMine diff --git a/hledger/Hledger/Cli/Commands/Balance.hs b/hledger/Hledger/Cli/Commands/Balance.hs index a055e7a2d..b681d3489 100644 --- a/hledger/Hledger/Cli/Commands/Balance.hs +++ b/hledger/Hledger/Cli/Commands/Balance.hs @@ -289,7 +289,7 @@ balancemode = (defCommandMode $ ["balance"] ++ aliases) { -- also accept but don ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)" ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)" ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode to display prettier tables" - ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "sort by amount instead of account name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed." + ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed." ,flagNone ["budget"] (setboolopt "budget") "show performance compared to budget goals defined by periodic transactions" ,flagNone ["show-unbudgeted"] (setboolopt "show-unbudgeted") "with --budget, show unbudgeted accounts also" ] diff --git a/hledger/Hledger/Cli/CompoundBalanceCommand.hs b/hledger/Hledger/Cli/CompoundBalanceCommand.hs index c3ee49f1b..61cd3db62 100644 --- a/hledger/Hledger/Cli/CompoundBalanceCommand.hs +++ b/hledger/Hledger/Cli/CompoundBalanceCommand.hs @@ -106,7 +106,7 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} = (defCommandMode $ cb ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)" ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)" ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode when displaying tables" - ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "sort by amount instead of account name" + ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "sort by amount instead of account code/name" ,outputFormatFlag ,outputFileFlag ] diff --git a/hledger/hledger.1 b/hledger/hledger.1 index 882e28eaf..d16dd7cb6 100644 --- a/hledger/hledger.1 +++ b/hledger/hledger.1 @@ -1464,7 +1464,7 @@ use unicode to display prettier tables. .RE .TP .B \f[C]\-\-sort\-amount\f[] -sort by amount instead of account name (in flat mode). +sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. .RS @@ -1510,14 +1510,18 @@ balance. .PP By default, accounts are displayed hierarchically, with subaccounts indented below their parent. +At each level of the tree, accounts are sorted by account code if any, +then by account name. +Or with \f[C]\-S/\-\-sort\-amount\f[], by their balance amount. +.PP \[lq]Boring\[rq] accounts, which contain a single interesting subaccount and no balance of their own, are elided into the following line for more compact output. -(Use \f[C]\-\-no\-elide\f[] to prevent this. -Eliding of boring accounts is not yet supported in multicolumn reports.) +(Not yet supported in tabular reports.) Use \f[C]\-\-no\-elide\f[] to +prevent this. .PP -Each account's balance is the \[lq]inclusive\[rq] balance \- it includes -the balances of any subaccounts. +Account balances are \[lq]inclusive\[rq] \- they include the balances of +any subaccounts. .PP Accounts which have zero balance (and no non\-zero subaccounts) are omitted. @@ -1971,7 +1975,7 @@ in single\-column balance reports: use this custom line format .RE .TP .B \f[C]\-\-sort\-amount\f[] -sort by amount instead of account name +sort by amount instead of account code/name .RS .RE .PP @@ -2113,7 +2117,7 @@ in single\-column balance reports: use this custom line format .RE .TP .B \f[C]\-\-sort\-amount\f[] -sort by amount instead of account name +sort by amount instead of account code/name .RS .RE .PP @@ -2300,7 +2304,7 @@ in single\-column balance reports: use this custom line format .RE .TP .B \f[C]\-\-sort\-amount\f[] -sort by amount instead of account name +sort by amount instead of account code/name .RS .RE .PP diff --git a/hledger/hledger.info b/hledger/hledger.info index beb234164..206e90e4d 100644 --- a/hledger/hledger.info +++ b/hledger/hledger.info @@ -1094,7 +1094,7 @@ Show accounts and their balances. Aliases: b, bal. use unicode to display prettier tables. '--sort-amount' - sort by amount instead of account name (in flat mode). With + sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. '--budget' @@ -1128,14 +1128,17 @@ where you do not filter by date and your journal sets the correct opening balances, this is the same as the account's ending balance. 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 -reports.) +indented below their parent. At each level of the tree, accounts are +sorted by account code if any, then by account name. Or with +'-S/--sort-amount', by their balance amount. - Each account's balance is the "inclusive" balance - it includes the -balances of any subaccounts. + "Boring" accounts, which contain a single interesting subaccount and +no balance of their own, are elided into the following line for more +compact output. (Not yet supported in tabular reports.) Use +'--no-elide' to prevent this. + + Account balances are "inclusive" - they include the balances of any +subaccounts. Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use '-E/--empty' to show them. @@ -1537,7 +1540,7 @@ conventional financial statements, unlike balance/print/register) in single-column balance reports: use this custom line format '--sort-amount' - sort by amount instead of account name + sort by amount instead of account code/name Example: @@ -1653,7 +1656,7 @@ statements, unlike balance/print/register) (experimental). (cf) in single-column balance reports: use this custom line format '--sort-amount' - sort by amount instead of account name + sort by amount instead of account code/name Example: @@ -1821,7 +1824,7 @@ unlike balance/print/register) (experimental). (is) in single-column balance reports: use this custom line format '--sort-amount' - sort by amount instead of account name + sort by amount instead of account code/name This command displays a simple income statement. It currently assumes that you have top-level accounts named 'income' (or 'revenue') @@ -2429,89 +2432,89 @@ Node: add31307 Ref: #add31406 Node: balance34067 Ref: #balance34178 -Node: Flat mode37552 -Ref: #flat-mode37677 -Node: Depth limited balance reports38097 -Ref: #depth-limited-balance-reports38298 -Node: Multicolumn balance reports38718 -Ref: #multicolumn-balance-reports38913 -Node: Budgets43602 -Ref: #budgets43749 -Node: Custom balance output47580 -Ref: #custom-balance-output47742 -Node: Colour support49835 -Ref: #colour-support49994 -Node: Output destination50167 -Ref: #output-destination50323 -Node: CSV output50593 -Ref: #csv-output50710 -Node: balancesheet51107 -Ref: #balancesheet51243 -Node: balancesheetequity53470 -Ref: #balancesheetequity53619 -Node: cashflow54156 -Ref: #cashflow54284 -Node: check-dates56323 -Ref: #check-dates56450 -Node: check-dupes56567 -Ref: #check-dupes56691 -Node: close56828 -Ref: #close56935 -Node: help57265 -Ref: #help57365 -Node: import58439 -Ref: #import58553 -Node: incomestatement59283 -Ref: #incomestatement59417 -Node: prices61737 -Ref: #prices61852 -Node: print61895 -Ref: #print62005 -Node: print-unique66890 -Ref: #print-unique67016 -Node: register67084 -Ref: #register67211 -Node: Custom register output71712 -Ref: #custom-register-output71841 -Node: register-match73138 -Ref: #register-match73272 -Node: rewrite73455 -Ref: #rewrite73572 -Node: stats73641 -Ref: #stats73744 -Node: tags74626 -Ref: #tags74724 -Node: test74960 -Ref: #test75044 -Node: ADD-ON COMMANDS75412 -Ref: #add-on-commands75522 -Node: Official add-ons76809 -Ref: #official-add-ons76949 -Node: api77036 -Ref: #api77125 -Node: ui77177 -Ref: #ui77276 -Node: web77334 -Ref: #web77423 -Node: Third party add-ons77469 -Ref: #third-party-add-ons77644 -Node: diff77779 -Ref: #diff77876 -Node: iadd77975 -Ref: #iadd78089 -Node: interest78172 -Ref: #interest78293 -Node: irr78388 -Ref: #irr78486 -Node: Experimental add-ons78564 -Ref: #experimental-add-ons78716 -Node: autosync79007 -Ref: #autosync79119 -Node: budget79358 -Ref: #budget79480 -Node: chart79546 -Ref: #chart79663 -Node: check79734 -Ref: #check79836 +Node: Flat mode37658 +Ref: #flat-mode37783 +Node: Depth limited balance reports38203 +Ref: #depth-limited-balance-reports38404 +Node: Multicolumn balance reports38824 +Ref: #multicolumn-balance-reports39019 +Node: Budgets43708 +Ref: #budgets43855 +Node: Custom balance output47686 +Ref: #custom-balance-output47848 +Node: Colour support49941 +Ref: #colour-support50100 +Node: Output destination50273 +Ref: #output-destination50429 +Node: CSV output50699 +Ref: #csv-output50816 +Node: balancesheet51213 +Ref: #balancesheet51349 +Node: balancesheetequity53581 +Ref: #balancesheetequity53730 +Node: cashflow54267 +Ref: #cashflow54395 +Node: check-dates56439 +Ref: #check-dates56566 +Node: check-dupes56683 +Ref: #check-dupes56807 +Node: close56944 +Ref: #close57051 +Node: help57381 +Ref: #help57481 +Node: import58555 +Ref: #import58669 +Node: incomestatement59399 +Ref: #incomestatement59533 +Node: prices61858 +Ref: #prices61973 +Node: print62016 +Ref: #print62126 +Node: print-unique67011 +Ref: #print-unique67137 +Node: register67205 +Ref: #register67332 +Node: Custom register output71833 +Ref: #custom-register-output71962 +Node: register-match73259 +Ref: #register-match73393 +Node: rewrite73576 +Ref: #rewrite73693 +Node: stats73762 +Ref: #stats73865 +Node: tags74747 +Ref: #tags74845 +Node: test75081 +Ref: #test75165 +Node: ADD-ON COMMANDS75533 +Ref: #add-on-commands75643 +Node: Official add-ons76930 +Ref: #official-add-ons77070 +Node: api77157 +Ref: #api77246 +Node: ui77298 +Ref: #ui77397 +Node: web77455 +Ref: #web77544 +Node: Third party add-ons77590 +Ref: #third-party-add-ons77765 +Node: diff77900 +Ref: #diff77997 +Node: iadd78096 +Ref: #iadd78210 +Node: interest78293 +Ref: #interest78414 +Node: irr78509 +Ref: #irr78607 +Node: Experimental add-ons78685 +Ref: #experimental-add-ons78837 +Node: autosync79128 +Ref: #autosync79240 +Node: budget79479 +Ref: #budget79601 +Node: chart79667 +Ref: #chart79784 +Node: check79855 +Ref: #check79957  End Tag Table diff --git a/hledger/hledger.txt b/hledger/hledger.txt index b35e55cc3..29b4b7632 100644 --- a/hledger/hledger.txt +++ b/hledger/hledger.txt @@ -997,9 +997,9 @@ COMMANDS use unicode to display prettier tables. --sort-amount - sort by amount instead of account name (in flat mode). With - multiple columns, sorts by the row total, or by row average if - that is displayed. + sort by amount instead of account code/name (in flat mode). + With multiple columns, sorts by the row total, or by row average + if that is displayed. --budget show performance compared to budget goals defined by periodic @@ -1031,19 +1031,22 @@ COMMANDS ances, this is the same as the account's ending balance. 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 - reports.) + indented below their parent. At each level of the tree, accounts are + sorted by account code if any, then by account name. Or with + -S/--sort-amount, by their balance amount. - Each account's balance is the "inclusive" balance - it includes the - balances of any subaccounts. + "Boring" accounts, which contain a single interesting subaccount and no + balance of their own, are elided into the following line for more com- + pact output. (Not yet supported in tabular reports.) Use --no-elide to + prevent this. - Accounts which have zero balance (and no non-zero subaccounts) are + Account balances are "inclusive" - they include the balances of any + subaccounts. + + 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 @@ -1053,9 +1056,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 @@ -1063,9 +1066,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 @@ -1075,12 +1078,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 @@ -1095,8 +1098,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 @@ -1112,8 +1115,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: @@ -1129,26 +1132,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: @@ -1170,13 +1173,13 @@ COMMANDS # Average is rounded to the dollar here since all journal amounts are Budgets - With --budget and a report interval, all periodic transactions in your - journal with that interval, active during the requested report period, - are interpreted as recurring budget goals for the specified accounts - (and subaccounts), and the report will show the difference between + With --budget and a report interval, all periodic transactions in your + journal with that interval, active during the requested report period, + are interpreted as recurring budget goals for the specified accounts + (and subaccounts), and the report will show the difference between actual and budgeted balances. - For example, you can take average monthly expenses in the common + For example, you can take average monthly expenses in the common expense categories to construct a minimal monthly budget: ;; Budget @@ -1235,8 +1238,8 @@ COMMANDS -----------------------++------------------------------------------------- || 0 0 - Accounts with no budget goals (not mentioned in the periodic transac- - tions) will be aggregated under , unless you add the + Accounts with no budget goals (not mentioned in the periodic transac- + tions) will be aggregated under , unless you add the --show-unbudgeted flag to display them normally: $ hledger balance --budget --show-unbudgeted @@ -1257,7 +1260,7 @@ COMMANDS For more examples and details, see Budgeting and Forecasting. 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)" @@ -1275,7 +1278,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) @@ -1286,14 +1289,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) @@ -1302,7 +1305,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. @@ -1310,14 +1313,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 @@ -1328,8 +1331,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) @@ -1337,8 +1340,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 @@ -1346,11 +1349,11 @@ COMMANDS balancesheet This command displays a simple balance sheet, showing historical ending - balances of asset and liability accounts (ignoring any report begin - date). It assumes that these accounts are under a top-level asset or - liability account (case insensitive, plural forms also allowed). Note - this report shows all account balances with normal positive sign (like - conventional financial statements, unlike balance/print/register) + balances of asset and liability accounts (ignoring any report begin + date). It assumes that these accounts are under a top-level asset or + liability account (case insensitive, plural forms also allowed). Note + this report shows all account balances with normal positive sign (like + conventional financial statements, unlike balance/print/register) (experimental). (bs) --change @@ -1358,7 +1361,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 @@ -1390,7 +1393,7 @@ COMMANDS in single-column balance reports: use this custom line format --sort-amount - sort by amount instead of account name + sort by amount instead of account code/name Example: @@ -1414,13 +1417,13 @@ 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 - Just like balancesheet, but also reports Equity (which it assumes is + Just like balancesheet, but also reports Equity (which it assumes is under a top-level equity account). Example: @@ -1450,10 +1453,10 @@ COMMANDS 0 cashflow - This command displays a simple cashflow statement, showing changes in - "cash" accounts. It assumes that these accounts are under a top-level - asset account (case insensitive, plural forms also allowed) and do not - contain receivable or A/R in their name. Note this report shows all + This command displays a simple cashflow statement, showing changes in + "cash" accounts. It assumes that these accounts are under a top-level + asset account (case insensitive, plural forms also allowed) and do not + contain receivable or A/R in their name. Note this report shows all account balances with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (cf) @@ -1461,7 +1464,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 @@ -1493,7 +1496,7 @@ COMMANDS in single-column balance reports: use this custom line format --sort-amount - sort by amount instead of account name + sort by amount instead of account code/name Example: @@ -1512,35 +1515,35 @@ 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. check-dates - Check that transactions are sorted by increasing date. With a query, + Check that transactions are sorted by increasing date. With a query, only matched transactions' dates are checked. check-dupes - Report account names having the same leaf but different prefixes. An + Report account names having the same leaf but different prefixes. An example: http://stefanorodighiero.net/software/hledger-dupes.html close - Print closing/opening transactions that bring some or all account bal- - ances to zero and back. Can be useful for bringing asset/liability + Print closing/opening transactions that bring some or all account bal- + ances to zero and back. Can be useful for bringing asset/liability balances across file boundaries, or for closing out income/expenses for - a period. This was formerly called "equity", as in Ledger, and that + a period. This was formerly called "equity", as in Ledger, and that alias is also accepted. See close -help for more. 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 @@ -1564,7 +1567,7 @@ COMMANDS ... import - Read new transactions added to each FILE since last run, and add them + Read new transactions added to each FILE since last run, and add them to the main journal file. --dry-run @@ -1574,28 +1577,28 @@ COMMANDS each one. So eg to add new transactions from all CSV files to the main journal, it's just: hledger import *.csv - New transactions are detected in the same way as print -new: by assum- + New transactions are detected in the same way as print -new: by assum- ing transactions are always added to the input files in increasing date order, and by saving .latest.FILE state files. - The -dry-run output is in journal format, so you can filter it, eg to + The -dry-run output is in journal format, so you can filter it, eg to see only uncategorised transactions: $ hledger import --dry ... | hledger -f- print unknown --ignore-assertions incomestatement - This command displays a simple income statement, showing revenues and - expenses during a period. It assumes that these accounts are under a - top-level revenue or income or expense account (case insensitive, plu- - ral forms also allowed). Note this report shows all account balances - with normal positive sign (like conventional financial statements, + This command displays a simple income statement, showing revenues and + expenses during a period. It assumes that these accounts are under a + top-level revenue or income or expense account (case insensitive, plu- + ral forms also allowed). Note this report shows all account balances + with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (is) --change 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 @@ -1627,10 +1630,10 @@ COMMANDS in single-column balance reports: use this custom line format --sort-amount - sort by amount instead of account name + sort by amount instead of account code/name - 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 @@ -1655,8 +1658,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. prices @@ -1666,7 +1669,7 @@ COMMANDS Show transactions from the journal. Aliases: p, txns. -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 --new show only newer-dated transactions added in each file since last @@ -1679,7 +1682,7 @@ 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. $ hledger print @@ -1710,39 +1713,39 @@ COMMANDS it does not preserve directives or inter-transaction comments Normally, the journal entry's explicit or implicit amount style is pre- - served. Ie when an amount is omitted in the journal, it will be omit- - ted in the output. You can use the -x/--explicit flag to make all + served. Ie when an amount is omitted in the journal, it will be omit- + ted 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, - -x will cause postings with a multi-commodity amount (these can arise - when a multi-commodity transaction has an implicit amount) will be - split into multiple single-commodity postings, for valid journal out- + -x will cause postings with a multi-commodity amount (these can arise + when a multi-commodity transaction has an implicit amount) will be + split into multiple single-commodity postings, for valid journal out- put. - With -B/--cost, amounts with transaction prices are converted to cost + With -B/--cost, amounts with transaction prices are converted to cost using that price. This can be used for troubleshooting. - With -m/--match and a STR argument, print will show at most one trans- - action: the one one whose description is most similar to STR, and is - most recent. STR should contain at least two characters. If there is + With -m/--match and a STR argument, print will show at most one trans- + action: the one one whose description is most similar to STR, and is + most recent. STR should contain at least two characters. If there is no similar-enough match, no transaction will be shown. With --new, for each FILE being read, hledger reads (and writes) a spe- - cial state file (.latest.FILE in the same directory), containing the - latest transaction date(s) that were seen last time FILE was read. - When this file is found, only transactions with newer dates (and new - transactions on the latest date) are printed. This is useful for - ignoring already-seen entries in import data, such as downloaded CSV + cial state file (.latest.FILE in the same directory), containing the + latest transaction date(s) that were seen last time FILE was read. + When this file is found, only transactions with newer dates (and new + transactions on the latest date) are printed. This is useful for + ignoring already-seen entries in import data, such as downloaded CSV files. Eg: $ hledger -f bank1.csv print --new # shows transactions added since last print --new on this file - This assumes that transactions added to FILE always have same or - increasing dates, and that transactions on the same day do not get + This assumes that transactions added to FILE always have same or + increasing dates, and that transactions on the same day do not get reordered. See also the import command. - 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 @@ -1759,20 +1762,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.) print-unique @@ -1785,7 +1788,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 @@ -1796,18 +1799,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 @@ -1816,8 +1819,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 @@ -1827,23 +1830,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 @@ -1860,7 +1863,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 @@ -1868,18 +1871,18 @@ 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 + 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: @@ -1896,12 +1899,12 @@ 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. register-match Print the one posting whose transaction description is closest to DESC, - in the style of the register command. Helps ledger-autosync detect + in the style of the register command. Helps ledger-autosync detect already-seen transactions when importing. rewrite @@ -1911,7 +1914,7 @@ COMMANDS 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 @@ -1926,16 +1929,16 @@ 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 destination. tags - List all the tag names used in the journal. With a TAGREGEX argument, - only tag names matching the regular expression (case insensitive) are + List all the tag names used in the journal. With a TAGREGEX argument, + only tag names matching the regular expression (case insensitive) are shown. With additional QUERY arguments, only transactions matching the query are considered. @@ -1945,34 +1948,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: @@ -1990,7 +1993,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 @@ -1998,7 +2001,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 @@ -2006,19 +2009,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 @@ -2031,21 +2034,21 @@ ADD-ON COMMANDS hledger-check.hs checks more powerful account balance assertions. 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 @@ -2058,33 +2061,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 @@ -2103,7 +2106,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 @@ -2124,7 +2127,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) @@ -2138,7 +2141,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/hledger_balance.m4.md b/hledger/hledger_balance.m4.md index 2777bb765..2bf6493ef 100644 --- a/hledger/hledger_balance.m4.md +++ b/hledger/hledger_balance.m4.md @@ -45,7 +45,7 @@ txt, csv. : use unicode to display prettier tables. `--sort-amount` -: sort by amount instead of account name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. +: sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. `--budget` : show performance compared to budget goals defined by [periodic transactions](journal.html#periodic-transactions) @@ -75,15 +75,15 @@ $ hledger balance 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 balances, this is the same as the account's ending balance. -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 reports.) +By default, accounts are displayed hierarchically, with subaccounts indented below their parent. +At each level of the tree, accounts are sorted by [account code](/manual.html#account-directive) if any, then by account name. +Or with `-S/--sort-amount`, by their balance amount. -Each account's balance is the "inclusive" balance - it includes the -balances of any subaccounts. +"Boring" accounts, which contain a single interesting subaccount and +no balance of their own, are elided into the following line for more compact output. +(Not yet supported in tabular reports.) Use `--no-elide` to prevent this. + +Account balances are "inclusive" - they include the balances of any subaccounts. Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use `-E/--empty` to show them. diff --git a/hledger/hledger_commands.m4.md b/hledger/hledger_commands.m4.md index bab4633c6..e308c9468 100644 --- a/hledger/hledger_commands.m4.md +++ b/hledger/hledger_commands.m4.md @@ -218,7 +218,7 @@ _include_({{hledger_balance.m4.md}}) : in single-column balance reports: use this custom line format `--sort-amount` -: sort by amount instead of account name +: sort by amount instead of account code/name Example: ```shell @@ -324,7 +324,7 @@ Total: : in single-column balance reports: use this custom line format `--sort-amount` -: sort by amount instead of account name +: sort by amount instead of account code/name Example: ```shell @@ -463,7 +463,7 @@ $ hledger import --dry ... | hledger -f- print unknown --ignore-assertions : in single-column balance reports: use this custom line format `--sort-amount` -: sort by amount instead of account name +: sort by amount instead of account code/name This command displays a simple [income statement](http://en.wikipedia.org/wiki/Income_statement). It