diff --git a/hledger-lib/doc/hledger_journal.5 b/hledger-lib/doc/hledger_journal.5 index 87692ff5f..a12fe1c6e 100644 --- a/hledger-lib/doc/hledger_journal.5 +++ b/hledger-lib/doc/hledger_journal.5 @@ -464,18 +464,17 @@ the calculations yourself, instead of just reading it. .SS Prices .SS Transaction prices .PP -When recording a transaction, you can also record an amount\[aq]s price -in another commodity. -This documents the exchange rate, cost (of a purchase), or selling price -(of a sale) that was in effect within this particular transaction (or -more precisely, within the particular posting). -These transaction prices are fixed, and do not change. +Within a transaction posting, you can record an amount\[aq]s price in +another commodity. +This can be used to document the cost (for a purchase), or selling price +(for a sale), or the exchange rate that was used, for this transaction. +These transaction prices are fixed, and do not change over time. .PP -Such priced amounts can be displayed in their transaction price\[aq]s -commodity, by using the \f[C]\-\-cost/\-B\f[] flag (B for "cost Basis"), -supported by most hledger commands. +Amounts with transaction prices can be displayed in the transaction +price\[aq]s commodity, by using the \f[C]\-\-cost/\-B\f[] flag supported +by most hledger commands (mnemonic: "cost Basis"). .PP -There are three ways to specify a transaction price: +There are several ways to record a transaction price: .IP "1." 3 Write the unit price (aka exchange rate), as \f[C]\@\ UNITPRICE\f[] after the amount: @@ -532,27 +531,31 @@ rate of purchases made in a foreign currency. .SS Market prices .PP Market prices are not tied to a particular transaction; they represent -historical exchange rates between two commodities, usually from some -public market which publishes such rates. +historical exchange rates between two commodities. +(Ledger calls them historical prices.) For example, the prices published +by a stock exchange or the foreign exchange market. +Some commands (balance, currently) can use this information to show the +market value of things at a given date. .PP -When market prices are known, the \f[C]\-V/\-\-value\f[] option will use -them to convert reported amounts to their market value as of the report -end date. -This option is currently available only with the balance command. -.PP -You record market prices (Ledger calls them historical prices) with a P -directive, in the journal or perhaps in a separate included file. -Market price directives have the format: +To record market prices, use P directives in the main journal or in an +included file. +Their format is: .IP .nf \f[C] -P\ DATE\ COMMODITYSYMBOL\ UNITPRICE +P\ DATE\ COMMODITYBEINGPRICED\ UNITPRICE \f[] .fi .PP -For example, the following directives say that the euro\[aq]s exchange -rate was 1.35 US dollars during 2009, and $1.40 from 2010 onward (and -unknown before 2009). +DATE is a simple date as usual. +COMMODITYBEINGPRICED is the symbol of the commodity being priced (just +the symbol, no quantity). +UNITPRICE is an ordinary amount (symbol and quantity) in a second +commodity, specifying the unit price or conversion rate for the first +commodity in terms of the second, on the given date. +.PP +For example, the following directives say that one euro was worth 1.35 +US dollars during 2009, and $1.40 from 2010 onward: .IP .nf \f[C] @@ -560,8 +563,6 @@ P\ 2009/1/1\ €\ $1.35 P\ 2010/1/1\ €\ $1.40 \f[] .fi -.PP -Example use for market prices: tracking the value of stocks. .SS Comments .PP Lines in the journal beginning with a semicolon (\f[C];\f[]) or hash diff --git a/hledger-lib/doc/hledger_journal.5.info b/hledger-lib/doc/hledger_journal.5.info index f78263c0c..79fce4c0f 100644 --- a/hledger-lib/doc/hledger_journal.5.info +++ b/hledger-lib/doc/hledger_journal.5.info @@ -494,17 +494,17 @@ File: hledger_journal.5.info, Node: Transaction prices, Next: Market prices, 1.8.1 Transaction prices ------------------------ -When recording a transaction, you can also record an amount's price in -another commodity. This documents the exchange rate, cost (of a -purchase), or selling price (of a sale) that was in effect within this -particular transaction (or more precisely, within the particular -posting). These transaction prices are fixed, and do not change. +Within a transaction posting, you can record an amount's price in +another commodity. This can be used to document the cost (for a +purchase), or selling price (for a sale), or the exchange rate that was +used, for this transaction. These transaction prices are fixed, and do +not change over time. - Such priced amounts can be displayed in their transaction price's -commodity, by using the `--cost/-B' flag (B for "cost Basis"), -supported by most hledger commands. + Amounts with transaction prices can be displayed in the transaction +price's commodity, by using the `--cost/-B' flag supported by most +hledger commands (mnemonic: "cost Basis"). - There are three ways to specify a transaction price: + There are several ways to record a transaction price: 1. Write the unit price (aka exchange rate), as `@ UNITPRICE' after the amount: @@ -549,30 +549,31 @@ File: hledger_journal.5.info, Node: Market prices, Prev: Transaction prices, ------------------- Market prices are not tied to a particular transaction; they represent -historical exchange rates between two commodities, usually from some -public market which publishes such rates. +historical exchange rates between two commodities. (Ledger calls them +historical prices.) For example, the prices published by a stock +exchange or the foreign exchange market. Some commands (balance, +currently) can use this information to show the market value of things +at a given date. - When market prices are known, the `-V/--value' option will use them -to convert reported amounts to their market value as of the report end -date. This option is currently available only with the balance command. - - You record market prices (Ledger calls them historical prices) with -a P directive, in the journal or perhaps in a separate included file. -Market price directives have the format: + To record market prices, use P directives in the main journal or in +an included file. Their format is: -P DATE COMMODITYSYMBOL UNITPRICE +P DATE COMMODITYBEINGPRICED UNITPRICE - For example, the following directives say that the euro's exchange -rate was 1.35 US dollars during 2009, and $1.40 from 2010 onward (and -unknown before 2009). + DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of +the commodity being priced (just the symbol, no quantity). UNITPRICE is +an ordinary amount (symbol and quantity) in a second commodity, +specifying the unit price or conversion rate for the first commodity in +terms of the second, on the given date. + + For example, the following directives say that one euro was worth +1.35 US dollars during 2009, and $1.40 from 2010 onward: P 2009/1/1 € $1.35 P 2010/1/1 € $1.40 - Example use for market prices: tracking the value of stocks. -  File: hledger_journal.5.info, Node: Comments, Next: Tags, Prev: Prices, Up: FILE FORMAT @@ -997,39 +998,39 @@ Node: Prices17327 Ref: #prices17460 Node: Transaction prices17511 Ref: #transaction-prices17656 -Node: Market prices19263 -Ref: #market-prices19398 -Node: Comments20286 -Ref: #comments20408 -Node: Tags21520 -Ref: #tags21640 -Node: Directives22563 -Ref: #directives22678 -Node: Account aliases22871 -Ref: #account-aliases23017 -Node: Basic aliases23619 -Ref: #basic-aliases23764 -Node: Regex aliases24452 -Ref: #regex-aliases24622 -Node: Multiple aliases25392 -Ref: #multiple-aliases25566 -Node: end aliases26062 -Ref: #end-aliases26204 -Node: account directive26306 -Ref: #account-directive26488 -Node: apply account directive26784 -Ref: #apply-account-directive26982 -Node: Multi-line comments27642 -Ref: #multi-line-comments27834 -Node: commodity directive27961 -Ref: #commodity-directive28147 -Node: Default commodity29020 -Ref: #default-commodity29195 -Node: Default year29731 -Ref: #default-year29898 -Node: Including other files30321 -Ref: #including-other-files30480 -Node: EDITOR SUPPORT30876 -Ref: #editor-support30996 +Node: Market prices19236 +Ref: #market-prices19371 +Node: Comments20371 +Ref: #comments20493 +Node: Tags21605 +Ref: #tags21725 +Node: Directives22648 +Ref: #directives22763 +Node: Account aliases22956 +Ref: #account-aliases23102 +Node: Basic aliases23704 +Ref: #basic-aliases23849 +Node: Regex aliases24537 +Ref: #regex-aliases24707 +Node: Multiple aliases25477 +Ref: #multiple-aliases25651 +Node: end aliases26147 +Ref: #end-aliases26289 +Node: account directive26391 +Ref: #account-directive26573 +Node: apply account directive26869 +Ref: #apply-account-directive27067 +Node: Multi-line comments27727 +Ref: #multi-line-comments27919 +Node: commodity directive28046 +Ref: #commodity-directive28232 +Node: Default commodity29105 +Ref: #default-commodity29280 +Node: Default year29816 +Ref: #default-year29983 +Node: Including other files30406 +Ref: #including-other-files30565 +Node: EDITOR SUPPORT30961 +Ref: #editor-support31081  End Tag Table diff --git a/hledger-lib/doc/hledger_journal.5.txt b/hledger-lib/doc/hledger_journal.5.txt index 312d93e5e..5961019a5 100644 --- a/hledger-lib/doc/hledger_journal.5.txt +++ b/hledger-lib/doc/hledger_journal.5.txt @@ -359,17 +359,17 @@ FILE FORMAT Prices Transaction prices - When recording a transaction, you can also record an amount's price in - another commodity. This documents the exchange rate, cost (of a pur- - chase), or selling price (of a sale) that was in effect within this - particular transaction (or more precisely, within the particular post- - ing). These transaction prices are fixed, and do not change. + Within a transaction posting, you can record an amount's price in + another commodity. This can be used to document the cost (for a pur- + chase), or selling price (for a sale), or the exchange rate that was + used, for this transaction. These transaction prices are fixed, and do + not change over time. - Such priced amounts can be displayed in their transaction price's com- - modity, by using the --cost/-B flag (B for "cost Basis"), supported by - most hledger commands. + Amounts with transaction prices can be displayed in the transaction + price's commodity, by using the --cost/-B flag supported by most + hledger commands (mnemonic: "cost Basis"). - There are three ways to specify a transaction price: + There are several ways to record a transaction price: 1. Write the unit price (aka exchange rate), as @ UNITPRICE after the amount: @@ -404,29 +404,29 @@ FILE FORMAT Market prices Market prices are not tied to a particular transaction; they represent - historical exchange rates between two commodities, usually from some - public market which publishes such rates. + historical exchange rates between two commodities. (Ledger calls them + historical prices.) For example, the prices published by a stock + exchange or the foreign exchange market. Some commands (balance, cur- + rently) can use this information to show the market value of things at + a given date. - When market prices are known, the -V/--value option will use them to - convert reported amounts to their market value as of the report end - date. This option is currently available only with the balance com- - mand. + To record market prices, use P directives in the main journal or in an + included file. Their format is: - You record market prices (Ledger calls them historical prices) with a P - directive, in the journal or perhaps in a separate included file. Mar- - ket price directives have the format: + P DATE COMMODITYBEINGPRICED UNITPRICE - P DATE COMMODITYSYMBOL UNITPRICE + DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of + the commodity being priced (just the symbol, no quantity). UNITPRICE + is an ordinary amount (symbol and quantity) in a second commodity, + specifying the unit price or conversion rate for the first commodity in + terms of the second, on the given date. - For example, the following directives say that the euro's exchange rate - was 1.35 US dollars during 2009, and $1.40 from 2010 onward (and - unknown before 2009). + For example, the following directives say that one euro was worth 1.35 + US dollars during 2009, and $1.40 from 2010 onward: P 2009/1/1 $1.35 P 2010/1/1 $1.40 - Example use for market prices: tracking the value of stocks. - Comments Lines in the journal beginning with a semicolon (;) or hash (#) or asterisk (*) are comments, and will be ignored. (Asterisk comments diff --git a/hledger-ui/doc/hledger-ui.1 b/hledger-ui/doc/hledger-ui.1 index 6d9a54cee..7ea1816f3 100644 --- a/hledger-ui/doc/hledger-ui.1 +++ b/hledger-ui/doc/hledger-ui.1 @@ -203,7 +203,8 @@ show items with zero amount, normally hidden .RE .TP .B \f[C]\-B\ \-\-cost\f[] -show amounts in their cost price\[aq]s commodity +convert amounts to their cost at transaction time (using the transaction +price, if any) .RS .RE .TP @@ -211,8 +212,6 @@ show amounts in their cost price\[aq]s commodity will transform the journal before any other processing by replacing the account name of every posting having the tag TAG with content VALUE by the account name "TAG:VALUE". -.RS -.RE The TAG will only match if it is a full\-length match. The pivot will only happen if the TAG is on a posting, not if it is on the transaction. diff --git a/hledger-ui/doc/hledger-ui.1.info b/hledger-ui/doc/hledger-ui.1.info index a77e5e1b1..c5dcfd0f0 100644 --- a/hledger-ui/doc/hledger-ui.1.info +++ b/hledger-ui/doc/hledger-ui.1.info @@ -139,16 +139,17 @@ the data. show items with zero amount, normally hidden `-B --cost' - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) `--pivot TAG' will transform the journal before any other processing by replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". The TAG will + with content VALUE by the account name "TAG:VALUE". The TAG will only match if it is a full-length match. The pivot will only - happen if the TAG is on a posting, not if it is on the transaction. - If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". `--anon' show anonymized accounts and payees @@ -360,17 +361,17 @@ Tag Table: Node: Top88 Node: OPTIONS823 Ref: #options922 -Node: KEYS3956 -Ref: #keys4053 -Node: SCREENS6623 -Ref: #screens6710 -Node: Accounts screen6800 -Ref: #accounts-screen6930 -Node: Register screen8968 -Ref: #register-screen9125 -Node: Transaction screen11013 -Ref: #transaction-screen11173 -Node: Error screen12040 -Ref: #error-screen12164 +Node: KEYS4003 +Ref: #keys4100 +Node: SCREENS6670 +Ref: #screens6757 +Node: Accounts screen6847 +Ref: #accounts-screen6977 +Node: Register screen9015 +Ref: #register-screen9172 +Node: Transaction screen11060 +Ref: #transaction-screen11220 +Node: Error screen12087 +Ref: #error-screen12211  End Tag Table diff --git a/hledger-ui/doc/hledger-ui.1.txt b/hledger-ui/doc/hledger-ui.1.txt index cfab8fdce..4a0393252 100644 --- a/hledger-ui/doc/hledger-ui.1.txt +++ b/hledger-ui/doc/hledger-ui.1.txt @@ -133,16 +133,17 @@ OPTIONS show items with zero amount, normally hidden -B --cost - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) --pivot TAG - will transform the journal before any other processing by - replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". - The TAG will only match if it is a full-length match. The pivot will - only happen if the TAG is on a posting, not if it is on the transac- - tion. If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + will transform the journal before any other processing by + replacing the account name of every posting having the tag TAG + with content VALUE by the account name "TAG:VALUE". The TAG + will only match if it is a full-length match. The pivot will + only happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". --anon show anonymized accounts and payees diff --git a/hledger-web/doc/hledger-web.1 b/hledger-web/doc/hledger-web.1 index 991c56931..273322410 100644 --- a/hledger-web/doc/hledger-web.1 +++ b/hledger-web/doc/hledger-web.1 @@ -261,7 +261,8 @@ show items with zero amount, normally hidden .RE .TP .B \f[C]\-B\ \-\-cost\f[] -show amounts in their cost price\[aq]s commodity +convert amounts to their cost at transaction time (using the transaction +price, if any) .RS .RE .TP @@ -269,8 +270,6 @@ show amounts in their cost price\[aq]s commodity will transform the journal before any other processing by replacing the account name of every posting having the tag TAG with content VALUE by the account name "TAG:VALUE". -.RS -.RE The TAG will only match if it is a full\-length match. The pivot will only happen if the TAG is on a posting, not if it is on the transaction. diff --git a/hledger-web/doc/hledger-web.1.info b/hledger-web/doc/hledger-web.1.info index 8d37c388e..8de87a48a 100644 --- a/hledger-web/doc/hledger-web.1.info +++ b/hledger-web/doc/hledger-web.1.info @@ -185,16 +185,17 @@ before options as shown above. show items with zero amount, normally hidden `-B --cost' - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) `--pivot TAG' will transform the journal before any other processing by replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". The TAG will + with content VALUE by the account name "TAG:VALUE". The TAG will only match if it is a full-length match. The pivot will only - happen if the TAG is on a posting, not if it is on the transaction. - If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". `--anon' show anonymized accounts and payees diff --git a/hledger-web/doc/hledger-web.1.txt b/hledger-web/doc/hledger-web.1.txt index d1a75f8c8..4565de168 100644 --- a/hledger-web/doc/hledger-web.1.txt +++ b/hledger-web/doc/hledger-web.1.txt @@ -181,16 +181,17 @@ OPTIONS show items with zero amount, normally hidden -B --cost - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) --pivot TAG - will transform the journal before any other processing by - replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". - The TAG will only match if it is a full-length match. The pivot will - only happen if the TAG is on a posting, not if it is on the transac- - tion. If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + will transform the journal before any other processing by + replacing the account name of every posting having the tag TAG + with content VALUE by the account name "TAG:VALUE". The TAG + will only match if it is a full-length match. The pivot will + only happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". --anon show anonymized accounts and payees diff --git a/hledger/doc/hledger.1 b/hledger/doc/hledger.1 index 4cdd619db..981aee079 100644 --- a/hledger/doc/hledger.1 +++ b/hledger/doc/hledger.1 @@ -373,7 +373,8 @@ show items with zero amount, normally hidden .RE .TP .B \f[C]\-B\ \-\-cost\f[] -show amounts in their cost price\[aq]s commodity +convert amounts to their cost at transaction time (using the transaction +price, if any) .RS .RE .TP @@ -381,8 +382,6 @@ show amounts in their cost price\[aq]s commodity will transform the journal before any other processing by replacing the account name of every posting having the tag TAG with content VALUE by the account name "TAG:VALUE". -.RS -.RE The TAG will only match if it is a full\-length match. The pivot will only happen if the TAG is on a posting, not if it is on the transaction. @@ -558,6 +557,68 @@ T{ T}@T{ T} .TE +.SS Report start & end date +.PP +Most hledger reports show the full span of time represented by the +journal data, by default. +So, the effective report start and end dates will be the earliest and +latest transaction or posting dates found in the journal. +.PP +Often you will want to see a shorter time span, such as the current +month. +You can specify a start and/or end date using \f[C]\-b/\-\-begin\f[], +\f[C]\-e/\-\-end\f[], \f[C]\-p/\-\-period\f[] or a \f[C]date:\f[] query +(described below). +All of these accept the smart date syntax. +One important thing to be aware of when specifying end dates: as in +Ledger, end dates are exclusive, so you need to write the date +\f[I]after\f[] the last day you want to include. +.PP +Examples: +.PP +.TS +tab(@); +l l. +T{ +\f[C]\-b\ 2016/3/17\f[] +T}@T{ +begin on St. +Patrick\[aq]s day 2016 +T} +T{ +\f[C]\-e\ 12/1\f[] +T}@T{ +end at the start of december 1st of the current year (11/30 will be the +last date included) +T} +T{ +\f[C]\-b\ thismonth\f[] +T}@T{ +all transactions on or after the 1st of the current month +T} +T{ +\f[C]\-p\ thismonth\f[] +T}@T{ +all transactions in the current month +T} +T{ +\f[C]date:2016/3/17\-\f[] +T}@T{ +the above written as queries instead +T} +T{ +\f[C]date:\-12/1\f[] +T}@T{ +T} +T{ +\f[C]date:thismonth\-\f[] +T}@T{ +T} +T{ +\f[C]date:thismonth\f[] +T}@T{ +T} +.TE .SS Report intervals .PP A report interval can be specified so that commands like register, @@ -566,6 +627,7 @@ The basic intervals can be selected with one of \f[C]\-D/\-\-daily\f[], \f[C]\-W/\-\-weekly\f[], \f[C]\-M/\-\-monthly\f[], \f[C]\-Q/\-\-quarterly\f[], or \f[C]\-Y/\-\-yearly\f[]. More complex intervals may be specified with a period expression. +Report intervals can not be specified with a query, currently. .SS Period expressions .PP The \f[C]\-p/\-\-period\f[] option accepts period expressions, a @@ -1125,8 +1187,8 @@ is depth\-clipped (default in multicolumn reports) .RE .TP .B \f[C]\-V\ \-\-value\f[] -convert amounts to current market value in their default valuation -commodity +convert amounts to their market value on the report end date (using the +most recent applicable market price, if any) .RS .RE .TP @@ -1380,15 +1442,64 @@ Balance\ changes\ in\ 2008: .fi .SS Market value .PP -The \f[C]\-V/\-\-value\f[] flag converts all the reported amounts to -their "current market value" using their default market price. -That is the latest market price (P directive) found in the journal (or -an included file), for the amount\[aq]s commodity, dated on or before -the report end date. +The \f[C]\-V/\-\-value\f[] flag converts the reported amounts to their +market value on the report end date, using the most recent applicable +market prices, when known. +Specifically, when there is a market price (P directive) for the +amount\[aq]s commodity, dated on or before the report end date (see +hledger \-> Report start & end date), the amount will be converted to +the price\[aq]s commodity. +If multiple applicable prices are defined, the latest\-dated one is used +(and if dates are equal, the one last parsed). +.PP +For example: +.IP +.nf +\f[C] +#\ one\ euro\ is\ worth\ this\ many\ dollars\ from\ nov\ 1 +P\ 2016/11/01\ €\ $1.10 + +#\ purchase\ some\ euros\ on\ nov\ 3 +2016/11/3 +\ \ \ \ assets:euros\ \ \ \ \ \ \ \ €100 +\ \ \ \ assets:checking + +#\ the\ euro\ is\ worth\ fewer\ dollars\ by\ dec\ 21 +P\ 2016/12/21\ €\ $1.03 +\f[] +.fi +.PP +How many euros do I have ? +.IP +.nf +\f[C] +$\ hledger\ \-f\ t.j\ bal\ euros +\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros +\f[] +.fi +.PP +What are they worth on nov 3 ? +(no report end date specified, defaults to the last date in the journal) +.IP +.nf +\f[C] +$\ hledger\ \-f\ t.j\ bal\ euros\ \-V +\ \ \ \ \ \ \ \ \ \ \ \ \ $110.00\ \ assets:euros +\f[] +.fi +.PP +What are they worth on dec 21 ? +.IP +.nf +\f[C] +$\ hledger\ \-f\ t.j\ bal\ euros\ \-V\ \-e\ 2016/12/21 +\ \ \ \ \ \ \ \ \ \ \ \ \ $103.00\ \ assets:euros +\f[] +.fi +.PP +Currently, hledger\[aq]s \-V only uses market prices recorded with P +directives, not transaction prices (unlike Ledger). .PP -Unlike Ledger, hledger\[aq]s \-V only uses the market prices recorded -with P directives, ignoring transaction prices recorded as part of -posting amounts (which \-B/\-\-cost uses). Using \-B and \-V together is allowed. .SS Custom balance output .PP diff --git a/hledger/doc/hledger.1.info b/hledger/doc/hledger.1.info index 7b441396d..bffe09d24 100644 --- a/hledger/doc/hledger.1.info +++ b/hledger/doc/hledger.1.info @@ -202,6 +202,7 @@ cur:\\\\$'. * Input files:: * Depth limiting:: * Smart dates:: +* Report start & end date:: * Report intervals:: * Period expressions:: * Regular expressions:: @@ -300,16 +301,17 @@ Common reporting options, must be written after COMMAND. show items with zero amount, normally hidden `-B --cost' - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) `--pivot TAG' will transform the journal before any other processing by replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". The TAG will + with content VALUE by the account name "TAG:VALUE". The TAG will only match if it is a full-length match. The pivot will only - happen if the TAG is on a posting, not if it is on the transaction. - If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". `--anon' show anonymized accounts and payees @@ -381,7 +383,7 @@ register will show only the uppermost accounts in the account tree, down to level N. Use this when you want a summary with less detail.  -File: hledger.1.info, Node: Smart dates, Next: Report intervals, Prev: Depth limiting, Up: OPTIONS +File: hledger.1.info, Node: Smart dates, Next: Report start & end date, Prev: Depth limiting, Up: OPTIONS 2.5 Smart dates =============== @@ -404,21 +406,51 @@ omitted (defaulting to 1). `today', `yesterday', `tomorrow'  -File: hledger.1.info, Node: Report intervals, Next: Period expressions, Prev: Smart dates, Up: OPTIONS +File: hledger.1.info, Node: Report start & end date, Next: Report intervals, Prev: Smart dates, Up: OPTIONS -2.6 Report intervals +2.6 Report start & end date +=========================== + +Most hledger reports show the full span of time represented by the +journal data, by default. So, the effective report start and end dates +will be the earliest and latest transaction or posting dates found in +the journal. + + Often you will want to see a shorter time span, such as the current +month. You can specify a start and/or end date using `-b/--begin', +`-e/--end', `-p/--period' or a `date:' query (described below). All of +these accept the smart date syntax. One important thing to be aware of +when specifying end dates: as in Ledger, end dates are exclusive, so +you need to write the date _after_ the last day you want to include. + + Examples: + +`-b 2016/3/17' begin on St. Patrick's day 2016 +`-e 12/1' end at the start of december 1st of the current year (11/30 will be the last date included) +`-b thismonth' all transactions on or after the 1st of the current month +`-p thismonth' all transactions in the current month +`date:2016/3/17-' the above written as queries instead +`date:-12/1' +`date:thismonth-' +`date:thismonth' + + +File: hledger.1.info, Node: Report intervals, Next: Period expressions, Prev: Report start & end date, Up: OPTIONS + +2.7 Report intervals ==================== A report interval can be specified so that commands like register, balance and activity will divide their reports into multiple subperiods. The basic intervals can be selected with one of `-D/--daily', `-W/--weekly', `-M/--monthly', `-Q/--quarterly', or `-Y/--yearly'. More -complex intervals may be specified with a period expression. +complex intervals may be specified with a period expression. Report +intervals can not be specified with a query, currently.  File: hledger.1.info, Node: Period expressions, Next: Regular expressions, Prev: Report intervals, Up: OPTIONS -2.7 Period expressions +2.8 Period expressions ====================== The `-p/--period' option accepts period expressions, a shorthand way of @@ -493,7 +525,7 @@ start date and exclusive end date):  File: hledger.1.info, Node: Regular expressions, Prev: Period expressions, Up: OPTIONS -2.8 Regular expressions +2.9 Regular expressions ======================= hledger uses regular expressions in a number of places: @@ -873,8 +905,8 @@ Show accounts and their balances. Alias: bal. account is depth-clipped (default in multicolumn reports) `-V --value' - convert amounts to current market value in their default valuation - commodity + convert amounts to their market value on the report end date + (using the most recent applicable market price, if any) `-A --average' show a row average column (in multicolumn mode) @@ -1101,16 +1133,52 @@ File: hledger.1.info, Node: Market value, Next: Custom balance output, Prev: 4.4.4 Market value ------------------ -The `-V/--value' flag converts all the reported amounts to their -"current market value" using their default market price. That is the -latest market price (P directive) found in the journal (or an included -file), for the amount's commodity, dated on or before the report end -date. +The `-V/--value' flag converts the reported amounts to their market +value on the report end date, using the most recent applicable market +prices, when known. Specifically, when there is a market price (P +directive) for the amount's commodity, dated on or before the report end +date (see hledger -> Report start & end date), the amount will be +converted to the price's commodity. If multiple applicable prices are +defined, the latest-dated one is used (and if dates are equal, the one +last parsed). - Unlike Ledger, hledger's -V only uses the market prices recorded -with P directives, ignoring transaction prices recorded as part of -posting amounts (which -B/-cost uses). Using -B and -V together is -allowed. + For example: + + +# one euro is worth this many dollars from nov 1 +P 2016/11/01 € $1.10 + +# purchase some euros on nov 3 +2016/11/3 + assets:euros €100 + assets:checking + +# the euro is worth fewer dollars by dec 21 +P 2016/12/21 € $1.03 + + How many euros do I have ? + + +$ hledger -f t.j bal euros + €100 assets:euros + + What are they worth on nov 3 ? (no report end date specified, +defaults to the last date in the journal) + + +$ hledger -f t.j bal euros -V + $110.00 assets:euros + + What are they worth on dec 21 ? + + +$ hledger -f t.j bal euros -V -e 2016/12/21 + $103.00 assets:euros + + Currently, hledger's -V only uses market prices recorded with P +directives, not transaction prices (unlike Ledger). + + Using -B and -V together is allowed.  File: hledger.1.info, Node: Custom balance output, Next: Output destination, Prev: Market value, Up: balance @@ -2163,97 +2231,99 @@ Node: EXAMPLES1873 Ref: #examples1975 Node: OPTIONS3979 Ref: #options4083 -Node: General options6683 -Ref: #general-options6812 -Node: Reporting options7583 -Ref: #reporting-options7736 -Node: Input files9512 -Ref: #input-files9652 -Node: Depth limiting11489 -Ref: #depth-limiting11629 -Node: Smart dates11830 -Ref: #smart-dates11969 -Node: Report intervals12966 -Ref: #report-intervals13119 -Node: Period expressions13455 -Ref: #period-expressions13620 -Node: Regular expressions15955 -Ref: #regular-expressions16097 -Node: QUERIES17580 -Ref: #queries17684 -Node: COMMANDS21323 -Ref: #commands21437 -Node: accounts22110 -Ref: #accounts22210 -Node: activity23192 -Ref: #activity23304 -Node: add23663 -Ref: #add23764 -Node: balance26423 -Ref: #balance26536 -Node: Flat mode29509 -Ref: #flat-mode29636 -Node: Depth limited balance reports30055 -Ref: #depth-limited-balance-reports30258 -Node: Multicolumn balance reports30679 -Ref: #multicolumn-balance-reports30881 -Node: Market value35530 -Ref: #market-value35694 -Node: Custom balance output36187 -Ref: #custom-balance-output36360 -Node: Output destination38464 -Ref: #output-destination38629 -Node: CSV output38899 -Ref: #csv-output39018 -Node: balancesheet39415 -Ref: #balancesheet39543 -Node: cashflow40195 -Ref: #cashflow40312 -Node: help41002 -Ref: #help41114 -Node: incomestatement41951 -Ref: #incomestatement42081 -Node: info42808 -Ref: #info42915 -Node: man43277 -Ref: #man43374 -Node: print43777 -Ref: #print43882 -Node: register45228 -Ref: #register45341 -Node: Custom register output49833 -Ref: #custom-register-output49964 -Node: stats51261 -Ref: #stats51367 -Node: test52243 -Ref: #test52330 -Node: ADD-ON COMMANDS52697 -Ref: #add-on-commands52833 -Node: api54121 -Ref: #api54213 -Node: autosync54247 -Ref: #autosync54362 -Node: diff56677 -Ref: #diff56787 -Node: equity57451 -Ref: #equity57565 -Node: interest58893 -Ref: #interest59010 -Node: irr62094 -Ref: #irr62207 -Node: print-unique64582 -Ref: #print-unique64712 -Node: rewrite64970 -Ref: #rewrite65089 -Node: ui65618 -Ref: #ui65718 -Node: web65759 -Ref: #web65847 -Node: TROUBLESHOOTING65880 -Ref: #troubleshooting65999 -Node: Run-time problems66053 -Ref: #run-time-problems66196 -Node: Known limitations68140 -Ref: #known-limitations68283 +Node: General options6711 +Ref: #general-options6840 +Node: Reporting options7611 +Ref: #reporting-options7764 +Node: Input files9587 +Ref: #input-files9727 +Node: Depth limiting11564 +Ref: #depth-limiting11704 +Node: Smart dates11905 +Ref: #smart-dates12051 +Node: Report start & end date13048 +Ref: #report-start-end-date13220 +Node: Report intervals14296 +Ref: #report-intervals14461 +Node: Period expressions14860 +Ref: #period-expressions15025 +Node: Regular expressions17360 +Ref: #regular-expressions17502 +Node: QUERIES18985 +Ref: #queries19089 +Node: COMMANDS22728 +Ref: #commands22842 +Node: accounts23515 +Ref: #accounts23615 +Node: activity24597 +Ref: #activity24709 +Node: add25068 +Ref: #add25169 +Node: balance27828 +Ref: #balance27941 +Node: Flat mode30954 +Ref: #flat-mode31081 +Node: Depth limited balance reports31500 +Ref: #depth-limited-balance-reports31703 +Node: Multicolumn balance reports32124 +Ref: #multicolumn-balance-reports32326 +Node: Market value36975 +Ref: #market-value37139 +Node: Custom balance output38440 +Ref: #custom-balance-output38613 +Node: Output destination40717 +Ref: #output-destination40882 +Node: CSV output41152 +Ref: #csv-output41271 +Node: balancesheet41668 +Ref: #balancesheet41796 +Node: cashflow42448 +Ref: #cashflow42565 +Node: help43255 +Ref: #help43367 +Node: incomestatement44204 +Ref: #incomestatement44334 +Node: info45061 +Ref: #info45168 +Node: man45530 +Ref: #man45627 +Node: print46030 +Ref: #print46135 +Node: register47481 +Ref: #register47594 +Node: Custom register output52086 +Ref: #custom-register-output52217 +Node: stats53514 +Ref: #stats53620 +Node: test54496 +Ref: #test54583 +Node: ADD-ON COMMANDS54950 +Ref: #add-on-commands55086 +Node: api56374 +Ref: #api56466 +Node: autosync56500 +Ref: #autosync56615 +Node: diff58930 +Ref: #diff59040 +Node: equity59704 +Ref: #equity59818 +Node: interest61146 +Ref: #interest61263 +Node: irr64347 +Ref: #irr64460 +Node: print-unique66835 +Ref: #print-unique66965 +Node: rewrite67223 +Ref: #rewrite67342 +Node: ui67871 +Ref: #ui67971 +Node: web68012 +Ref: #web68100 +Node: TROUBLESHOOTING68133 +Ref: #troubleshooting68252 +Node: Run-time problems68306 +Ref: #run-time-problems68449 +Node: Known limitations70393 +Ref: #known-limitations70536  End Tag Table diff --git a/hledger/doc/hledger.1.txt b/hledger/doc/hledger.1.txt index b69909acc..73544c832 100644 --- a/hledger/doc/hledger.1.txt +++ b/hledger/doc/hledger.1.txt @@ -258,16 +258,17 @@ OPTIONS show items with zero amount, normally hidden -B --cost - show amounts in their cost price's commodity + convert amounts to their cost at transaction time (using the + transaction price, if any) --pivot TAG - will transform the journal before any other processing by - replacing the account name of every posting having the tag TAG - with content VALUE by the account name "TAG:VALUE". - The TAG will only match if it is a full-length match. The pivot will - only happen if the TAG is on a posting, not if it is on the transac- - tion. If the tag value is a multi:level:account:name the new account - name will be "TAG:multi:level:account:name". + will transform the journal before any other processing by + replacing the account name of every posting having the tag TAG + with content VALUE by the account name "TAG:VALUE". The TAG + will only match if it is a full-length match. The pivot will + only happen if the TAG is on a posting, not if it is on the + transaction. If the tag value is a multi:level:account:name the + new account name will be "TAG:multi:level:account:name". --anon show anonymized accounts and payees @@ -349,25 +350,59 @@ OPTIONS lastweek spaces are optional today, yesterday, tomorrow + Report start & end date + Most hledger reports show the full span of time represented by the + journal data, by default. So, the effective report start and end dates + will be the earliest and latest transaction or posting dates found in + the journal. + + Often you will want to see a shorter time span, such as the current + month. You can specify a start and/or end date using -b/--begin, + -e/--end, -p/--period or a date: query (described below). All of these + accept the smart date syntax. One important thing to be aware of when + specifying end dates: as in Ledger, end dates are exclusive, so you + need to write the date after the last day you want to include. + + Examples: + + + -b 2016/3/17 begin on St. Patrick's + day 2016 + -e 12/1 end at the start of decem- + ber 1st of the current + year (11/30 will be the + last date included) + -b thismonth all transactions on or + after the 1st of the cur- + rent month + -p thismonth all transactions in the + current month + date:2016/3/17- the above written as + queries instead + date:-12/1 + date:thismonth- + date:thismonth + Report intervals A report interval can be specified so that commands like register, bal- ance and activity will divide their reports into multiple subperiods. The basic intervals can be selected with one of -D/--daily, -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com- - plex intervals may be specified with a period expression. + plex intervals may be specified with a period expression. Report + intervals can not be specified with a query, currently. Period expressions - The -p/--period option accepts period expressions, a shorthand way of - expressing a start date, end date, and/or report interval all at once. + The -p/--period option accepts period expressions, a shorthand way of + expressing a start date, end date, and/or report interval all at once. - Here's a basic period expression specifying the first quarter of 2009. - Note, hledger always treats start dates as inclusive and end dates as + Here's a basic period expression specifying the first quarter of 2009. + Note, hledger always treats start dates as inclusive and end dates as exclusive: -p "from 2009/1/1 to 2009/4/1" - Keywords like "from" and "to" are optional, and so are the spaces, as - long as you don't run two dates together. "to" can also be written as + Keywords like "from" and "to" are optional, and so are the spaces, as + long as you don't run two dates together. "to" can also be written as "-". These are equivalent to the above: @@ -375,7 +410,7 @@ OPTIONS -p2009/1/1to2009/4/1 -p2009/1/1-2009/4/1 - Dates are smart dates, so if the current year is 2009, the above can + Dates are smart dates, so if the current year is 2009, the above can also be written as: @@ -391,26 +426,25 @@ OPTIONS 1, 2009 -p "from 2009/1" the same -p "from 2009" the same - -p "to 2009" everything before january + -p "to 2009" everything before january 1, 2009 - A single date with no "from" or "to" defines both the start and end + A single date with no "from" or "to" defines both the start and end date like so: - - -p "2009" the year 2009; equivalent + -p "2009" the year 2009; equivalent to "2009/1/1 to 2010/1/1" - -p "2009/1" the month of jan; equiva- + -p "2009/1" the month of jan; equiva- lent to "2009/1/1 to 2009/2/1" - -p "2009/1/1" just that day; equivalent + -p "2009/1/1" just that day; equivalent to "2009/1/1 to 2009/1/2" - The argument of -p can also begin with, or be, a report interval - expression. The basic report intervals are daily, weekly, monthly, + The argument of -p can also begin with, or be, a report interval + expression. The basic report intervals are daily, weekly, monthly, quarterly, or yearly, which have the same effect as the -D,-W,-M,-Q, or - -Y flags. Between report interval and start/end dates (if any), the + -Y flags. Between report interval and start/end dates (if any), the word in is optional. Examples: @@ -419,7 +453,7 @@ OPTIONS -p "quarterly" The following more complex report intervals are also supported: - biweekly, bimonthly, every N days|weeks|months|quarters|years, + biweekly, bimonthly, every N days|weeks|months|quarters|years, every Nth day [of month], every Nth day of week. Examples: @@ -429,12 +463,12 @@ OPTIONS -p "every 2 weeks" -p "every 5 days from 1/3" - Show historical balances at end of 15th each month (N is exclusive end + Show historical balances at end of 15th each month (N is exclusive end date): hledger balance -H -p "every 16th day" - Group postings from start of wednesday to end of next tuesday (N is + Group postings from start of wednesday to end of next tuesday (N is start date and exclusive end date): hledger register checking -p "every 3rd day of week" @@ -442,56 +476,56 @@ OPTIONS Regular expressions hledger uses regular expressions in a number of places: - o query terms, on the command line and in the hledger-web search form: + o query terms, on the command line and in the hledger-web search form: REGEX, desc:REGEX, cur:REGEX, tag:...=REGEX o CSV rules conditional blocks: if REGEX ... - o account alias directives and options: alias /REGEX/ = REPLACEMENT, + o account alias directives and options: alias /REGEX/ = REPLACEMENT, --alias /REGEX/=REPLACEMENT - hledger's regular expressions come from the regex-tdfa library. In + hledger's regular expressions come from the regex-tdfa library. In general they: o are case insensitive - o are infix matching (do not need to match the entire thing being + o are infix matching (do not need to match the entire thing being matched) o are POSIX extended regular expressions o also support GNU word boundaries (\<, \>, \b, \B) - o and parenthesised capturing groups and numeric backreferences in + o and parenthesised capturing groups and numeric backreferences in replacement strings o do not support mode modifiers like (?s) Some things to note: - o In the alias directive and --alias option, regular expressions must - be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, + o In the alias directive and --alias option, regular expressions must + be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, these are not required. o To match a regular expression metacharacter like $ as a literal char- acter, prepend a backslash. Eg to search for amounts with the dollar sign in hledger-web, write cur:\$. - o On the command line, some metacharacters like $ have a special mean- + o On the command line, some metacharacters like $ have a special mean- ing to the shell and so must be escaped a second time, with single or - double quotes or another backslash. Eg, to match amounts with the + double quotes or another backslash. Eg, to match amounts with the dollar sign from the command line, write cur:'\$' or cur:\\$. QUERIES - One of hledger's strengths is being able to quickly report on precise - subsets of your data. Most commands accept an optional query expres- - sion, written as arguments after the command name, to filter the data - by date, account name or other criteria. The syntax is similar to a + One of hledger's strengths is being able to quickly report on precise + subsets of your data. Most commands accept an optional query expres- + sion, written as arguments after the command name, to filter the data + by date, account name or other criteria. The syntax is similar to a web search: one or more space-separated search terms, quotes to enclose - whitespace, optional prefixes to match specific fields. Multiple + whitespace, optional prefixes to match specific fields. Multiple search terms are combined as follows: - All commands except print: show transactions/postings/accounts which + All commands except print: show transactions/postings/accounts which match (or negatively match) o any of the description terms AND @@ -518,22 +552,22 @@ QUERIES same as above amt:N, amt:N, amt:>=N - match postings with a single-commodity amount that is equal to, - less than, or greater than N. (Multi-commodity amounts are not + match postings with a single-commodity amount that is equal to, + less than, or greater than N. (Multi-commodity amounts are not tested, and will always match.) The comparison has two modes: if N is preceded by a + or - sign (or is 0), the two signed numbers - are compared. Otherwise, the absolute magnitudes are compared, + are compared. Otherwise, the absolute magnitudes are compared, ignoring sign. code:REGEX match by transaction code (eg check number) cur:REGEX - match postings or transactions including any amounts whose cur- - rency/commodity symbol is fully matched by REGEX. (For a par- + match postings or transactions including any amounts whose cur- + rency/commodity symbol is fully matched by REGEX. (For a par- tial match, use .*REGEX.*). Note, to match characters which are regex-significant, like the dollar sign ($), you need to prepend - \. And when using the command line you need to add one more + \. And when using the command line you need to add one more level of quoting to hide it from the shell, so eg do: hledger print cur:'\$' or hledger print cur:\\$. @@ -542,29 +576,29 @@ QUERIES date:PERIODEXPR match dates within the specified period. PERIODEXPR is a period - expression (with no report interval). Examples: date:2016, - date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the - --date2 command line flag is present, this matches secondary + expression (with no report interval). Examples: date:2016, + date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the + --date2 command line flag is present, this matches secondary dates instead. date2:PERIODEXPR match secondary dates within the specified period. depth:N - match (or display, depending on command) accounts at or above + match (or display, depending on command) accounts at or above this depth real:, real:0 match real or virtual postings respectively status:*, status:!, status: - match cleared, pending, or uncleared/pending transactions + match cleared, pending, or uncleared/pending transactions respectively tag:REGEX[=REGEX] - match by tag name, and optionally also by tag value. Note a - tag: query is considered to match a transaction if it matches - any of the postings. Also remember that postings inherit the + match by tag name, and optionally also by tag value. Note a + tag: query is considered to match a transaction if it matches + any of the postings. Also remember that postings inherit the tags of their parent transaction. not: before any of the above negates the match. @@ -572,24 +606,24 @@ QUERIES inacct:ACCTNAME a special term used automatically when you click an account name in hledger-web, specifying the account register we are currently - in (selects the transactions of that account and how to show - them, can be filtered further with acct etc). Not supported + in (selects the transactions of that account and how to show + them, can be filtered further with acct etc). Not supported elsewhere in hledger. Some of these can also be expressed as command-line options (eg depth:2 - is equivalent to --depth 2). Generally you can mix options and query - arguments, and the resulting query will be their intersection (perhaps + is equivalent to --depth 2). Generally you can mix options and query + arguments, and the resulting query will be their intersection (perhaps excluding the -p/--period option). COMMANDS - hledger provides a number of subcommands; hledger with no arguments + hledger provides a number of subcommands; hledger with no arguments shows a list. If you install additional hledger-* packages, or if you put programs or - scripts named hledger-NAME in your PATH, these will also be listed as + scripts named hledger-NAME in your PATH, these will also be listed as subcommands. - Run a subcommand by writing its name as first argument (eg + Run a subcommand by writing its name as first argument (eg hledger incomestatement). You can also write any unambiguous prefix of a command name (hledger inc), or one of the standard short aliases dis- played in the command list (hledger is). @@ -604,14 +638,14 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command lists all account names that are in use (ie, all the - accounts which have at least one transaction posting to them). With + This command lists all account names that are in use (ie, all the + accounts which have at least one transaction posting to them). With query arguments, only matched account names are shown. - It shows a flat list by default. With --tree, it uses indentation to + It shows a flat list by default. With --tree, it uses indentation to show the account hierarchy. - In flat mode you can add --drop N to omit the first few account name + In flat mode you can add --drop N to omit the first few account name components. Examples: @@ -654,8 +688,8 @@ COMMANDS activity Show an ascii barchart of posting counts per interval. - The activity command displays an ascii histogram showing transaction - counts by day, week, month or other reporting interval (by day is the + The activity command displays an ascii histogram showing transaction + counts by day, week, month or other reporting interval (by day is the default). With query arguments, it counts only matched transactions. $ hledger activity --quarterly @@ -668,24 +702,24 @@ COMMANDS Prompt for transactions and add them to the journal. --no-new-accounts - don't allow creating new accounts; helps prevent typos when + don't allow creating new accounts; helps prevent typos when entering account names - Many hledger users edit their journals directly with a text editor, or - generate them from CSV. For more interactive data entry, there is the - add command, which prompts interactively on the console for new trans- - actions, and appends them to the journal file (if there are multiple + Many hledger users edit their journals directly with a text editor, or + generate them from CSV. For more interactive data entry, there is the + add command, which prompts interactively on the console for new trans- + actions, and appends them to the journal file (if there are multiple -f FILE options, the first file is used.) Existing transactions are not - changed. This is the only hledger command that writes to the journal + changed. This is the only hledger command that writes to the journal file. To use it, just run hledger add and follow the prompts. You can add as - many transactions as you like; when you are finished, enter . or press + many transactions as you like; when you are finished, enter . or press control-d or control-c to exit. Features: - o add tries to provide useful defaults, using the most similar recent + o add tries to provide useful defaults, using the most similar recent transaction (by description) as a template. o You can also set the initial defaults with command line arguments. @@ -693,20 +727,20 @@ COMMANDS o Readline-style edit keys can be used during data entry. o The tab key will auto-complete whenever possible - accounts, descrip- - tions, dates (yesterday, today, tomorrow). If the input area is + tions, dates (yesterday, today, tomorrow). If the input area is empty, it will insert the default value. - o If the journal defines a default commodity, it will be added to any + o If the journal defines a default commodity, it will be added to any bare numbers entered. o A parenthesised transaction code may be entered following a date. o Comments and tags may be entered following a description or amount. - o If you make a mistake, enter < at any prompt to restart the transac- + o If you make a mistake, enter < at any prompt to restart the transac- tion. - o Input prompts are displayed in a different colour when the terminal + o Input prompts are displayed in a different colour when the terminal supports it. Example (see the tutorial for a detailed explanation): @@ -743,7 +777,7 @@ COMMANDS show balance change in each period (default) --cumulative - show balance change accumulated across periods (in multicolumn + show balance change accumulated across periods (in multicolumn reports) -H --historical @@ -757,8 +791,8 @@ COMMANDS account is depth-clipped (default in multicolumn reports) -V --value - convert amounts to current market value in their default valua- - tion commodity + convert amounts to their market value on the report end date + (using the most recent applicable market price, if any) -A --average show a row average column (in multicolumn mode) @@ -782,10 +816,10 @@ COMMANDS select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. - The balance command displays accounts and balances. It is hledger's + The balance command displays accounts and balances. It is hledger's most featureful and most useful command. $ hledger balance @@ -802,24 +836,24 @@ COMMANDS -------------------- 0 - More precisely, the balance command shows the change to each account's + More precisely, the balance command shows the change to each account's balance caused by all (matched) postings. In the common case where you - do not filter by date and your journal sets the correct opening bal- + do not filter by date and your journal sets the correct opening bal- ances, this is the same as the account's ending balance. - By default, accounts are displayed hierarchically, with subaccounts + By default, accounts are displayed hierarchically, with subaccounts indented below their parent. "Boring" accounts, which contain a single interesting subaccount and no balance of their own, are elided into the - following line for more compact output. (Use --no-elide to prevent + following line for more compact output. (Use --no-elide to prevent this.) - Each account's balance is the "inclusive" balance - it includes the + Each account's balance is the "inclusive" balance - it includes the balances of any subaccounts. - Accounts which have zero balance (and no non-zero subaccounts) are + Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use -E/--empty to show them. - A final total is displayed by default; use -N/--no-total to suppress + A final total is displayed by default; use -N/--no-total to suppress it: $ hledger balance -p 2008/6 expenses --no-total @@ -829,9 +863,9 @@ COMMANDS Flat mode To see a flat list of full account names instead of the default hierar- - chical display, use --flat. In this mode, accounts (unless + chical display, use --flat. In this mode, accounts (unless depth-clipped) show their "exclusive" balance, excluding any subaccount - balances. In this mode, you can also use --drop N to omit the first + balances. In this mode, you can also use --drop N to omit the first few account name components. $ hledger balance -p 2008/6 expenses -N --flat --drop 1 @@ -839,9 +873,9 @@ COMMANDS $1 supplies Depth limited balance reports - With --depth N, balance shows accounts only to the specified depth. - This is very useful to show a complex charts of accounts in less - detail. In flat mode, balances from accounts below the depth limit + With --depth N, balance shows accounts only to the specified depth. + This is very useful to show a complex charts of accounts in less + detail. In flat mode, balances from accounts below the depth limit will be shown as part of a parent account at the depth limit. $ hledger balance -N --depth 1 @@ -851,12 +885,12 @@ COMMANDS $1 liabilities Multicolumn balance reports - With a reporting interval, multiple balance columns will be shown, one - for each report period. There are three types of multi-column balance + With a reporting interval, multiple balance columns will be shown, one + for each report period. There are three types of multi-column balance report, showing different information: 1. By default: each column shows the sum of postings in that period, ie - the account's change of balance in that period. This is useful eg + the account's change of balance in that period. This is useful eg for a monthly income statement: $ hledger balance --quarterly income expenses -E @@ -871,8 +905,8 @@ COMMANDS -------------------++--------------------------------- || $-1 $1 0 0 - 2. With --cumulative: each column shows the ending balance for that - period, accumulating the changes across periods, starting from 0 at + 2. With --cumulative: each column shows the ending balance for that + period, accumulating the changes across periods, starting from 0 at the report start date: $ hledger balance --quarterly income expenses -E --cumulative @@ -888,8 +922,8 @@ COMMANDS || $-1 0 0 0 3. With --historical/-H: each column shows the actual historical ending - balance for that period, accumulating the changes across periods, - starting from the actual balance at the report start date. This is + balance for that period, accumulating the changes across periods, + starting from the actual balance at the report start date. This is useful eg for a multi-period balance sheet, and when you are showing only the data after a certain start date: @@ -905,26 +939,26 @@ COMMANDS ----------------------++------------------------------------- || 0 0 0 - Multi-column balance reports display accounts in flat mode by default; + Multi-column balance reports display accounts in flat mode by default; to see the hierarchy, use --tree. - With a reporting interval (like --quarterly above), the report - start/end dates will be adjusted if necessary so that they encompass + With a reporting interval (like --quarterly above), the report + start/end dates will be adjusted if necessary so that they encompass the displayed report periods. This is so that the first and last peri- ods will be "full" and comparable to the others. - The -E/--empty flag does two things in multicolumn balance reports: - first, the report will show all columns within the specified report - period (without -E, leading and trailing columns with all zeroes are - not shown). Second, all accounts which existed at the report start - date will be considered, not just the ones with activity during the + The -E/--empty flag does two things in multicolumn balance reports: + first, the report will show all columns within the specified report + period (without -E, leading and trailing columns with all zeroes are + not shown). Second, all accounts which existed at the report start + date will be considered, not just the ones with activity during the report period (use -E to include low-activity accounts which would oth- erwise would be omitted). The -T/--row-total flag adds an additional column showing the total for each row. - The -A/--average flag adds a column showing the average value in each + The -A/--average flag adds a column showing the average value in each row. Here's an example of all three: @@ -946,17 +980,50 @@ COMMANDS # Average is rounded to the dollar here since all journal amounts are Market value - The -V/--value flag converts all the reported amounts to their "current - market value" using their default market price. That is the latest - market price (P directive) found in the journal (or an included file), - for the amount's commodity, dated on or before the report end date. + The -V/--value flag converts the reported amounts to their market value + on the report end date, using the most recent applicable market prices, + when known. Specifically, when there is a market price (P directive) + for the amount's commodity, dated on or before the report end date (see + hledger -> Report start & end date), the amount will be converted to + the price's commodity. If multiple applicable prices are defined, the + latest-dated one is used (and if dates are equal, the one last parsed). - Unlike Ledger, hledger's -V only uses the market prices recorded with P - directives, ignoring transaction prices recorded as part of posting - amounts (which -B/--cost uses). Using -B and -V together is allowed. + For example: + + # one euro is worth this many dollars from nov 1 + P 2016/11/01 $1.10 + + # purchase some euros on nov 3 + 2016/11/3 + assets:euros 100 + assets:checking + + # the euro is worth fewer dollars by dec 21 + P 2016/12/21 $1.03 + + How many euros do I have ? + + $ hledger -f t.j bal euros + 100 assets:euros + + What are they worth on nov 3 ? (no report end date specified, defaults + to the last date in the journal) + + $ hledger -f t.j bal euros -V + $110.00 assets:euros + + What are they worth on dec 21 ? + + $ hledger -f t.j bal euros -V -e 2016/12/21 + $103.00 assets:euros + + Currently, hledger's -V only uses market prices recorded with P direc- + tives, not transaction prices (unlike Ledger). + + Using -B and -V together is allowed. Custom balance output - In simple (non-multi-column) balance reports, you can customise the + In simple (non-multi-column) balance reports, you can customise the output with --format FMT: $ hledger balance --format "%20(account) %12(total)" @@ -974,7 +1041,7 @@ COMMANDS 0 The FMT format string (plus a newline) specifies the formatting applied - to each account/balance pair. It may contain any suitable text, with + to each account/balance pair. It may contain any suitable text, with data fields interpolated like so: %[MIN][.MAX](FIELDNAME) @@ -985,14 +1052,14 @@ COMMANDS o FIELDNAME must be enclosed in parentheses, and can be one of: - o depth_spacer - a number of spaces equal to the account's depth, or + o depth_spacer - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces. o account - the account's name o total - the account's balance/posted total, right justified - Also, FMT can begin with an optional prefix to control how multi-com- + Also, FMT can begin with an optional prefix to control how multi-com- modity amounts are rendered: o %_ - render on multiple lines, bottom-aligned (the default) @@ -1001,7 +1068,7 @@ COMMANDS o %, - render on one line, comma-separated - There are some quirks. Eg in one-line mode, %(depth_spacer) has no + There are some quirks. Eg in one-line mode, %(depth_spacer) has no effect, instead %(account) has indentation built in. Experimentation may be needed to get pleasing results. @@ -1009,19 +1076,19 @@ COMMANDS o %(total) - the account's total - o %-20.20(account) - the account's name, left justified, padded to 20 + o %-20.20(account) - the account's name, left justified, padded to 20 characters and clipped at 20 characters - o %,%-50(account) %25(total) - account name padded to 50 characters, - total padded to 20 characters, with multiple commodities rendered on + o %,%-50(account) %25(total) - account name padded to 50 characters, + total padded to 20 characters, with multiple commodities rendered on one line - o %20(total) %2(depth_spacer)%-(account) - the default format for the + o %20(total) %2(depth_spacer)%-(account) - the default format for the single-column balance report Output destination - The balance, print, register and stats commands can write their output - to a destination other than the console. This is controlled by the + The balance, print, register and stats commands can write their output + to a destination other than the console. This is controlled by the -o/--output-file option. $ hledger balance -o - # write to stdout (the default) @@ -1029,8 +1096,8 @@ COMMANDS CSV output The balance, print and register commands can write their output as CSV. - This is useful for exporting data to other applications, eg to make - charts in a spreadsheet. This is controlled by the -O/--output-format + This is useful for exporting data to other applications, eg to make + charts in a spreadsheet. This is controlled by the -O/--output-format option, or by specifying a .csv file extension with -o/--output-file. $ hledger balance -O csv # write CSV to stdout @@ -1044,8 +1111,8 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command displays a simple balance sheet. It currently assumes - that you have top-level accounts named asset and liability (plural + This command displays a simple balance sheet. It currently assumes + that you have top-level accounts named asset and liability (plural forms also allowed.) $ hledger balancesheet @@ -1075,9 +1142,9 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command displays a simple cashflow statement It shows the change - in all "cash" (ie, liquid assets) accounts for the period. It cur- - rently assumes that cash accounts are under a top-level account named + This command displays a simple cashflow statement It shows the change + in all "cash" (ie, liquid assets) accounts for the period. It cur- + rently assumes that cash accounts are under a top-level account named asset and do not contain receivable or A/R (plural forms also allowed.) $ hledger cashflow @@ -1097,11 +1164,11 @@ COMMANDS help Show any of the hledger manuals. - The help command displays any of the main hledger man pages. (Unlike - hledger --help, which displays only the hledger man page.) Run it with - no arguments to list available topics (their names are shortened for - easier typing), and run hledger help TOPIC to select one. The output - is similar to a man page, but fixed width. It may be long, so you may + The help command displays any of the main hledger man pages. (Unlike + hledger --help, which displays only the hledger man page.) Run it with + no arguments to list available topics (their names are shortened for + easier typing), and run hledger help TOPIC to select one. The output + is similar to a man page, but fixed width. It may be long, so you may wish to pipe it into a pager. See also info and man. $ hledger help @@ -1130,8 +1197,8 @@ COMMANDS --drop=N in flat mode: omit N leading account name parts - This command displays a simple income statement. It currently assumes - that you have top-level accounts named income (or revenue) and expense + This command displays a simple income statement. It currently assumes + that you have top-level accounts named income (or revenue) and expense (plural forms also allowed.) $ hledger incomestatement @@ -1158,37 +1225,37 @@ COMMANDS info Show any of the hledger manuals using info. - The info command displays any of the hledger reference manuals using - the info hypertextual documentation viewer. This can be a very effi- - cient way to browse large manuals. It requires the "info" program to + The info command displays any of the hledger reference manuals using + the info hypertextual documentation viewer. This can be a very effi- + cient way to browse large manuals. It requires the "info" program to be available in your PATH. - As with help, run it with no arguments to list available topics (manu- + As with help, run it with no arguments to list available topics (manu- als). man Show any of the hledger manuals using man. - The man command displays any of the hledger reference manuals using - man, the standard documentation viewer on unix systems. This will fit - the text to your terminal width, and probably invoke a pager automati- + The man command displays any of the hledger reference manuals using + man, the standard documentation viewer on unix systems. This will fit + the text to your terminal width, and probably invoke a pager automati- cally. It requires the "man" program to be available in your PATH. - As with help, run it with no arguments to list available topics (manu- + As with help, run it with no arguments to list available topics (manu- als). print Show transactions from the journal. -m STR --match=STR - show the transaction whose description is most similar to STR, + show the transaction whose description is most similar to STR, and is most recent -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. $ hledger print @@ -1213,12 +1280,12 @@ COMMANDS liabilities:debts $1 assets:bank:checking $-1 - The print command displays full transactions from the journal file, - tidily formatted and showing all amounts explicitly. The output of - print is always a valid hledger journal, but it does always not pre- + The print command displays full transactions from the journal file, + tidily formatted and showing all amounts explicitly. The output of + print is always a valid hledger journal, but it does always not pre- serve all original content exactly (eg directives). - hledger's print command also shows all unit prices in effect, or (with + hledger's print command also shows all unit prices in effect, or (with -B/--cost) shows cost amounts. The print command also supports output destination and CSV output. @@ -1230,7 +1297,7 @@ COMMANDS show running total from report start date (default) -H --historical - show historical running total/balance (includes postings before + show historical running total/balance (includes postings before report start date) -A --average @@ -1241,18 +1308,18 @@ COMMANDS show postings' siblings instead -w N --width=N - set output width (default: terminal width or COLUMNS. -wN,M + set output width (default: terminal width or COLUMNS. -wN,M sets description width as well) -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. The register command displays postings, one per line, and their running - total. This is typically used with a query selecting a particular + total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking @@ -1261,8 +1328,8 @@ COMMANDS 2008/06/02 save assets:bank:checking $-1 $1 2008/12/31 pay off assets:bank:checking $-1 0 - The --historical/-H flag adds the balance from any undisplayed prior - postings to the running total. This is useful when you want to see + The --historical/-H flag adds the balance from any undisplayed prior + postings to the running total. This is useful when you want to see only recent activity, with a historically accurate running balance: $ hledger register checking -b 2008/6 --historical @@ -1272,23 +1339,23 @@ COMMANDS The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead + The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for - the whole report period). This flag implies --empty (see below). It - is affected by --historical. It works best when showing just one + the whole report period). This flag implies --empty (see below). It + is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of + The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - With a reporting interval, register shows summary postings, one per + With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are + Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E @@ -1305,7 +1372,7 @@ COMMANDS 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth + Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h @@ -1313,19 +1380,19 @@ COMMANDS 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these - will be adjusted outward if necessary to contain a whole number of - intervals. This ensures that the first and last intervals are full + Note when using report intervals, if you specify start/end dates these + will be adjusted outward if necessary to contain a whole number of + intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. Custom register output - register uses the full terminal width by default, except on windows. - You can override this by setting the COLUMNS environment variable (not + register uses the full terminal width by default, except on windows. + You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally - (about half of (width - 40) each). You can adjust this by adding a - description width as part of --width's argument, comma-separated: + The description and account columns normally share the space equally + (about half of (width - 40) each). You can adjust this by adding a + description width as part of --width's argument, comma-separated: --width W,D . Here's a diagram: <--------------------------------- width (W) ----------------------------------> @@ -1341,14 +1408,14 @@ COMMANDS $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width - The register command also supports the -o/--output-file and -O/--out- + The register command also supports the -o/--output-file and -O/--out- put-format options for controlling output destination and CSV output. stats Show some journal statistics. -o FILE --output-file=FILE - write output to FILE. A file extension matching one of the + write output to FILE. A file extension matching one of the above formats selects that format. $ hledger stats @@ -1363,8 +1430,8 @@ COMMANDS Accounts : 8 (depth 3) Commodities : 1 ($) - The stats command displays summary information for the whole journal, - or a matched part of it. With a reporting interval, it shows a report + The stats command displays summary information for the whole journal, + or a matched part of it. With a reporting interval, it shows a report for each report period. The stats command also supports -o/--output-file for controlling output @@ -1376,37 +1443,37 @@ COMMANDS $ hledger test Cases: 74 Tried: 74 Errors: 0 Failures: 0 - This command runs hledger's built-in unit tests and displays a quick + This command runs hledger's built-in unit tests and displays a quick report. With a regular expression argument, it selects only tests with matching names. It's mainly used in development, but it's also nice to be able to check your hledger executable for smoke at any time. ADD-ON COMMANDS - Add-on commands are executables in your PATH whose name starts with - hledger- and ends with any of these file extensions: none, - .hs,.lhs,.pl,.py,.rb,.rkt,.sh,.bat,.com,.exe. Also, an add-on's name + Add-on commands are executables in your PATH whose name starts with + hledger- and ends with any of these file extensions: none, + .hs,.lhs,.pl,.py,.rb,.rkt,.sh,.bat,.com,.exe. Also, an add-on's name may not be the same as any built-in command or alias. - hledger will detect these and include them in the command list and let - you invoke them with hledger ADDONCMD. However there are some limita- + hledger will detect these and include them in the command list and let + you invoke them with hledger ADDONCMD. However there are some limita- tions: o Options appearing before ADDONCMD will be visible only to hledger and will not be passed to the add-on. Eg: hledger -h web shows hledger's usage, hledger web -h shows hledger-web's usage. - o Options understood only by the add-on must go after a -- argument to - hide them from hledger, which would otherwise reject them. Eg: + o Options understood only by the add-on must go after a -- argument to + hide them from hledger, which would otherwise reject them. Eg: hledger web -- --server. - Sometimes it may be more convenient to just run the add-on directly, + Sometimes it may be more convenient to just run the add-on directly, eg: hledger-web --server. - Add-ons which are written in haskell can take advantage of the - hledger-lib library for journal parsing, reporting, command-line + Add-ons which are written in haskell can take advantage of the + hledger-lib library for journal parsing, reporting, command-line options, etc. - Here are some hledger add-ons available from Hackage, the extra direc- + Here are some hledger add-ons available from Hackage, the extra direc- tory in the hledger source, or elsewhere: api @@ -1464,11 +1531,11 @@ ADD-ON COMMANDS WF:4303001832 -$6.00 [assets:business:bank:wf:bchecking:banking] $6.00 - ledger-autosync, which includes a hledger-autosync alias, downloads + ledger-autosync, which includes a hledger-autosync alias, downloads transactions from your bank(s) via OFX, and prints just the new ones as journal entries which you can add to your journal. It can also operate - on .OFX files which you've downloaded manually. It can be a nice - alternative to hledger's built-in CSV reader, especially if your bank + on .OFX files which you've downloaded manually. It can be a nice + alternative to hledger's built-in CSV reader, especially if your bank supports OFX download. diff @@ -1494,9 +1561,9 @@ ADD-ON COMMANDS 2015/02/02 (acct:two) $2 - hledger-diff compares two journal files. Given an account name, it - prints out the transactions affecting that account which are in one - journal file but not in the other. This can be useful for reconciling + hledger-diff compares two journal files. Given an account name, it + prints out the transactions affecting that account which are in one + journal file but not in the other. This can be useful for reconciling existing journals with bank statements. equity @@ -1523,14 +1590,14 @@ ADD-ON COMMANDS equity:opening balances 0 This prints a journal entry which zeroes out the specified accounts (or - all accounts) with a transfer to/from "equity:closing balances" (like - Ledger's equity command). Also, it prints an similar entry with oppo- + all accounts) with a transfer to/from "equity:closing balances" (like + Ledger's equity command). Also, it prints an similar entry with oppo- site sign for restoring the balances from "equity:opening balances". These can be useful for ending one journal file and starting a new one, - respectively. By zeroing your asset and liability accounts at the end + respectively. By zeroing your asset and liability accounts at the end of a file and restoring them at the start of the next one, you will see - correct asset/liability balances whether you run hledger on just one + correct asset/liability balances whether you run hledger on just one file, or on several files concatenated with include. interest @@ -1611,11 +1678,11 @@ ADD-ON COMMANDS Liabilities:Bank EUR 3700.00 hledger-interest computes interests for a given account. Using command - line flags, the program can be configured to use various schemes for - day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Fur- - thermore, it supports a (small) number of interest schemes, i.e. + line flags, the program can be configured to use various schemes for + day-counting, such as act/act, 30/360, 30E/360, and 30/360isda. Fur- + thermore, it supports a (small) number of interest schemes, i.e. annual interest with a fixed rate and the scheme mandated by the German - BGB288 (Basiszins fr Verbrauchergeschfte). See the package page for + BGB288 (Basiszins fr Verbrauchergeschfte). See the package page for more. irr @@ -1673,11 +1740,11 @@ ADD-ON COMMANDS 2011/04/01 - 2011/05/01: 32.24% 2011/05/01 - 2011/06/01: 95.92% - hledger-irr computes the internal rate of return, also known as the - effective interest rate, of a given investment. After specifying what - account holds the investment, and what account stores the gains (or - losses, or fees, or cost), it calculates the hypothetical annual rate - of fixed rate investment that would have provided the exact same cash + hledger-irr computes the internal rate of return, also known as the + effective interest rate, of a given investment. After specifying what + account holds the investment, and what account stores the gains (or + losses, or fees, or cost), it calculates the hypothetical annual rate + of fixed rate investment that would have provided the exact same cash flow. See the package page for more. print-unique @@ -1698,8 +1765,8 @@ ADD-ON COMMANDS entries. hledger-rewrite.hs, in hledger's extra directory (compilation - optional), adds postings to existing transactions, optionally with an - amount based on the existing transaction's first amount. See the + optional), adds postings to existing transactions, optionally with an + amount based on the existing transaction's first amount. See the script for more details. $ hledger rewrite -- [QUERY] --add-posting "ACCT AMTEXPR" ... @@ -1714,26 +1781,26 @@ ADD-ON COMMANDS TROUBLESHOOTING Run-time problems - Here are some issues you might encounter when you run hledger (and - remember you can also seek help from the IRC channel, mail list or bug + Here are some issues you might encounter when you run hledger (and + remember you can also seek help from the IRC channel, mail list or bug tracker): Successfully installed, but "No command 'hledger' found" stack and cabal install binaries into a special directory, which should - be added to your PATH environment variable. Eg on unix-like systems, + be added to your PATH environment variable. Eg on unix-like systems, that is ~/.local/bin and ~/.cabal/bin respectively. I set a custom LEDGER_FILE, but hledger is still using the default file - LEDGER_FILE should be a real environment variable, not just a shell - variable. The command env | grep LEDGER_FILE should show it. You may + LEDGER_FILE should be a real environment variable, not just a shell + variable. The command env | grep LEDGER_FILE should show it. You may need to use export. Here's an explanation. - "Illegal byte sequence" or "Invalid or incomplete multibyte or wide + "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" errors In order to handle non-ascii letters and symbols (like ), hledger needs an appropriate locale. This is usually configured system-wide; you can also configure it temporarily. The locale may need to be one that sup- - ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, + ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, I'm not sure yet). Here's an example of setting the locale temporarily, on ubuntu @@ -1752,7 +1819,7 @@ TROUBLESHOOTING $ echo "export LANG=en_US.UTF-8" >>~/.bash_profile $ bash --login - If we preferred to use eg fr_FR.utf8, we might have to install that + If we preferred to use eg fr_FR.utf8, we might have to install that first: $ apt-get install language-pack-fr @@ -1773,45 +1840,45 @@ TROUBLESHOOTING Known limitations Command line interface - Add-on command options, unless they are also understood by the main - hledger executable, must be written after --, like this: + Add-on command options, unless they are also understood by the main + hledger executable, must be written after --, like this: hledger web -- --server Differences from Ledger - Not all of Ledger's journal file syntax is supported. See file format + Not all of Ledger's journal file syntax is supported. See file format differences. - hledger is slower than Ledger, and uses more memory, on large data + hledger is slower than Ledger, and uses more memory, on large data files. Windows limitations - In a windows CMD window, non-ascii characters and colours are not sup- + In a windows CMD window, non-ascii characters and colours are not sup- ported. In a windows Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add. ENVIRONMENT - COLUMNS The screen width used by the register command. Default: the + COLUMNS The screen width used by the register command. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default: - ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- + ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES - Reads data from one or more files in hledger journal, timeclock, time- - dot, or CSV format specified with -f, or $LEDGER_FILE, or - $HOME/.hledger.journal (on windows, perhaps + Reads data from one or more files in hledger journal, timeclock, time- + dot, or CSV format specified with -f, or $LEDGER_FILE, or + $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS - The need to precede options with -- when invoked from hledger is awk- + The need to precede options with -- when invoked from hledger is awk- ward. - hledger can't render non-ascii characters when run from a Windows com- + hledger can't render non-ascii characters when run from a Windows com- mand prompt (up to Windows 7 at least). When input data contains non-ascii characters, a suitable system locale @@ -1821,7 +1888,7 @@ BUGS 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) @@ -1835,7 +1902,7 @@ COPYRIGHT SEE ALSO - hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), + hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1)