hledger 1.17 → 1.17.1
raw patch · 27 files changed
+1136/−870 lines, 27 filesdep ~Decimaldep ~hledger-libdep ~math-functionsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Decimal, hledger-lib, math-functions
API changes (from Hackage documentation)
Files
- CHANGES.md +14/−0
- Hledger/Cli/CliOptions.hs +1/−0
- Hledger/Cli/Commands/Add.hs +1/−0
- README.md +19/−13
- embeddedfiles/hledger-ui.1 +1/−1
- embeddedfiles/hledger-ui.info +22/−22
- embeddedfiles/hledger-ui.txt +1/−1
- embeddedfiles/hledger.1 +1/−1
- embeddedfiles/hledger.info +183/−183
- embeddedfiles/hledger.txt +1/−1
- embeddedfiles/hledger_csv.5 +34/−20
- embeddedfiles/hledger_csv.info +138/−80
- embeddedfiles/hledger_csv.txt +35/−20
- embeddedfiles/hledger_journal.5 +88/−31
- embeddedfiles/hledger_journal.info +235/−175
- embeddedfiles/hledger_journal.txt +150/−114
- embeddedfiles/hledger_timeclock.5 +1/−1
- embeddedfiles/hledger_timeclock.info +2/−2
- embeddedfiles/hledger_timeclock.txt +1/−1
- embeddedfiles/hledger_timedot.5 +1/−1
- embeddedfiles/hledger_timedot.info +2/−2
- embeddedfiles/hledger_timedot.txt +1/−1
- hledger.1 +1/−1
- hledger.cabal +13/−13
- hledger.info +183/−183
- hledger.txt +1/−1
- test/unittest.hs +6/−2
CHANGES.md view
@@ -1,6 +1,20 @@ User-visible changes in the hledger command line tool and library. +# 1.17.1 2020-03-18++- csv: amount1 no longer forces a second posting or second posting amount.+ The "special handling for pre 1.17 rules" should now be less+ noticeable. amount1/amount2 no longer force a second posting or+ explicit amounts on both postings. (Only amount/amount-in/amount-out+ do that.) Error messages and handling of corner cases may be more+ robust, also.++- journal: a commodity directive without decimal mark now gives a more+ verbose error message with examples++- journal: inclusive balance assignments now work (#1207)+ # 1.17 2020-03-01 ## General
Hledger/Cli/CliOptions.hs view
@@ -73,6 +73,7 @@ import Control.Monad (when) import Data.Char import Data.Default+import Data.Either (isRight) import Data.Functor.Identity (Identity) import "base-compat-batteries" Data.List.Compat import Data.List.Extra (nubSort)
Hledger/Cli/Commands/Add.hs view
@@ -23,6 +23,7 @@ import Control.Monad.State.Strict (evalState, evalStateT) import Control.Monad.Trans (liftIO) import Data.Char (toUpper, toLower)+import Data.Either (isRight) import Data.Functor.Identity (Identity(..)) import "base-compat-batteries" Data.List.Compat import qualified Data.Set as S
README.md view
@@ -99,15 +99,23 @@ [](http://www.gnu.org/licenses/gpl.html) -[](#backers)-[](#sponsors)-[](https://github.com/simonmichael/hledger/issues?q=label:bounty)-[](http://bugs.hledger.org)+[](https://github.com/simonmichael/hledger/actions)+<!-- [](https://travis-ci.org/simonmichael/hledger/builds) -->+<!-- [](https://ci.appveyor.com/project/simonmichael/hledger/history) --> [](http://hackage.haskell.org/package/hledger)-[](http://stackage.org/nightly/package/hledger)-[](http://stackage.org/lts/package/hledger)-[](http://stackage.org/lts-7/package/hledger)+<br>+[](http://packdeps.haskellers.com/feed?needle=hledger-lib)+[](http://packdeps.haskellers.com/feed?needle=hledger)+<br>+[](http://packdeps.haskellers.com/feed?needle=hledger-ui)+[](http://packdeps.haskellers.com/feed?needle=hledger-web)++[](https://repology.org/metapackage/hledger)+[](https://repology.org/metapackage/hledger)+<!-- [](http://stackage.org/lts/package/hledger) -->+<!-- [](http://stackage.org/nightly/package/hledger) -->+ <!-- [](https://github.com/simonmichael/hledger/releases) --> <!-- []() --> -[](https://travis-ci.org/simonmichael/hledger/builds)-[](https://ci.appveyor.com/project/simonmichael/hledger/history)-[](http://packdeps.haskellers.com/feed?needle=hledger-lib)-[](http://packdeps.haskellers.com/feed?needle=hledger)-[](http://packdeps.haskellers.com/feed?needle=hledger-ui)-[](http://packdeps.haskellers.com/feed?needle=hledger-web)+[](#backers)+[](#sponsors)+[](https://github.com/simonmichael/hledger/issues?q=label:bounty)+[](http://bugs.hledger.org)
embeddedfiles/hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger-ui" "1" "March 2020" "hledger-ui 1.17" "hledger User Manuals"+.TH "hledger-ui" "1" "March 2020" "hledger-ui 1.17.1" "hledger User Manuals"
embeddedfiles/hledger-ui.info view
@@ -3,8 +3,8 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.17-*****************************+hledger-ui(1) hledger-ui 1.17.1+******************************* hledger-ui - terminal interface for the hledger accounting tool @@ -499,26 +499,26 @@ Tag Table: Node: Top71-Node: OPTIONS1470-Ref: #options1567-Node: KEYS4998-Ref: #keys5093-Node: SCREENS9369-Ref: #screens9474-Node: Accounts screen9564-Ref: #accounts-screen9692-Node: Register screen11908-Ref: #register-screen12063-Node: Transaction screen14060-Ref: #transaction-screen14218-Node: Error screen15088-Ref: #error-screen15210-Node: ENVIRONMENT15454-Ref: #environment15568-Node: FILES16375-Ref: #files16474-Node: BUGS16687-Ref: #bugs16764+Node: OPTIONS1474+Ref: #options1571+Node: KEYS5002+Ref: #keys5097+Node: SCREENS9373+Ref: #screens9478+Node: Accounts screen9568+Ref: #accounts-screen9696+Node: Register screen11912+Ref: #register-screen12067+Node: Transaction screen14064+Ref: #transaction-screen14222+Node: Error screen15092+Ref: #error-screen15214+Node: ENVIRONMENT15458+Ref: #environment15572+Node: FILES16379+Ref: #files16478+Node: BUGS16691+Ref: #bugs16768 End Tag Table
embeddedfiles/hledger-ui.txt view
@@ -441,4 +441,4 @@ -hledger-ui 1.17 March 2020 hledger-ui(1)+hledger-ui 1.17.1 March 2020 hledger-ui(1)
embeddedfiles/hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger" "1" "March 2020" "hledger 1.17.1" "hledger User Manuals"
embeddedfiles/hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: COMMON TASKS, Up: (dir) -hledger(1) hledger 1.17-***********************+hledger(1) hledger 1.17.1+************************* hledger - a command-line accounting tool @@ -3734,187 +3734,187 @@ Tag Table: Node: Top68-Node: COMMON TASKS2315-Ref: #common-tasks2427-Node: Getting help2834-Ref: #getting-help2966-Node: Constructing command lines3519-Ref: #constructing-command-lines3711-Node: Starting a journal file4408-Ref: #starting-a-journal-file4606-Node: Setting opening balances5794-Ref: #setting-opening-balances5990-Node: Recording transactions9131-Ref: #recording-transactions9311-Node: Reconciling9867-Ref: #reconciling10010-Node: Reporting12267-Ref: #reporting12407-Node: Migrating to a new file16406-Ref: #migrating-to-a-new-file16554-Node: OPTIONS16853-Ref: #options16960-Node: General options17330-Ref: #general-options17455-Node: Command options20225-Ref: #command-options20376-Node: Command arguments20774-Ref: #command-arguments20921-Node: Queries21801-Ref: #queries21956-Node: Special characters in arguments and queries25918-Ref: #special-characters-in-arguments-and-queries26146-Node: More escaping26597-Ref: #more-escaping26759-Node: Even more escaping27055-Ref: #even-more-escaping27249-Node: Less escaping27920-Ref: #less-escaping28082-Node: Unicode characters28327-Ref: #unicode-characters28509-Node: Input files29921-Ref: #input-files30064-Node: Output destination31993-Ref: #output-destination32145-Node: Output format32570-Ref: #output-format32720-Node: Regular expressions34768-Ref: #regular-expressions34925-Node: Smart dates36286-Ref: #smart-dates36437-Node: Report start & end date37798-Ref: #report-start-end-date37970-Node: Report intervals39408-Ref: #report-intervals39573-Node: Period expressions39963-Ref: #period-expressions40123-Node: Depth limiting44249-Ref: #depth-limiting44393-Node: Pivoting44735-Ref: #pivoting44858-Node: Valuation46534-Ref: #valuation46636-Node: -B Cost46816-Ref: #b-cost46927-Node: -V Market value47125-Ref: #v-market-value47299-Node: -X Market value in specified commodity48731-Ref: #x-market-value-in-specified-commodity48970-Node: --value Flexible valuation49146-Ref: #value-flexible-valuation49372-Node: Effect of --value on reports53877-Ref: #effect-of---value-on-reports54093-Node: Combining -B -V -X --value59639-Ref: #combining--b--v--x---value59822-Node: COMMANDS59858-Ref: #commands59966-Node: accounts61050-Ref: #accounts61148-Node: activity61847-Ref: #activity61957-Node: add62340-Ref: #add62439-Node: balance65178-Ref: #balance65289-Node: Classic balance report66747-Ref: #classic-balance-report66920-Node: Customising the classic balance report68289-Ref: #customising-the-classic-balance-report68517-Node: Colour support70593-Ref: #colour-support70760-Node: Flat mode70933-Ref: #flat-mode71081-Node: Depth limited balance reports71494-Ref: #depth-limited-balance-reports71679-Node: Percentages72135-Ref: #percentages72301-Node: Multicolumn balance report73438-Ref: #multicolumn-balance-report73618-Node: Budget report78880-Ref: #budget-report79023-Node: Nested budgets84225-Ref: #nested-budgets84337-Ref: #output-format-187818-Node: balancesheet88015-Ref: #balancesheet88151-Node: balancesheetequity89617-Ref: #balancesheetequity89766-Node: cashflow90489-Ref: #cashflow90617-Node: check-dates91796-Ref: #check-dates91923-Node: check-dupes92202-Ref: #check-dupes92326-Node: close92619-Ref: #close92733-Node: close usage94255-Ref: #close-usage94348-Node: commodities97161-Ref: #commodities97288-Node: descriptions97370-Ref: #descriptions97498-Node: diff97679-Ref: #diff97785-Node: files98832-Ref: #files98932-Node: help99079-Ref: #help99179-Node: import100260-Ref: #import100374-Node: Importing balance assignments101267-Ref: #importing-balance-assignments101415-Node: incomestatement102064-Ref: #incomestatement102197-Node: notes103684-Ref: #notes103797-Node: payees103923-Ref: #payees104029-Node: prices104187-Ref: #prices104293-Node: print104634-Ref: #print104744-Node: print-unique109530-Ref: #print-unique109656-Node: register109941-Ref: #register110068-Node: Custom register output114240-Ref: #custom-register-output114369-Node: register-match115706-Ref: #register-match115840-Node: rewrite116191-Ref: #rewrite116306-Node: Re-write rules in a file118161-Ref: #re-write-rules-in-a-file118295-Node: Diff output format119505-Ref: #diff-output-format119674-Node: rewrite vs print --auto120766-Ref: #rewrite-vs.-print---auto120945-Node: roi121501-Ref: #roi121599-Node: stats122611-Ref: #stats122710-Node: tags123498-Ref: #tags123596-Node: test123890-Ref: #test123998-Node: Add-on Commands124745-Ref: #add-on-commands124862-Node: ui126205-Ref: #ui126293-Node: web126347-Ref: #web126450-Node: iadd126566-Ref: #iadd126677-Node: interest126759-Ref: #interest126866-Node: ENVIRONMENT127106-Ref: #environment127218-Node: FILES128047-Ref: #files-1128150-Node: LIMITATIONS128363-Ref: #limitations128482-Node: TROUBLESHOOTING129224-Ref: #troubleshooting129337+Node: COMMON TASKS2319+Ref: #common-tasks2431+Node: Getting help2838+Ref: #getting-help2970+Node: Constructing command lines3523+Ref: #constructing-command-lines3715+Node: Starting a journal file4412+Ref: #starting-a-journal-file4610+Node: Setting opening balances5798+Ref: #setting-opening-balances5994+Node: Recording transactions9135+Ref: #recording-transactions9315+Node: Reconciling9871+Ref: #reconciling10014+Node: Reporting12271+Ref: #reporting12411+Node: Migrating to a new file16410+Ref: #migrating-to-a-new-file16558+Node: OPTIONS16857+Ref: #options16964+Node: General options17334+Ref: #general-options17459+Node: Command options20229+Ref: #command-options20380+Node: Command arguments20778+Ref: #command-arguments20925+Node: Queries21805+Ref: #queries21960+Node: Special characters in arguments and queries25922+Ref: #special-characters-in-arguments-and-queries26150+Node: More escaping26601+Ref: #more-escaping26763+Node: Even more escaping27059+Ref: #even-more-escaping27253+Node: Less escaping27924+Ref: #less-escaping28086+Node: Unicode characters28331+Ref: #unicode-characters28513+Node: Input files29925+Ref: #input-files30068+Node: Output destination31997+Ref: #output-destination32149+Node: Output format32574+Ref: #output-format32724+Node: Regular expressions34772+Ref: #regular-expressions34929+Node: Smart dates36290+Ref: #smart-dates36441+Node: Report start & end date37802+Ref: #report-start-end-date37974+Node: Report intervals39412+Ref: #report-intervals39577+Node: Period expressions39967+Ref: #period-expressions40127+Node: Depth limiting44253+Ref: #depth-limiting44397+Node: Pivoting44739+Ref: #pivoting44862+Node: Valuation46538+Ref: #valuation46640+Node: -B Cost46820+Ref: #b-cost46931+Node: -V Market value47129+Ref: #v-market-value47303+Node: -X Market value in specified commodity48735+Ref: #x-market-value-in-specified-commodity48974+Node: --value Flexible valuation49150+Ref: #value-flexible-valuation49376+Node: Effect of --value on reports53881+Ref: #effect-of---value-on-reports54097+Node: Combining -B -V -X --value59643+Ref: #combining--b--v--x---value59826+Node: COMMANDS59862+Ref: #commands59970+Node: accounts61054+Ref: #accounts61152+Node: activity61851+Ref: #activity61961+Node: add62344+Ref: #add62443+Node: balance65182+Ref: #balance65293+Node: Classic balance report66751+Ref: #classic-balance-report66924+Node: Customising the classic balance report68293+Ref: #customising-the-classic-balance-report68521+Node: Colour support70597+Ref: #colour-support70764+Node: Flat mode70937+Ref: #flat-mode71085+Node: Depth limited balance reports71498+Ref: #depth-limited-balance-reports71683+Node: Percentages72139+Ref: #percentages72305+Node: Multicolumn balance report73442+Ref: #multicolumn-balance-report73622+Node: Budget report78884+Ref: #budget-report79027+Node: Nested budgets84229+Ref: #nested-budgets84341+Ref: #output-format-187822+Node: balancesheet88019+Ref: #balancesheet88155+Node: balancesheetequity89621+Ref: #balancesheetequity89770+Node: cashflow90493+Ref: #cashflow90621+Node: check-dates91800+Ref: #check-dates91927+Node: check-dupes92206+Ref: #check-dupes92330+Node: close92623+Ref: #close92737+Node: close usage94259+Ref: #close-usage94352+Node: commodities97165+Ref: #commodities97292+Node: descriptions97374+Ref: #descriptions97502+Node: diff97683+Ref: #diff97789+Node: files98836+Ref: #files98936+Node: help99083+Ref: #help99183+Node: import100264+Ref: #import100378+Node: Importing balance assignments101271+Ref: #importing-balance-assignments101419+Node: incomestatement102068+Ref: #incomestatement102201+Node: notes103688+Ref: #notes103801+Node: payees103927+Ref: #payees104033+Node: prices104191+Ref: #prices104297+Node: print104638+Ref: #print104748+Node: print-unique109534+Ref: #print-unique109660+Node: register109945+Ref: #register110072+Node: Custom register output114244+Ref: #custom-register-output114373+Node: register-match115710+Ref: #register-match115844+Node: rewrite116195+Ref: #rewrite116310+Node: Re-write rules in a file118165+Ref: #re-write-rules-in-a-file118299+Node: Diff output format119509+Ref: #diff-output-format119678+Node: rewrite vs print --auto120770+Ref: #rewrite-vs.-print---auto120949+Node: roi121505+Ref: #roi121603+Node: stats122615+Ref: #stats122714+Node: tags123502+Ref: #tags123600+Node: test123894+Ref: #test124002+Node: Add-on Commands124749+Ref: #add-on-commands124866+Node: ui126209+Ref: #ui126297+Node: web126351+Ref: #web126454+Node: iadd126570+Ref: #iadd126681+Node: interest126763+Ref: #interest126870+Node: ENVIRONMENT127110+Ref: #environment127222+Node: FILES128051+Ref: #files-1128154+Node: LIMITATIONS128367+Ref: #limitations128486+Node: TROUBLESHOOTING129228+Ref: #troubleshooting129341 End Tag Table
embeddedfiles/hledger.txt view
@@ -3187,4 +3187,4 @@ -hledger 1.17 March 2020 hledger(1)+hledger 1.17.1 March 2020 hledger(1)
embeddedfiles/hledger_csv.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_csv" "5" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger_csv" "5" "March 2020" "hledger 1.17.0.1" "hledger User Manuals" @@ -487,34 +487,48 @@ \f[C]description\f[R], \f[C]comment\f[R] can be used to form the transaction\[aq]s first line. .SS Posting field names+.SS account .PP-\f[C]accountN\f[R], where N is 1 to 9, generates a posting, with that-account name.+\f[C]accountN\f[R], where N is 1 to 9, causes a posting to be generated,+with that account name.+.PP Most often there are two postings, so you\[aq]ll want to set \f[C]account1\f[R] and \f[C]account2\f[R].-If a posting\[aq]s account name is left unset but its amount is set, a-default account name will be chosen (like expenses:unknown or-income:unknown).+Typically \f[C]account1\f[R] is associated with the CSV file, and is set+once with a top-level assignment, while \f[C]account2\f[R] is set based+on each transaction\[aq]s description, and in conditional blocks. .PP+If a posting\[aq]s account name is left unset but its amount is set (see+below), a default account name will be chosen (like+\[dq]expenses:unknown\[dq] or \[dq]income:unknown\[dq]).+.SS amount+.PP \f[C]amountN\f[R] sets posting N\[aq]s amount.-Or, \f[C]amount\f[R] with no N sets posting 1\[aq]s.-If the CSV has debits and credits in separate fields, use-\f[C]amountN-in\f[R] and \f[C]amountN-out\f[R] instead.-Or \f[C]amount-in\f[R] and \f[C]amount-out\f[R] with no N for posting 1.+If the CSV uses separate fields for debit and credit amounts, you can+use \f[C]amountN-in\f[R] and \f[C]amountN-out\f[R] instead. .PP-For convenience and backwards compatibility, if you set the amount of-posting 1 only, a second posting with the negative amount will be-generated automatically.-(Unless the account name is parenthesised indicating an unbalanced-posting.)+Also, for compatibility with hledger <1.17: \f[C]amount\f[R] or+\f[C]amount-in\f[R]/\f[C]amount-out\f[R] with no number sets the amount+for postings 1 and 2.+For posting 2 the amount is negated, and converted to cost if+there\[aq]s a transaction price.+.SS currency .PP-If the CSV has the currency symbol in a separate field, you can use-\f[C]currencyN\f[R] to prepend it to posting N\[aq]s amount.-\f[C]currency\f[R] with no N affects ALL postings.+If the CSV has the currency symbol in a separate field (ie, not part of+the amount field), you can use \f[C]currencyN\f[R] to prepend it to+posting N\[aq]s amount.+Or, \f[C]currency\f[R] with no number affects all postings.+.SS balance .PP \f[C]balanceN\f[R] sets a balance assertion amount (or if the posting-amount is left empty, a balance assignment).-You may need to adjust this with the \f[C]balance-type\f[R] rule.+amount is left empty, a balance assignment) on posting N.+.PP+Also, for compatibility with hledger <1.17: \f[C]balance\f[R] with no+number is equivalent to \f[C]balance1\f[R].+.PP+You can adjust the type of assertion/assignment with the+\f[C]balance-type\f[R] rule (see below).+.SS comment .PP Finally, \f[C]commentN\f[R] sets a comment on the Nth posting. Comments can also contain tags, as usual.
embeddedfiles/hledger_csv.info view
@@ -3,8 +3,8 @@ File: hledger_csv.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger_csv(5) hledger 1.17-***************************+hledger_csv(5) hledger 1.17.0.1+******************************* CSV - how hledger reads CSV data, and the CSV rules file format @@ -451,31 +451,79 @@ 2.2.2 Posting field names ------------------------- -'accountN', where N is 1 to 9, generates a posting, with that account-name. Most often there are two postings, so you'll want to set-'account1' and 'account2'. If a posting's account name is left unset-but its amount is set, a default account name will be chosen (like-expenses:unknown or income:unknown).+* Menu: - 'amountN' sets posting N's amount. Or, 'amount' with no N sets-posting 1's. If the CSV has debits and credits in separate fields, use-'amountN-in' and 'amountN-out' instead. Or 'amount-in' and 'amount-out'-with no N for posting 1.+* account::+* amount::+* currency::+* balance::+* comment:: - For convenience and backwards compatibility, if you set the amount of-posting 1 only, a second posting with the negative amount will be-generated automatically. (Unless the account name is parenthesised-indicating an unbalanced posting.)++File: hledger_csv.info, Node: account, Next: amount, Up: Posting field names - If the CSV has the currency symbol in a separate field, you can use-'currencyN' to prepend it to posting N's amount. 'currency' with no N-affects ALL postings.+2.2.2.1 account+............... - 'balanceN' sets a balance assertion amount (or if the posting amount-is left empty, a balance assignment). You may need to adjust this with-the 'balance-type' rule.+'accountN', where N is 1 to 9, causes a posting to be generated, with+that account name. - Finally, 'commentN' sets a comment on the Nth posting. Comments can+ Most often there are two postings, so you'll want to set 'account1'+and 'account2'. Typically 'account1' is associated with the CSV file,+and is set once with a top-level assignment, while 'account2' is set+based on each transaction's description, and in conditional blocks.++ If a posting's account name is left unset but its amount is set (see+below), a default account name will be chosen (like "expenses:unknown"+or "income:unknown").+++File: hledger_csv.info, Node: amount, Next: currency, Prev: account, Up: Posting field names++2.2.2.2 amount+..............++'amountN' sets posting N's amount. If the CSV uses separate fields for+debit and credit amounts, you can use 'amountN-in' and 'amountN-out'+instead.++ Also, for compatibility with hledger <1.17: 'amount' or+'amount-in'/'amount-out' with no number sets the amount for postings 1+and 2. For posting 2 the amount is negated, and converted to cost if+there's a transaction price.+++File: hledger_csv.info, Node: currency, Next: balance, Prev: amount, Up: Posting field names++2.2.2.3 currency+................++If the CSV has the currency symbol in a separate field (ie, not part of+the amount field), you can use 'currencyN' to prepend it to posting N's+amount. Or, 'currency' with no number affects all postings.+++File: hledger_csv.info, Node: balance, Next: comment, Prev: currency, Up: Posting field names++2.2.2.4 balance+...............++'balanceN' sets a balance assertion amount (or if the posting amount is+left empty, a balance assignment) on posting N.++ Also, for compatibility with hledger <1.17: 'balance' with no number+is equivalent to 'balance1'.++ You can adjust the type of assertion/assignment with the+'balance-type' rule (see below).+++File: hledger_csv.info, Node: comment, Prev: balance, Up: Posting field names++2.2.2.5 comment+...............++Finally, 'commentN' sets a comment on the Nth posting. Comments can also contain tags, as usual. See TIPS below for more about setting amounts and currency.@@ -971,64 +1019,74 @@ Tag Table: Node: Top72-Node: EXAMPLES2093-Ref: #examples2199-Node: Basic2407-Ref: #basic2507-Node: Bank of Ireland3049-Ref: #bank-of-ireland3184-Node: Amazon4646-Ref: #amazon4764-Node: Paypal6483-Ref: #paypal6577-Node: CSV RULES14221-Ref: #csv-rules14330-Node: skip14606-Ref: #skip14699-Node: fields15074-Ref: #fields15196-Node: Transaction field names16361-Ref: #transaction-field-names16521-Node: Posting field names16632-Ref: #posting-field-names16784-Node: field assignment18075-Ref: #field-assignment18218-Node: separator19036-Ref: #separator19165-Node: if19576-Ref: #if19678-Node: end21597-Ref: #end21703-Node: date-format21927-Ref: #date-format22059-Node: newest-first22808-Ref: #newest-first22946-Node: include23629-Ref: #include23758-Node: balance-type24202-Ref: #balance-type24322-Node: TIPS25022-Ref: #tips25104-Node: Rapid feedback25360-Ref: #rapid-feedback25477-Node: Valid CSV25937-Ref: #valid-csv26067-Node: File Extension26259-Ref: #file-extension26411-Node: Reading multiple CSV files26821-Ref: #reading-multiple-csv-files27006-Node: Valid transactions27247-Ref: #valid-transactions27425-Node: Deduplicating importing28053-Ref: #deduplicating-importing28232-Node: Setting amounts29265-Ref: #setting-amounts29434-Node: Setting currency/commodity30420-Ref: #setting-currencycommodity30612-Node: Referencing other fields31415-Ref: #referencing-other-fields31615-Node: How CSV rules are evaluated32512-Ref: #how-csv-rules-are-evaluated32685+Node: EXAMPLES2101+Ref: #examples2207+Node: Basic2415+Ref: #basic2515+Node: Bank of Ireland3057+Ref: #bank-of-ireland3192+Node: Amazon4654+Ref: #amazon4772+Node: Paypal6491+Ref: #paypal6585+Node: CSV RULES14229+Ref: #csv-rules14338+Node: skip14614+Ref: #skip14707+Node: fields15082+Ref: #fields15204+Node: Transaction field names16369+Ref: #transaction-field-names16529+Node: Posting field names16640+Ref: #posting-field-names16792+Node: account16862+Ref: #account16978+Node: amount17514+Ref: #amount17645+Node: currency18026+Ref: #currency18161+Node: balance18367+Ref: #balance18501+Node: comment18818+Ref: #comment18935+Node: field assignment19098+Ref: #field-assignment19241+Node: separator20059+Ref: #separator20188+Node: if20599+Ref: #if20701+Node: end22620+Ref: #end22726+Node: date-format22950+Ref: #date-format23082+Node: newest-first23831+Ref: #newest-first23969+Node: include24652+Ref: #include24781+Node: balance-type25225+Ref: #balance-type25345+Node: TIPS26045+Ref: #tips26127+Node: Rapid feedback26383+Ref: #rapid-feedback26500+Node: Valid CSV26960+Ref: #valid-csv27090+Node: File Extension27282+Ref: #file-extension27434+Node: Reading multiple CSV files27844+Ref: #reading-multiple-csv-files28029+Node: Valid transactions28270+Ref: #valid-transactions28448+Node: Deduplicating importing29076+Ref: #deduplicating-importing29255+Node: Setting amounts30288+Ref: #setting-amounts30457+Node: Setting currency/commodity31443+Ref: #setting-currencycommodity31635+Node: Referencing other fields32438+Ref: #referencing-other-fields32638+Node: How CSV rules are evaluated33535+Ref: #how-csv-rules-are-evaluated33708 End Tag Table
embeddedfiles/hledger_csv.txt view
@@ -376,30 +376,45 @@ transaction's first line. Posting field names- accountN, where N is 1 to 9, generates a posting, with that account- name. Most often there are two postings, so you'll want to set ac-- count1 and account2. If a posting's account name is left unset but its- amount is set, a default account name will be chosen (like expenses:un-- known or income:unknown).+ account+ accountN, where N is 1 to 9, causes a posting to be generated, with+ that account name. - amountN sets posting N's amount. Or, amount with no N sets posting- 1's. If the CSV has debits and credits in separate fields, use- amountN-in and amountN-out instead. Or amount-in and amount-out with- no N for posting 1.+ Most often there are two postings, so you'll want to set account1 and+ account2. Typically account1 is associated with the CSV file, and is+ set once with a top-level assignment, while account2 is set based on+ each transaction's description, and in conditional blocks. - For convenience and backwards compatibility, if you set the amount of- posting 1 only, a second posting with the negative amount will be gen-- erated automatically. (Unless the account name is parenthesised indi-- cating an unbalanced posting.)+ If a posting's account name is left unset but its amount is set (see+ below), a default account name will be chosen (like "expenses:unknown"+ or "income:unknown"). - If the CSV has the currency symbol in a separate field, you can use- currencyN to prepend it to posting N's amount. currency with no N af-- fects ALL postings.+ amount+ amountN sets posting N's amount. If the CSV uses separate fields for+ debit and credit amounts, you can use amountN-in and amountN-out in-+ stead. - balanceN sets a balance assertion amount (or if the posting amount is- left empty, a balance assignment). You may need to adjust this with- the balance-type rule.+ Also, for compatibility with hledger <1.17: amount or amount-in/amount-+ out with no number sets the amount for postings 1 and 2. For posting 2+ the amount is negated, and converted to cost if there's a transaction+ price. + currency+ If the CSV has the currency symbol in a separate field (ie, not part of+ the amount field), you can use currencyN to prepend it to posting N's+ amount. Or, currency with no number affects all postings.++ balance+ balanceN sets a balance assertion amount (or if the posting amount is+ left empty, a balance assignment) on posting N.++ Also, for compatibility with hledger <1.17: balance with no number is+ equivalent to balance1.++ You can adjust the type of assertion/assignment with the balance-type+ rule (see below).++ comment Finally, commentN sets a comment on the Nth posting. Comments can also contain tags, as usual. @@ -819,4 +834,4 @@ -hledger 1.17 March 2020 hledger_csv(5)+hledger 1.17.0.1 March 2020 hledger_csv(5)
embeddedfiles/hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger_journal" "5" "March 2020" "hledger 1.17.0.1" "hledger User Manuals" @@ -524,7 +524,7 @@ \f[R] .fi .PP-A decimal mark (decimal point) can be written with a period or a comma:+A decimal mark can be written as a period or a comma: .IP .nf \f[C]@@ -1027,6 +1027,16 @@ T}@T{ following inline/included entries until end of current file T}+T{+\f[C]=\f[R]+T}@T{+T}@T{+T}@T{+declare an auto posting rule, adding postings to other transactions+T}@T{+all entries in parent/current/child files (but not sibling files, see+#1212)+T} .TE .PP And some definitions:@@ -1066,13 +1076,21 @@ affect, and whether they are focussed on input (parsing) or output (reports). Some directives have multiple effects.+.SS Directives and multiple files .PP-If you have a journal made up of multiple files, or pass multiple -f-options on the command line, note that directives which affect input-typically last only until the end of their defining file.-This provides more simplicity and predictability, eg reports are not-changed by writing file options in a different order.-It can be surprising at times though.+If you use multiple \f[C]-f\f[R]/\f[C]--file\f[R] options, or the+\f[C]include\f[R] directive, hledger will process multiple input files.+But note that directives which affect input (see above) typically last+only until the end of the file in which they occur.+.PP+This may seem inconvenient, but it\[aq]s intentional; it makes reports+stable and deterministic, independent of the order of input.+Otherwise you could see different numbers if you happened to write -f+options in a different order, or if you moved includes around while+cleaning up your files.+.PP+It can be surprising though; for example, it means that \f[C]alias\f[R]+directives do not affect parent or sibling files (see below). .SS Comment blocks .PP A line containing just \f[C]comment\f[R] starts a commented region of@@ -1543,6 +1561,46 @@ .PP In case of trouble, adding \f[C]--debug=6\f[R] to the command line will show which aliases are being applied when.+.SS Aliases and multiple files+.PP+As explained at Directives and multiple files, \f[C]alias\f[R]+directives do not affect parent or sibling files.+Eg in this command,+.IP+.nf+\f[C]+hledger -f a.aliases -f b.journal+\f[R]+.fi+.PP+account aliases defined in a.aliases will not affect b.journal.+Including the aliases doesn\[aq]t work either:+.IP+.nf+\f[C]+include a.aliases++2020-01-01 ; not affected by a.aliases+ foo 1+ bar+\f[R]+.fi+.PP+This means that account aliases should usually be declared at the start+of your top-most file, like this:+.IP+.nf+\f[C]+alias foo=Foo+alias bar=Bar++2020-01-01 ; affected by aliases above+ foo 1+ bar++include c.journal ; also affected+\f[R]+.fi .SS \f[C]end aliases\f[R] .PP You can clear (forget) all currently defined aliases with the@@ -1759,31 +1817,28 @@ For more details, see: balance: Budget report and Budgeting and Forecasting. .PP-.SS Auto postings / transaction modifiers+.SS Auto postings .PP-Transaction modifier rules, AKA auto posting rules, describe changes to-be applied automatically to certain matched transactions.-Currently just one kind of change is possible - adding extra postings,-which we call \[dq]automated postings\[dq] or just \[dq]auto-postings\[dq].-These rules become active when you use the \f[C]--auto\f[R] flag.+\[dq]Automated postings\[dq] or \[dq]auto postings\[dq] are extra+postings which get added automatically to transactions which match+certain queries, defined by \[dq]auto posting rules\[dq], when you use+the \f[C]--auto\f[R] flag. .PP-A transaction modifier rule looks much like a normal transaction except-the first line is an equals sign followed by a query that matches-certain postings (mnemonic: \f[C]=\f[R] suggests matching).-And each \[dq]posting\[dq] is actually a posting-generating rule:+An auto posting rule looks a bit like a transaction: .IP .nf \f[C] = QUERY ACCOUNT AMOUNT- ACCOUNT [AMOUNT] ...+ ACCOUNT [AMOUNT] \f[R] .fi .PP-These posting-generating rules look like normal postings, except the-amount can be:+except the first line is an equals sign (mnemonic: \f[C]=\f[R] suggests+matching), followed by a query (which matches existing postings), and+each \[dq]posting\[dq] line describes a posting to be generated, and the+posting amounts can be: .IP \[bu] 2 a normal amount with a commodity symbol, eg \f[C]$2\f[R]. This will be used as-is.@@ -1801,7 +1856,7 @@ The matched posting\[aq]s amount will be multiplied by N, and its commodity symbol will be replaced with S. .PP-A query term containing spaces must be enclosed in single or double+Any query term containing spaces must be enclosed in single or double quotes, as on the command line. Eg, note the quotes around the second query term below: .IP@@ -1812,10 +1867,6 @@ \f[R] .fi .PP-These rules have global effect - a rule appearing anywhere in your data-can potentially affect any transaction, including transactions recorded-above it or in another file.-.PP Some examples: .IP .nf@@ -1854,6 +1905,12 @@ assets:checking $20 \f[R] .fi+.SS Auto postings and multiple files+.PP+An auto posting rule can affect any transaction in the current file, or+in any parent file or child file.+Note, currently it will not affect sibling files (when multiple+\f[C]-f\f[R]/\f[C]--file\f[R] are used - see #1212). .SS Auto postings and dates .PP A posting date (or secondary date) in the matched posting, or (taking@@ -1861,7 +1918,7 @@ used in the generated posting. .SS Auto postings and transaction balancing / inferred amounts / balance assertions .PP-Currently, transaction modifiers are applied / auto postings are added:+Currently, auto postings are added: .IP \[bu] 2 after missing amounts are inferred, and transactions are checked for balancedness,@@ -1873,7 +1930,7 @@ This changed in hledger 1.12+; see #893 for background. .SS Auto posting tags .PP-Postings added by transaction modifiers will have some extra tags:+Automated postings will have some extra tags: .IP \[bu] 2 \f[C]generated-posting:= QUERY\f[R] - shows this was generated by an auto posting rule, and the query@@ -1883,8 +1940,8 @@ This can be used to match postings generated \[dq]just now\[dq], rather than generated in the past and saved to the journal. .PP-Also, any transaction that has been changed by transaction modifier-rules will have these tags added:+Also, any transaction that has been changed by auto posting rules will+have these tags added: .IP \[bu] 2 \f[C]modified:\f[R] - this transaction was modified .IP \[bu] 2
embeddedfiles/hledger_journal.info view
@@ -4,8 +4,8 @@ File: hledger_journal.info, Node: Top, Up: (dir) -hledger_journal(5) hledger 1.17-*******************************+hledger_journal(5) hledger 1.17.0.1+*********************************** Journal - hledger's default file format, representing a General Journal @@ -85,7 +85,7 @@ * Balance Assignments:: * Directives:: * Periodic transactions::-* Auto postings / transaction modifiers::+* Auto postings:: File: hledger_journal.info, Node: Dates, Next: Status, Up: Transactions@@ -470,8 +470,7 @@ 1E-6 EUR 1E3 - A decimal mark (decimal point) can be written with a period or a-comma:+ A decimal mark can be written as a period or a comma: 1.23 1,23456780000009@@ -912,6 +911,11 @@ dates inline/included entries until end of current file+'=' declare an auto posting all entries in+ rule, adding postings to parent/current/child+ other transactions files (but not+ sibling files,+ see #1212) And some definitions: @@ -929,15 +933,9 @@ they affect, and whether they are focussed on input (parsing) or output (reports). Some directives have multiple effects. - If you have a journal made up of multiple files, or pass multiple -f-options on the command line, note that directives which affect input-typically last only until the end of their defining file. This provides-more simplicity and predictability, eg reports are not changed by-writing file options in a different order. It can be surprising at-times though.- * Menu: +* Directives and multiple files:: * Comment blocks:: * Including other files:: * Default year::@@ -949,9 +947,29 @@ * Default parent account:: -File: hledger_journal.info, Node: Comment blocks, Next: Including other files, Up: Directives+File: hledger_journal.info, Node: Directives and multiple files, Next: Comment blocks, Up: Directives -1.12.1 Comment blocks+1.12.1 Directives and multiple files+------------------------------------++If you use multiple '-f'/'--file' options, or the 'include' directive,+hledger will process multiple input files. But note that directives+which affect input (see above) typically last only until the end of the+file in which they occur.++ This may seem inconvenient, but it's intentional; it makes reports+stable and deterministic, independent of the order of input. Otherwise+you could see different numbers if you happened to write -f options in a+different order, or if you moved includes around while cleaning up your+files.++ It can be surprising though; for example, it means that 'alias'+directives do not affect parent or sibling files (see below).+++File: hledger_journal.info, Node: Comment blocks, Next: Including other files, Prev: Directives and multiple files, Up: Directives++1.12.2 Comment blocks --------------------- A line containing just 'comment' starts a commented region of the file,@@ -961,7 +979,7 @@ File: hledger_journal.info, Node: Including other files, Next: Default year, Prev: Comment blocks, Up: Directives -1.12.2 Including other files+1.12.3 Including other files ---------------------------- You can pull in the content of additional files by writing an include@@ -979,7 +997,7 @@ File: hledger_journal.info, Node: Default year, Next: Declaring commodities, Prev: Including other files, Up: Directives -1.12.3 Default year+1.12.4 Default year ------------------- You can set a default year to be used for subsequent dates which don't@@ -1005,7 +1023,7 @@ File: hledger_journal.info, Node: Declaring commodities, Next: Default commodity, Prev: Default year, Up: Directives -1.12.4 Declaring commodities+1.12.5 Declaring commodities ---------------------------- The 'commodity' directive has several functions:@@ -1055,7 +1073,7 @@ File: hledger_journal.info, Node: Default commodity, Next: Market prices, Prev: Declaring commodities, Up: Directives -1.12.5 Default commodity+1.12.6 Default commodity ------------------------ The 'D' directive sets a default commodity, to be used for amounts@@ -1082,7 +1100,7 @@ File: hledger_journal.info, Node: Market prices, Next: Declaring accounts, Prev: Default commodity, Up: Directives -1.12.6 Market prices+1.12.7 Market prices -------------------- The 'P' directive declares a market price, which is an exchange rate@@ -1112,7 +1130,7 @@ File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Market prices, Up: Directives -1.12.7 Declaring accounts+1.12.8 Declaring accounts ------------------------- 'account' directives can be used to pre-declare accounts. Though not@@ -1145,7 +1163,7 @@ File: hledger_journal.info, Node: Account comments, Next: Account subdirectives, Up: Declaring accounts -1.12.7.1 Account comments+1.12.8.1 Account comments ......................... Comments, beginning with a semicolon, can be added:@@ -1165,7 +1183,7 @@ File: hledger_journal.info, Node: Account subdirectives, Next: Account types, Prev: Account comments, Up: Declaring accounts -1.12.7.2 Account subdirectives+1.12.8.2 Account subdirectives .............................. We also allow (and ignore) Ledger-style indented subdirectives, just for@@ -1183,7 +1201,7 @@ File: hledger_journal.info, Node: Account types, Next: Account display order, Prev: Account subdirectives, Up: Declaring accounts -1.12.7.3 Account types+1.12.8.3 Account types ...................... hledger recognises five types (or classes) of account: Asset, Liability,@@ -1228,7 +1246,7 @@ File: hledger_journal.info, Node: Account display order, Prev: Account types, Up: Declaring accounts -1.12.7.4 Account display order+1.12.8.4 Account display order .............................. Account directives also set the order in which accounts are displayed,@@ -1274,7 +1292,7 @@ File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Declaring accounts, Up: Directives -1.12.8 Rewriting accounts+1.12.9 Rewriting accounts ------------------------- You can define account alias rules which rewrite your account names, or@@ -1298,12 +1316,13 @@ * Basic aliases:: * Regex aliases:: * Combining aliases::+* Aliases and multiple files:: * end aliases:: File: hledger_journal.info, Node: Basic aliases, Next: Regex aliases, Up: Rewriting accounts -1.12.8.1 Basic aliases+1.12.9.1 Basic aliases ...................... To set an account alias, use the 'alias' directive in your journal file.@@ -1326,7 +1345,7 @@ File: hledger_journal.info, Node: Regex aliases, Next: Combining aliases, Prev: Basic aliases, Up: Rewriting accounts -1.12.8.2 Regex aliases+1.12.9.2 Regex aliases ...................... There is also a more powerful variant that uses a regular expression,@@ -1349,9 +1368,9 @@ whitespace. -File: hledger_journal.info, Node: Combining aliases, Next: end aliases, Prev: Regex aliases, Up: Rewriting accounts+File: hledger_journal.info, Node: Combining aliases, Next: Aliases and multiple files, Prev: Regex aliases, Up: Rewriting accounts -1.12.8.3 Combining aliases+1.12.9.3 Combining aliases .......................... You can define as many aliases as you like, using journal directives@@ -1386,9 +1405,41 @@ which aliases are being applied when. -File: hledger_journal.info, Node: end aliases, Prev: Combining aliases, Up: Rewriting accounts+File: hledger_journal.info, Node: Aliases and multiple files, Next: end aliases, Prev: Combining aliases, Up: Rewriting accounts -1.12.8.4 'end aliases'+1.12.9.4 Aliases and multiple files+...................................++As explained at Directives and multiple files, 'alias' directives do not+affect parent or sibling files. Eg in this command,++hledger -f a.aliases -f b.journal++ account aliases defined in a.aliases will not affect b.journal.+Including the aliases doesn't work either:++include a.aliases++2020-01-01 ; not affected by a.aliases+ foo 1+ bar++ This means that account aliases should usually be declared at the+start of your top-most file, like this:++alias foo=Foo+alias bar=Bar++2020-01-01 ; affected by aliases above+ foo 1+ bar++include c.journal ; also affected+++File: hledger_journal.info, Node: end aliases, Prev: Aliases and multiple files, Up: Rewriting accounts++1.12.9.5 'end aliases' ...................... You can clear (forget) all currently defined aliases with the 'end@@ -1399,8 +1450,8 @@ File: hledger_journal.info, Node: Default parent account, Prev: Rewriting accounts, Up: Directives -1.12.9 Default parent account------------------------------+1.12.10 Default parent account+------------------------------ You can specify a parent account which will be prepended to all accounts within a section of the journal. Use the 'apply account' and 'end apply@@ -1438,7 +1489,7 @@ parent account. -File: hledger_journal.info, Node: Periodic transactions, Next: Auto postings / transaction modifiers, Prev: Directives, Up: Transactions+File: hledger_journal.info, Node: Periodic transactions, Next: Auto postings, Prev: Directives, Up: Transactions 1.13 Periodic transactions ==========================@@ -1600,29 +1651,26 @@ Forecasting. -File: hledger_journal.info, Node: Auto postings / transaction modifiers, Prev: Periodic transactions, Up: Transactions+File: hledger_journal.info, Node: Auto postings, Prev: Periodic transactions, Up: Transactions -1.14 Auto postings / transaction modifiers-==========================================+1.14 Auto postings+================== -Transaction modifier rules, AKA auto posting rules, describe changes to-be applied automatically to certain matched transactions. Currently-just one kind of change is possible - adding extra postings, which we-call "automated postings" or just "auto postings". These rules become-active when you use the '--auto' flag.+"Automated postings" or "auto postings" are extra postings which get+added automatically to transactions which match certain queries, defined+by "auto posting rules", when you use the '--auto' flag. - A transaction modifier rule looks much like a normal transaction-except the first line is an equals sign followed by a query that matches-certain postings (mnemonic: '=' suggests matching). And each "posting"-is actually a posting-generating rule:+ An auto posting rule looks a bit like a transaction: = QUERY ACCOUNT AMOUNT- ACCOUNT [AMOUNT] ...+ ACCOUNT [AMOUNT] - These posting-generating rules look like normal postings, except the-amount can be:+ except the first line is an equals sign (mnemonic: '=' suggests+matching), followed by a query (which matches existing postings), and+each "posting" line describes a posting to be generated, and the posting+amounts can be: * a normal amount with a commodity symbol, eg '$2'. This will be used as-is.@@ -1635,17 +1683,13 @@ and symbol S). The matched posting's amount will be multiplied by N, and its commodity symbol will be replaced with S. - A query term containing spaces must be enclosed in single or double+ Any query term containing spaces must be enclosed in single or double quotes, as on the command line. Eg, note the quotes around the second query term below: = expenses:groceries 'expenses:dining out' (budget:funds:dining out) *-1 - These rules have global effect - a rule appearing anywhere in your-data can potentially affect any transaction, including transactions-recorded above it or in another file.- Some examples: ; every time I buy food, schedule a dollar donation@@ -1679,14 +1723,25 @@ * Menu: +* Auto postings and multiple files:: * Auto postings and dates:: * Auto postings and transaction balancing / inferred amounts / balance assertions:: * Auto posting tags:: -File: hledger_journal.info, Node: Auto postings and dates, Next: Auto postings and transaction balancing / inferred amounts / balance assertions, Up: Auto postings / transaction modifiers+File: hledger_journal.info, Node: Auto postings and multiple files, Next: Auto postings and dates, Up: Auto postings -1.14.1 Auto postings and dates+1.14.1 Auto postings and multiple files+---------------------------------------++An auto posting rule can affect any transaction in the current file, or+in any parent file or child file. Note, currently it will not affect+sibling files (when multiple '-f'/'--file' are used - see #1212).+++File: hledger_journal.info, Node: Auto postings and dates, Next: Auto postings and transaction balancing / inferred amounts / balance assertions, Prev: Auto postings and multiple files, Up: Auto postings++1.14.2 Auto postings and dates ------------------------------ A posting date (or secondary date) in the matched posting, or (taking@@ -1694,13 +1749,12 @@ used in the generated posting. -File: hledger_journal.info, Node: Auto postings and transaction balancing / inferred amounts / balance assertions, Next: Auto posting tags, Prev: Auto postings and dates, Up: Auto postings / transaction modifiers+File: hledger_journal.info, Node: Auto postings and transaction balancing / inferred amounts / balance assertions, Next: Auto posting tags, Prev: Auto postings and dates, Up: Auto postings -1.14.2 Auto postings and transaction balancing / inferred amounts /+1.14.3 Auto postings and transaction balancing / inferred amounts / ------------------------------------------------------------------- -balance assertions Currently, transaction modifiers are applied / auto-postings are added:+balance assertions Currently, auto postings are added: * after missing amounts are inferred, and transactions are checked for balancedness,@@ -1711,12 +1765,12 @@ for background. -File: hledger_journal.info, Node: Auto posting tags, Prev: Auto postings and transaction balancing / inferred amounts / balance assertions, Up: Auto postings / transaction modifiers+File: hledger_journal.info, Node: Auto posting tags, Prev: Auto postings and transaction balancing / inferred amounts / balance assertions, Up: Auto postings -1.14.3 Auto posting tags+1.14.4 Auto posting tags ------------------------ -Postings added by transaction modifiers will have some extra tags:+Automated postings will have some extra tags: * 'generated-posting:= QUERY' - shows this was generated by an auto posting rule, and the query@@ -1725,8 +1779,8 @@ "just now", rather than generated in the past and saved to the journal. - Also, any transaction that has been changed by transaction modifier-rules will have these tags added:+ Also, any transaction that has been changed by auto posting rules+will have these tags added: * 'modified:' - this transaction was modified * '_modified:' - a hidden tag not appearing in the comment; this@@ -1735,116 +1789,122 @@ Tag Table: Node: Top76-Node: Transactions1869-Ref: #transactions1961-Node: Dates3150-Ref: #dates3249-Node: Simple dates3314-Ref: #simple-dates3440-Node: Secondary dates3949-Ref: #secondary-dates4103-Node: Posting dates5439-Ref: #posting-dates5568-Node: Status6940-Ref: #status7061-Node: Description8769-Ref: #description8903-Node: Payee and note9223-Ref: #payee-and-note9337-Node: Comments9672-Ref: #comments9798-Node: Tags10992-Ref: #tags11107-Node: Postings12500-Ref: #postings12628-Node: Virtual Postings13654-Ref: #virtual-postings13771-Node: Account names15076-Ref: #account-names15217-Node: Amounts15704-Ref: #amounts15843-Node: Digit group marks16775-Ref: #digit-group-marks16923-Node: Amount display style17861-Ref: #amount-display-style18015-Node: Transaction prices19176-Ref: #transaction-prices19342-Node: Balance Assertions21608-Ref: #balance-assertions21788-Node: Assertions and ordering22821-Ref: #assertions-and-ordering23009-Node: Assertions and included files23709-Ref: #assertions-and-included-files23952-Node: Assertions and multiple -f options24285-Ref: #assertions-and-multiple--f-options24541-Node: Assertions and commodities24673-Ref: #assertions-and-commodities24905-Node: Assertions and prices26062-Ref: #assertions-and-prices26276-Node: Assertions and subaccounts26716-Ref: #assertions-and-subaccounts26945-Node: Assertions and virtual postings27269-Ref: #assertions-and-virtual-postings27511-Node: Assertions and precision27653-Ref: #assertions-and-precision27846-Node: Balance Assignments28113-Ref: #balance-assignments28287-Node: Balance assignments and prices29451-Ref: #balance-assignments-and-prices29623-Node: Directives29847-Ref: #directives30006-Node: Comment blocks35654-Ref: #comment-blocks35799-Node: Including other files35975-Ref: #including-other-files36155-Node: Default year36563-Ref: #default-year36732-Node: Declaring commodities37139-Ref: #declaring-commodities37322-Node: Default commodity38995-Ref: #default-commodity39171-Node: Market prices40060-Ref: #market-prices40225-Node: Declaring accounts41066-Ref: #declaring-accounts41242-Node: Account comments42167-Ref: #account-comments42330-Node: Account subdirectives42754-Ref: #account-subdirectives42949-Node: Account types43262-Ref: #account-types43446-Node: Account display order45085-Ref: #account-display-order45255-Node: Rewriting accounts46406-Ref: #rewriting-accounts46591-Node: Basic aliases47317-Ref: #basic-aliases47463-Node: Regex aliases48167-Ref: #regex-aliases48339-Node: Combining aliases49057-Ref: #combining-aliases49235-Node: end aliases50511-Ref: #end-aliases50659-Node: Default parent account50760-Ref: #default-parent-account50926-Node: Periodic transactions51810-Ref: #periodic-transactions52009-Node: Periodic rule syntax53881-Ref: #periodic-rule-syntax54087-Node: Two spaces between period expression and description!54791-Ref: #two-spaces-between-period-expression-and-description55110-Node: Forecasting with periodic transactions55794-Ref: #forecasting-with-periodic-transactions56099-Node: Budgeting with periodic transactions58125-Ref: #budgeting-with-periodic-transactions58364-Node: Auto postings / transaction modifiers58813-Ref: #auto-postings-transaction-modifiers59025-Node: Auto postings and dates61521-Ref: #auto-postings-and-dates61778-Node: Auto postings and transaction balancing / inferred amounts / balance assertions61953-Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions62328-Node: Auto posting tags62706-Ref: #auto-posting-tags62945+Node: Transactions1877+Ref: #transactions1969+Node: Dates3134+Ref: #dates3233+Node: Simple dates3298+Ref: #simple-dates3424+Node: Secondary dates3933+Ref: #secondary-dates4087+Node: Posting dates5423+Ref: #posting-dates5552+Node: Status6924+Ref: #status7045+Node: Description8753+Ref: #description8887+Node: Payee and note9207+Ref: #payee-and-note9321+Node: Comments9656+Ref: #comments9782+Node: Tags10976+Ref: #tags11091+Node: Postings12484+Ref: #postings12612+Node: Virtual Postings13638+Ref: #virtual-postings13755+Node: Account names15060+Ref: #account-names15201+Node: Amounts15688+Ref: #amounts15827+Node: Digit group marks16741+Ref: #digit-group-marks16889+Node: Amount display style17827+Ref: #amount-display-style17981+Node: Transaction prices19142+Ref: #transaction-prices19308+Node: Balance Assertions21574+Ref: #balance-assertions21754+Node: Assertions and ordering22787+Ref: #assertions-and-ordering22975+Node: Assertions and included files23675+Ref: #assertions-and-included-files23918+Node: Assertions and multiple -f options24251+Ref: #assertions-and-multiple--f-options24507+Node: Assertions and commodities24639+Ref: #assertions-and-commodities24871+Node: Assertions and prices26028+Ref: #assertions-and-prices26242+Node: Assertions and subaccounts26682+Ref: #assertions-and-subaccounts26911+Node: Assertions and virtual postings27235+Ref: #assertions-and-virtual-postings27477+Node: Assertions and precision27619+Ref: #assertions-and-precision27812+Node: Balance Assignments28079+Ref: #balance-assignments28253+Node: Balance assignments and prices29417+Ref: #balance-assignments-and-prices29589+Node: Directives29813+Ref: #directives29972+Node: Directives and multiple files35653+Ref: #directives-and-multiple-files35836+Node: Comment blocks36500+Ref: #comment-blocks36683+Node: Including other files36859+Ref: #including-other-files37039+Node: Default year37447+Ref: #default-year37616+Node: Declaring commodities38023+Ref: #declaring-commodities38206+Node: Default commodity39879+Ref: #default-commodity40055+Node: Market prices40944+Ref: #market-prices41109+Node: Declaring accounts41950+Ref: #declaring-accounts42126+Node: Account comments43051+Ref: #account-comments43214+Node: Account subdirectives43638+Ref: #account-subdirectives43833+Node: Account types44146+Ref: #account-types44330+Node: Account display order45969+Ref: #account-display-order46139+Node: Rewriting accounts47290+Ref: #rewriting-accounts47475+Node: Basic aliases48232+Ref: #basic-aliases48378+Node: Regex aliases49082+Ref: #regex-aliases49254+Node: Combining aliases49972+Ref: #combining-aliases50165+Node: Aliases and multiple files51441+Ref: #aliases-and-multiple-files51650+Node: end aliases52229+Ref: #end-aliases52386+Node: Default parent account52487+Ref: #default-parent-account52655+Node: Periodic transactions53539+Ref: #periodic-transactions53714+Node: Periodic rule syntax55586+Ref: #periodic-rule-syntax55792+Node: Two spaces between period expression and description!56496+Ref: #two-spaces-between-period-expression-and-description56815+Node: Forecasting with periodic transactions57499+Ref: #forecasting-with-periodic-transactions57804+Node: Budgeting with periodic transactions59830+Ref: #budgeting-with-periodic-transactions60069+Node: Auto postings60518+Ref: #auto-postings60658+Node: Auto postings and multiple files62837+Ref: #auto-postings-and-multiple-files63041+Node: Auto postings and dates63250+Ref: #auto-postings-and-dates63524+Node: Auto postings and transaction balancing / inferred amounts / balance assertions63699+Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions64050+Node: Auto posting tags64392+Ref: #auto-posting-tags64607 End Tag Table
embeddedfiles/hledger_journal.txt view
@@ -370,7 +370,7 @@ 1E-6 EUR 1E3 - A decimal mark (decimal point) can be written with a period or a comma:+ A decimal mark can be written as a period or a comma: 1.23 1,23456780000009@@ -709,6 +709,11 @@ dates line/included en- tries until end of current file+ = declare an auto posting all entries in par-+ rule, adding postings to ent/current/child+ other transactions files (but not sib-+ ling files, see+ #1212) And some definitions: @@ -718,12 +723,10 @@ number how to interpret numbers when parsing journal entries (the iden- nota- tity of the decimal separator character). (Currently each com- tion modity can have its own notation, even in the same file.)+ dis- how to display amounts of a commodity in reports (symbol side play and spacing, digit groups, decimal separator, decimal places) style--- direc- which entries and (when there are multiple files) which files tive are affected by a directive scope@@ -732,34 +735,42 @@ affect, and whether they are focussed on input (parsing) or output (re- ports). Some directives have multiple effects. - If you have a journal made up of multiple files, or pass multiple -f- options on the command line, note that directives which affect input- typically last only until the end of their defining file. This pro-- vides more simplicity and predictability, eg reports are not changed by- writing file options in a different order. It can be surprising at- times though.+ Directives and multiple files+ If you use multiple -f/--file options, or the include directive,+ hledger will process multiple input files. But note that directives+ which affect input (see above) typically last only until the end of the+ file in which they occur. + This may seem inconvenient, but it's intentional; it makes reports sta-+ ble and deterministic, independent of the order of input. Otherwise+ you could see different numbers if you happened to write -f options in+ a different order, or if you moved includes around while cleaning up+ your files.++ It can be surprising though; for example, it means that alias direc-+ tives do not affect parent or sibling files (see below).+ Comment blocks- A line containing just comment starts a commented region of the file,+ A line containing just comment starts a commented region of the file, and a line containing just end comment (or the end of the current file) ends it. See also comments. Including other files- You can pull in the content of additional files by writing an include+ You can pull in the content of additional files by writing an include directive, like this: include path/to/file.journal - If the path does not begin with a slash, it is relative to the current- file. The include file path may contain common glob patterns (e.g.+ If the path does not begin with a slash, it is relative to the current+ file. The include file path may contain common glob patterns (e.g. *). - The include directive can only be used in journal files. It can in-+ The include directive can only be used in journal files. It can in- clude journal, timeclock or timedot files, but not CSV files. Default year- You can set a default year to be used for subsequent dates which don't- specify a year. This is a line beginning with Y followed by the year.+ You can set a default year to be used for subsequent dates which don't+ specify a year. This is a line beginning with Y followed by the year. Eg: Y2009 ; set default year to 2009@@ -781,19 +792,19 @@ Declaring commodities The commodity directive has several functions: - 1. It declares commodities which may be used in the journal. This is+ 1. It declares commodities which may be used in the journal. This is currently not enforced, but can serve as documentation. - 2. It declares what decimal mark character (period or comma) to expect- when parsing input - useful to disambiguate international number- formats in your data. (Without this, hledger will parse both 1,000+ 2. It declares what decimal mark character (period or comma) to expect+ when parsing input - useful to disambiguate international number+ formats in your data. (Without this, hledger will parse both 1,000 and 1.000 as 1). - 3. It declares the amount display style to use in output - decimal and+ 3. It declares the amount display style to use in output - decimal and digit group marks, number of decimal places, symbol placement etc. - You are likely to run into one of the problems solved by commodity di-- rectives, sooner or later, so it's a good idea to just always use them+ You are likely to run into one of the problems solved by commodity di-+ rectives, sooner or later, so it's a good idea to just always use them to declare your commodities. A commodity directive is just the word commodity followed by an amount.@@ -806,8 +817,8 @@ ; separating thousands with comma. commodity 1,000.0000 AAAA - or on multiple lines, using the "format" subdirective. (In this case- the commodity symbol appears twice and should be the same in both+ or on multiple lines, using the "format" subdirective. (In this case+ the commodity symbol appears twice and should be the same in both places.): ; commodity SYMBOL@@ -820,19 +831,19 @@ format INR 1,00,00,000.00 The quantity of the amount does not matter; only the format is signifi-- cant. The number must include a decimal mark: either a period or a+ cant. The number must include a decimal mark: either a period or a comma, followed by 0 or more decimal digits. Default commodity- The D directive sets a default commodity, to be used for amounts with-+ The D directive sets a default commodity, to be used for amounts with- out a commodity symbol (ie, plain numbers). This commodity will be ap- plied to all subsequent commodity-less amounts, or until the next D di- rective. (Note, this is different from Ledger's D.) - For compatibility/historical reasons, D also acts like a commodity di-+ For compatibility/historical reasons, D also acts like a commodity di- rective, setting the commodity's display style (for output) and decimal mark (for parsing input). As with commodity, the amount must always be- written with a decimal mark (period or comma). If both directives are+ written with a decimal mark (period or comma). If both directives are used, commodity's style takes precedence. The syntax is D AMOUNT. Eg:@@ -846,9 +857,9 @@ b Market prices- The P directive declares a market price, which is an exchange rate be-- tween two commodities on a certain date. (In Ledger, they are called- "historical prices".) These are often obtained from a stock exchange,+ The P directive declares a market price, which is an exchange rate be-+ tween two commodities on a certain date. (In Ledger, they are called+ "historical prices".) These are often obtained from a stock exchange, cryptocurrency exchange, or the foreign exchange market. Here is the format:@@ -859,16 +870,16 @@ o COMMODITYA is the symbol of the commodity being priced - o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com-+ o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com- modity, giving the price in commodity B of one unit of commodity A. - These two market price directives say that one euro was worth 1.35 US+ These two market price directives say that one euro was worth 1.35 US dollars during 2009, and $1.40 from 2010 onward: P 2009/1/1 EUR $1.35 P 2010/1/1 EUR $1.40 - The -V/--value flag can be used to convert reported amounts to another+ The -V/--value flag can be used to convert reported amounts to another commodity using these prices. Declaring accounts@@ -878,20 +889,20 @@ o They can document your intended chart of accounts, providing a refer- ence. - o They can store extra information about accounts (account numbers,+ o They can store extra information about accounts (account numbers, notes, etc.) - o They can help hledger know your accounts' types (asset, liability,- equity, revenue, expense), useful for reports like balancesheet and+ o They can help hledger know your accounts' types (asset, liability,+ equity, revenue, expense), useful for reports like balancesheet and incomestatement. - o They control account display order in reports, allowing non-alpha-+ o They control account display order in reports, allowing non-alpha- betic sorting (eg Revenues to appear above Expenses). - o They help with account name completion in the add command, hledger-+ o They help with account name completion in the add command, hledger- iadd, hledger-web, ledger-mode etc. - The simplest form is just the word account followed by a hledger-style+ The simplest form is just the word account followed by a hledger-style account name, eg: account assets:bank:checking@@ -899,7 +910,7 @@ Account comments Comments, beginning with a semicolon, can be added: - o on the same line, after two or more spaces (because ; is allowed in+ o on the same line, after two or more spaces (because ; is allowed in account names) o on the next lines, indented@@ -913,7 +924,7 @@ Same-line comments are not supported by Ledger, or hledger <1.13. Account subdirectives- We also allow (and ignore) Ledger-style indented subdirectives, just+ We also allow (and ignore) Ledger-style indented subdirectives, just for compatibility.: account assets:bank:checking@@ -926,18 +937,18 @@ [LEDGER-STYLE SUBDIRECTIVES, IGNORED] Account types- hledger recognises five types (or classes) of account: Asset, Liabil-- ity, Equity, Revenue, Expense. This is used by a few accounting-aware+ hledger recognises five types (or classes) of account: Asset, Liabil-+ ity, Equity, Revenue, Expense. This is used by a few accounting-aware reports such as balancesheet, incomestatement and cashflow. Auto-detected account types If you name your top-level accounts with some variation of assets, lia-- bilities/debts, equity, revenues/income, or expenses, their types are+ bilities/debts, equity, revenues/income, or expenses, their types are detected automatically. Account types declared with tags- More generally, you can declare an account's type with an account di-- rective, by writing a type: tag in a comment, followed by one of the+ More generally, you can declare an account's type with an account di-+ rective, by writing a type: tag in a comment, followed by one of the words Asset, Liability, Equity, Revenue, Expense, or one of the letters ALERX (case insensitive): @@ -948,8 +959,8 @@ account expenses ; type:Expense Account types declared with account type codes- Or, you can write one of those letters separated from the account name- by two or more spaces, but this should probably be considered depre-+ Or, you can write one of those letters separated from the account name+ by two or more spaces, but this should probably be considered depre- cated as of hledger 1.13: account assets A@@ -959,7 +970,7 @@ account expenses X Overriding auto-detected types- If you ever override the types of those auto-detected english account+ If you ever override the types of those auto-detected english account names mentioned above, you might need to help the reports a bit. Eg: ; make "liabilities" not have the liability type - who knows why@@ -970,8 +981,8 @@ account - ; type:L Account display order- Account directives also set the order in which accounts are displayed,- eg in reports, the hledger-ui accounts screen, and the hledger-web+ Account directives also set the order in which accounts are displayed,+ eg in reports, the hledger-ui accounts screen, and the hledger-web sidebar. By default accounts are listed in alphabetical order. But if you have these account directives in the journal: @@ -993,20 +1004,20 @@ Undeclared accounts, if any, are displayed last, in alphabetical order. - Note that sorting is done at each level of the account tree (within- each group of sibling accounts under the same parent). And currently,+ Note that sorting is done at each level of the account tree (within+ each group of sibling accounts under the same parent). And currently, this directive: account other:zoo - would influence the position of zoo among other's subaccounts, but not+ would influence the position of zoo among other's subaccounts, but not the position of other among the top-level accounts. This means: - o you will sometimes declare parent accounts (eg account other above)+ o you will sometimes declare parent accounts (eg account other above) that you don't intend to post to, just to customize their display or- der - o sibling accounts stay together (you couldn't display x:y in between+ o sibling accounts stay together (you couldn't display x:y in between a:b and a:c). Rewriting accounts@@ -1024,14 +1035,14 @@ o customising reports Account aliases also rewrite account names in account directives. They- do not affect account names being entered via hledger add or hledger-+ do not affect account names being entered via hledger add or hledger- web. See also Rewrite account names. Basic aliases- To set an account alias, use the alias directive in your journal file.- This affects all subsequent journal entries in the current file or its+ To set an account alias, use the alias directive in your journal file.+ This affects all subsequent journal entries in the current file or its included files. The spaces around the = are optional: alias OLD = NEW@@ -1039,49 +1050,49 @@ Or, you can use the --alias 'OLD=NEW' option on the command line. This affects all entries. It's useful for trying out aliases interactively. - OLD and NEW are case sensitive full account names. hledger will re-- place any occurrence of the old account name with the new one. Subac-+ OLD and NEW are case sensitive full account names. hledger will re-+ place any occurrence of the old account name with the new one. Subac- counts are also affected. Eg: alias checking = assets:bank:wells fargo:checking ; rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a" Regex aliases- There is also a more powerful variant that uses a regular expression,+ There is also a more powerful variant that uses a regular expression, indicated by the forward slashes: alias /REGEX/ = REPLACEMENT or --alias '/REGEX/=REPLACEMENT'. - REGEX is a case-insensitive regular expression. Anywhere it matches- inside an account name, the matched part will be replaced by REPLACE-- MENT. If REGEX contains parenthesised match groups, these can be ref-+ REGEX is a case-insensitive regular expression. Anywhere it matches+ inside an account name, the matched part will be replaced by REPLACE-+ MENT. If REGEX contains parenthesised match groups, these can be ref- erenced by the usual numeric backreferences in REPLACEMENT. Eg: alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 ; rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking" - Also note that REPLACEMENT continues to the end of line (or on command- line, to end of option argument), so it can contain trailing white-+ Also note that REPLACEMENT continues to the end of line (or on command+ line, to end of option argument), so it can contain trailing white- space. Combining aliases- You can define as many aliases as you like, using journal directives+ You can define as many aliases as you like, using journal directives and/or command line options. - Recursive aliases - where an account name is rewritten by one alias,- then by another alias, and so on - are allowed. Each alias sees the+ Recursive aliases - where an account name is rewritten by one alias,+ then by another alias, and so on - are allowed. Each alias sees the effect of previously applied aliases. - In such cases it can be important to understand which aliases will be- applied and in which order. For (each account name in) each journal+ In such cases it can be important to understand which aliases will be+ applied and in which order. For (each account name in) each journal entry, we apply: - 1. alias directives preceding the journal entry, most recently parsed+ 1. alias directives preceding the journal entry, most recently parsed first (ie, reading upward from the journal entry, bottom to top) - 2. --alias options, in the order they appeared on the command line+ 2. --alias options, in the order they appeared on the command line (left to right). In other words, for (an account name in) a given journal entry:@@ -1092,13 +1103,40 @@ o aliases defined after/below the entry do not affect it. - This gives nearby aliases precedence over distant ones, and helps pro-- vide semantic stability - aliases will keep working the same way inde-+ This gives nearby aliases precedence over distant ones, and helps pro-+ vide semantic stability - aliases will keep working the same way inde- pendent of which files are being read and in which order. - In case of trouble, adding --debug=6 to the command line will show+ In case of trouble, adding --debug=6 to the command line will show which aliases are being applied when. + Aliases and multiple files+ As explained at Directives and multiple files, alias directives do not+ affect parent or sibling files. Eg in this command,++ hledger -f a.aliases -f b.journal++ account aliases defined in a.aliases will not affect b.journal. In-+ cluding the aliases doesn't work either:++ include a.aliases++ 2020-01-01 ; not affected by a.aliases+ foo 1+ bar++ This means that account aliases should usually be declared at the start+ of your top-most file, like this:++ alias foo=Foo+ alias bar=Bar++ 2020-01-01 ; affected by aliases above+ foo 1+ bar++ include c.journal ; also affected+ end aliases You can clear (forget) all currently defined aliases with the end aliases directive:@@ -1278,51 +1316,44 @@ For more details, see: balance: Budget report and Budgeting and Fore- casting. - Auto postings / transaction modifiers- Transaction modifier rules, AKA auto posting rules, describe changes to- be applied automatically to certain matched transactions. Currently- just one kind of change is possible - adding extra postings, which we- call "automated postings" or just "auto postings". These rules become- active when you use the --auto flag.+ Auto postings+ "Automated postings" or "auto postings" are extra postings which get+ added automatically to transactions which match certain queries, de-+ fined by "auto posting rules", when you use the --auto flag. - A transaction modifier rule looks much like a normal transaction except- the first line is an equals sign followed by a query that matches cer-- tain postings (mnemonic: = suggests matching). And each "posting" is- actually a posting-generating rule:+ An auto posting rule looks a bit like a transaction: = QUERY ACCOUNT AMOUNT- ACCOUNT [AMOUNT] ...+ ACCOUNT [AMOUNT] - These posting-generating rules look like normal postings, except the- amount can be:+ except the first line is an equals sign (mnemonic: = suggests match-+ ing), followed by a query (which matches existing postings), and each+ "posting" line describes a posting to be generated, and the posting+ amounts can be: - o a normal amount with a commodity symbol, eg $2. This will be used+ o a normal amount with a commodity symbol, eg $2. This will be used as-is. o a number, eg 2. The commodity symbol (if any) from the matched post- ing will be added to this. - o a numeric multiplier, eg *2 (a star followed by a number N). The+ o a numeric multiplier, eg *2 (a star followed by a number N). The matched posting's amount (and total price, if any) will be multiplied by N. - o a multiplier with a commodity symbol, eg *$2 (a star, number N, and+ o a multiplier with a commodity symbol, eg *$2 (a star, number N, and symbol S). The matched posting's amount will be multiplied by N, and its commodity symbol will be replaced with S. - A query term containing spaces must be enclosed in single or double- quotes, as on the command line. Eg, note the quotes around the second+ Any query term containing spaces must be enclosed in single or double+ quotes, as on the command line. Eg, note the quotes around the second query term below: = expenses:groceries 'expenses:dining out' (budget:funds:dining out) *-1 - These rules have global effect - a rule appearing anywhere in your data- can potentially affect any transaction, including transactions recorded- above it or in another file.- Some examples: ; every time I buy food, schedule a dollar donation@@ -1354,36 +1385,41 @@ assets:checking:gifts -$20 assets:checking $20 + Auto postings and multiple files+ An auto posting rule can affect any transaction in the current file, or+ in any parent file or child file. Note, currently it will not affect+ sibling files (when multiple -f/--file are used - see #1212).+ Auto postings and dates- A posting date (or secondary date) in the matched posting, or (taking- precedence) a posting date in the auto posting rule itself, will also+ A posting date (or secondary date) in the matched posting, or (taking+ precedence) a posting date in the auto posting rule itself, will also be used in the generated posting. Auto postings and transaction balancing / inferred amounts / balance asser- tions- Currently, transaction modifiers are applied / auto postings are added:+ Currently, auto postings are added: - o after missing amounts are inferred, and transactions are checked for+ o after missing amounts are inferred, and transactions are checked for balancedness, o but before balance assertions are checked. - Note this means that journal entries must be balanced both before and+ Note this means that journal entries must be balanced both before and after auto postings are added. This changed in hledger 1.12+; see #893 for background. Auto posting tags- Postings added by transaction modifiers will have some extra tags:+ Automated postings will have some extra tags: o generated-posting:= QUERY - shows this was generated by an auto post- ing rule, and the query - o _generated-posting:= QUERY - a hidden tag, which does not appear in+ o _generated-posting:= QUERY - a hidden tag, which does not appear in hledger's output. This can be used to match postings generated "just now", rather than generated in the past and saved to the journal. - Also, any transaction that has been changed by transaction modifier- rules will have these tags added:+ Also, any transaction that has been changed by auto posting rules will+ have these tags added: o modified: - this transaction was modified @@ -1393,7 +1429,7 @@ 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) @@ -1407,7 +1443,7 @@ 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) @@ -1415,4 +1451,4 @@ -hledger 1.17 March 2020 hledger_journal(5)+hledger 1.17.0.1 March 2020 hledger_journal(5)
embeddedfiles/hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger_timeclock" "5" "March 2020" "hledger 1.17.0.1" "hledger User Manuals"
embeddedfiles/hledger_timeclock.info view
@@ -4,8 +4,8 @@ File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.17-*********************************+hledger_timeclock(5) hledger 1.17.0.1+************************************* Timeclock - the time logging format of timeclock.el, as read by hledger
embeddedfiles/hledger_timeclock.txt view
@@ -78,4 +78,4 @@ -hledger 1.17 March 2020 hledger_timeclock(5)+hledger 1.17.0.1 March 2020 hledger_timeclock(5)
embeddedfiles/hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger_timedot" "5" "March 2020" "hledger 1.17.0.1" "hledger User Manuals"
embeddedfiles/hledger_timedot.info view
@@ -4,8 +4,8 @@ File: hledger_timedot.info, Node: Top, Up: (dir) -hledger_timedot(5) hledger 1.17-*******************************+hledger_timedot(5) hledger 1.17.0.1+*********************************** Timedot - hledger's human-friendly time logging format
embeddedfiles/hledger_timedot.txt view
@@ -161,4 +161,4 @@ -hledger 1.17 March 2020 hledger_timedot(5)+hledger 1.17.0.1 March 2020 hledger_timedot(5)
hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "March 2020" "hledger 1.17" "hledger User Manuals"+.TH "hledger" "1" "March 2020" "hledger 1.17.1" "hledger User Manuals"
hledger.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: dd27e441eb3a9ba5f967dd8bd16e1806c793f7debe1277f7d8f08a88bba45971+-- hash: d2abd7cee761e265ed4dc8ae537931e737aac9f6e567945069d79d7641879321 name: hledger-version: 1.17+version: 1.17.1 synopsis: Command-line interface for the hledger accounting tool description: This is hledger's command-line interface. Its basic function is to read a plain text file describing@@ -144,9 +144,9 @@ other-modules: Paths_hledger ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.17"+ cpp-options: -DVERSION="1.17.1" build-depends:- Decimal+ Decimal >=0.5.1 , Diff , aeson , ansi-terminal >=0.6.2.3@@ -163,7 +163,7 @@ , haskeline >=0.6 , hledger-lib >=1.17 && <1.18 , lucid- , math-functions >=0.2.0.0+ , math-functions >=0.3.3.0 , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time@@ -197,9 +197,9 @@ hs-source-dirs: app ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.17"+ cpp-options: -DVERSION="1.17.1" build-depends:- Decimal+ Decimal >=0.5.1 , aeson , ansi-terminal >=0.6.2.3 , base >=4.9 && <4.15@@ -214,7 +214,7 @@ , haskeline >=0.6 , hledger , hledger-lib >=1.17 && <1.18- , math-functions >=0.2.0.0+ , math-functions >=0.3.3.0 , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time@@ -249,9 +249,9 @@ hs-source-dirs: test ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.17"+ cpp-options: -DVERSION="1.17.1" build-depends:- Decimal+ Decimal >=0.5.1 , aeson , ansi-terminal >=0.6.2.3 , base >=4.9 && <4.15@@ -266,7 +266,7 @@ , haskeline >=0.6 , hledger , hledger-lib >=1.17 && <1.18- , math-functions >=0.2.0.0+ , math-functions >=0.3.3.0 , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time@@ -300,7 +300,7 @@ bench ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path build-depends:- Decimal+ Decimal >=0.5.1 , aeson , ansi-terminal >=0.6.2.3 , base >=4.9 && <4.15@@ -317,7 +317,7 @@ , hledger , hledger-lib >=1.17 && <1.18 , html- , math-functions >=0.2.0.0+ , math-functions >=0.3.3.0 , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time
hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: COMMON TASKS, Up: (dir) -hledger(1) hledger 1.17-***********************+hledger(1) hledger 1.17.1+************************* hledger - a command-line accounting tool @@ -3734,187 +3734,187 @@ Tag Table: Node: Top68-Node: COMMON TASKS2315-Ref: #common-tasks2427-Node: Getting help2834-Ref: #getting-help2966-Node: Constructing command lines3519-Ref: #constructing-command-lines3711-Node: Starting a journal file4408-Ref: #starting-a-journal-file4606-Node: Setting opening balances5794-Ref: #setting-opening-balances5990-Node: Recording transactions9131-Ref: #recording-transactions9311-Node: Reconciling9867-Ref: #reconciling10010-Node: Reporting12267-Ref: #reporting12407-Node: Migrating to a new file16406-Ref: #migrating-to-a-new-file16554-Node: OPTIONS16853-Ref: #options16960-Node: General options17330-Ref: #general-options17455-Node: Command options20225-Ref: #command-options20376-Node: Command arguments20774-Ref: #command-arguments20921-Node: Queries21801-Ref: #queries21956-Node: Special characters in arguments and queries25918-Ref: #special-characters-in-arguments-and-queries26146-Node: More escaping26597-Ref: #more-escaping26759-Node: Even more escaping27055-Ref: #even-more-escaping27249-Node: Less escaping27920-Ref: #less-escaping28082-Node: Unicode characters28327-Ref: #unicode-characters28509-Node: Input files29921-Ref: #input-files30064-Node: Output destination31993-Ref: #output-destination32145-Node: Output format32570-Ref: #output-format32720-Node: Regular expressions34768-Ref: #regular-expressions34925-Node: Smart dates36286-Ref: #smart-dates36437-Node: Report start & end date37798-Ref: #report-start-end-date37970-Node: Report intervals39408-Ref: #report-intervals39573-Node: Period expressions39963-Ref: #period-expressions40123-Node: Depth limiting44249-Ref: #depth-limiting44393-Node: Pivoting44735-Ref: #pivoting44858-Node: Valuation46534-Ref: #valuation46636-Node: -B Cost46816-Ref: #b-cost46927-Node: -V Market value47125-Ref: #v-market-value47299-Node: -X Market value in specified commodity48731-Ref: #x-market-value-in-specified-commodity48970-Node: --value Flexible valuation49146-Ref: #value-flexible-valuation49372-Node: Effect of --value on reports53877-Ref: #effect-of---value-on-reports54093-Node: Combining -B -V -X --value59639-Ref: #combining--b--v--x---value59822-Node: COMMANDS59858-Ref: #commands59966-Node: accounts61050-Ref: #accounts61148-Node: activity61847-Ref: #activity61957-Node: add62340-Ref: #add62439-Node: balance65178-Ref: #balance65289-Node: Classic balance report66747-Ref: #classic-balance-report66920-Node: Customising the classic balance report68289-Ref: #customising-the-classic-balance-report68517-Node: Colour support70593-Ref: #colour-support70760-Node: Flat mode70933-Ref: #flat-mode71081-Node: Depth limited balance reports71494-Ref: #depth-limited-balance-reports71679-Node: Percentages72135-Ref: #percentages72301-Node: Multicolumn balance report73438-Ref: #multicolumn-balance-report73618-Node: Budget report78880-Ref: #budget-report79023-Node: Nested budgets84225-Ref: #nested-budgets84337-Ref: #output-format-187818-Node: balancesheet88015-Ref: #balancesheet88151-Node: balancesheetequity89617-Ref: #balancesheetequity89766-Node: cashflow90489-Ref: #cashflow90617-Node: check-dates91796-Ref: #check-dates91923-Node: check-dupes92202-Ref: #check-dupes92326-Node: close92619-Ref: #close92733-Node: close usage94255-Ref: #close-usage94348-Node: commodities97161-Ref: #commodities97288-Node: descriptions97370-Ref: #descriptions97498-Node: diff97679-Ref: #diff97785-Node: files98832-Ref: #files98932-Node: help99079-Ref: #help99179-Node: import100260-Ref: #import100374-Node: Importing balance assignments101267-Ref: #importing-balance-assignments101415-Node: incomestatement102064-Ref: #incomestatement102197-Node: notes103684-Ref: #notes103797-Node: payees103923-Ref: #payees104029-Node: prices104187-Ref: #prices104293-Node: print104634-Ref: #print104744-Node: print-unique109530-Ref: #print-unique109656-Node: register109941-Ref: #register110068-Node: Custom register output114240-Ref: #custom-register-output114369-Node: register-match115706-Ref: #register-match115840-Node: rewrite116191-Ref: #rewrite116306-Node: Re-write rules in a file118161-Ref: #re-write-rules-in-a-file118295-Node: Diff output format119505-Ref: #diff-output-format119674-Node: rewrite vs print --auto120766-Ref: #rewrite-vs.-print---auto120945-Node: roi121501-Ref: #roi121599-Node: stats122611-Ref: #stats122710-Node: tags123498-Ref: #tags123596-Node: test123890-Ref: #test123998-Node: Add-on Commands124745-Ref: #add-on-commands124862-Node: ui126205-Ref: #ui126293-Node: web126347-Ref: #web126450-Node: iadd126566-Ref: #iadd126677-Node: interest126759-Ref: #interest126866-Node: ENVIRONMENT127106-Ref: #environment127218-Node: FILES128047-Ref: #files-1128150-Node: LIMITATIONS128363-Ref: #limitations128482-Node: TROUBLESHOOTING129224-Ref: #troubleshooting129337+Node: COMMON TASKS2319+Ref: #common-tasks2431+Node: Getting help2838+Ref: #getting-help2970+Node: Constructing command lines3523+Ref: #constructing-command-lines3715+Node: Starting a journal file4412+Ref: #starting-a-journal-file4610+Node: Setting opening balances5798+Ref: #setting-opening-balances5994+Node: Recording transactions9135+Ref: #recording-transactions9315+Node: Reconciling9871+Ref: #reconciling10014+Node: Reporting12271+Ref: #reporting12411+Node: Migrating to a new file16410+Ref: #migrating-to-a-new-file16558+Node: OPTIONS16857+Ref: #options16964+Node: General options17334+Ref: #general-options17459+Node: Command options20229+Ref: #command-options20380+Node: Command arguments20778+Ref: #command-arguments20925+Node: Queries21805+Ref: #queries21960+Node: Special characters in arguments and queries25922+Ref: #special-characters-in-arguments-and-queries26150+Node: More escaping26601+Ref: #more-escaping26763+Node: Even more escaping27059+Ref: #even-more-escaping27253+Node: Less escaping27924+Ref: #less-escaping28086+Node: Unicode characters28331+Ref: #unicode-characters28513+Node: Input files29925+Ref: #input-files30068+Node: Output destination31997+Ref: #output-destination32149+Node: Output format32574+Ref: #output-format32724+Node: Regular expressions34772+Ref: #regular-expressions34929+Node: Smart dates36290+Ref: #smart-dates36441+Node: Report start & end date37802+Ref: #report-start-end-date37974+Node: Report intervals39412+Ref: #report-intervals39577+Node: Period expressions39967+Ref: #period-expressions40127+Node: Depth limiting44253+Ref: #depth-limiting44397+Node: Pivoting44739+Ref: #pivoting44862+Node: Valuation46538+Ref: #valuation46640+Node: -B Cost46820+Ref: #b-cost46931+Node: -V Market value47129+Ref: #v-market-value47303+Node: -X Market value in specified commodity48735+Ref: #x-market-value-in-specified-commodity48974+Node: --value Flexible valuation49150+Ref: #value-flexible-valuation49376+Node: Effect of --value on reports53881+Ref: #effect-of---value-on-reports54097+Node: Combining -B -V -X --value59643+Ref: #combining--b--v--x---value59826+Node: COMMANDS59862+Ref: #commands59970+Node: accounts61054+Ref: #accounts61152+Node: activity61851+Ref: #activity61961+Node: add62344+Ref: #add62443+Node: balance65182+Ref: #balance65293+Node: Classic balance report66751+Ref: #classic-balance-report66924+Node: Customising the classic balance report68293+Ref: #customising-the-classic-balance-report68521+Node: Colour support70597+Ref: #colour-support70764+Node: Flat mode70937+Ref: #flat-mode71085+Node: Depth limited balance reports71498+Ref: #depth-limited-balance-reports71683+Node: Percentages72139+Ref: #percentages72305+Node: Multicolumn balance report73442+Ref: #multicolumn-balance-report73622+Node: Budget report78884+Ref: #budget-report79027+Node: Nested budgets84229+Ref: #nested-budgets84341+Ref: #output-format-187822+Node: balancesheet88019+Ref: #balancesheet88155+Node: balancesheetequity89621+Ref: #balancesheetequity89770+Node: cashflow90493+Ref: #cashflow90621+Node: check-dates91800+Ref: #check-dates91927+Node: check-dupes92206+Ref: #check-dupes92330+Node: close92623+Ref: #close92737+Node: close usage94259+Ref: #close-usage94352+Node: commodities97165+Ref: #commodities97292+Node: descriptions97374+Ref: #descriptions97502+Node: diff97683+Ref: #diff97789+Node: files98836+Ref: #files98936+Node: help99083+Ref: #help99183+Node: import100264+Ref: #import100378+Node: Importing balance assignments101271+Ref: #importing-balance-assignments101419+Node: incomestatement102068+Ref: #incomestatement102201+Node: notes103688+Ref: #notes103801+Node: payees103927+Ref: #payees104033+Node: prices104191+Ref: #prices104297+Node: print104638+Ref: #print104748+Node: print-unique109534+Ref: #print-unique109660+Node: register109945+Ref: #register110072+Node: Custom register output114244+Ref: #custom-register-output114373+Node: register-match115710+Ref: #register-match115844+Node: rewrite116195+Ref: #rewrite116310+Node: Re-write rules in a file118165+Ref: #re-write-rules-in-a-file118299+Node: Diff output format119509+Ref: #diff-output-format119678+Node: rewrite vs print --auto120770+Ref: #rewrite-vs.-print---auto120949+Node: roi121505+Ref: #roi121603+Node: stats122615+Ref: #stats122714+Node: tags123502+Ref: #tags123600+Node: test123894+Ref: #test124002+Node: Add-on Commands124749+Ref: #add-on-commands124866+Node: ui126209+Ref: #ui126297+Node: web126351+Ref: #web126454+Node: iadd126570+Ref: #iadd126681+Node: interest126763+Ref: #interest126870+Node: ENVIRONMENT127110+Ref: #environment127222+Node: FILES128051+Ref: #files-1128154+Node: LIMITATIONS128367+Ref: #limitations128486+Node: TROUBLESHOOTING129228+Ref: #troubleshooting129341 End Tag Table
hledger.txt view
@@ -3187,4 +3187,4 @@ -hledger 1.17 March 2020 hledger(1)+hledger 1.17.1 March 2020 hledger(1)
test/unittest.hs view
@@ -7,7 +7,11 @@ -- {-# LANGUAGE PackageImports #-} -- import "hledger" Hledger.Cli (tests_Hledger_Cli) import Hledger.Cli (tests_Hledger_Cli)-+import System.Environment (setEnv) import Test.Tasty (defaultMain) -main = defaultMain tests_Hledger_Cli+main :: IO ()+main = do+ setEnv "TASTY_HIDE_SUCCESSES" "true"+ setEnv "TASTY_ANSI_TRICKS" "false" -- helps the above+ defaultMain tests_Hledger_Cli