update embedded manuals

[ci skip]
This commit is contained in:
Simon Michael 2018-06-08 17:26:58 -07:00
parent 312bf2fcb5
commit 42f47e2b6b
6 changed files with 551 additions and 437 deletions

View File

@ -439,8 +439,9 @@ will be the maximum from all posting amounts in that commmodity
or if there are no such amounts in the journal, a default format is used or if there are no such amounts in the journal, a default format is used
(like \f[C]$1000.00\f[]). (like \f[C]$1000.00\f[]).
.PP .PP
Price amounts and amounts in D directives usually don't affect amount Price amounts and amounts in \f[C]D\f[] directives usually don't affect
format inference, but in some situations they can do so indirectly. amount format inference, but in some situations they can do so
indirectly.
(Eg when D's default commodity is applied to a commodity\-less amount, (Eg when D's default commodity is applied to a commodity\-less amount,
or when an amountless posting is balanced using a price's commodity, or or when an amountless posting is balanced using a price's commodity, or
when \-V is used.) If you find this causing problems, set the desired when \-V is used.) If you find this causing problems, set the desired
@ -627,7 +628,6 @@ assignment).
Note that using balance assignments makes your journal a little less Note that using balance assignments makes your journal a little less
explicit; to know the exact amount posted, you have to run hledger or do explicit; to know the exact amount posted, you have to run hledger or do
the calculations yourself, instead of just reading it. the calculations yourself, instead of just reading it.
.SS Prices
.SS Transaction prices .SS Transaction prices
.PP .PP
Within a transaction, you can note an amount's price in another Within a transaction, you can note an amount's price in another
@ -636,10 +636,10 @@ This can be used to document the cost (in a purchase) or selling price
(in a sale). (in a sale).
For example, transaction prices are useful to record purchases of a For example, transaction prices are useful to record purchases of a
foreign currency. foreign currency.
.PP Note transaction prices are fixed at the time of the transaction, and do
Transaction prices are fixed, and do not change over time. not change over time.
(Ledger users: Ledger uses a different syntax for fixed prices, See also market prices, which represent prevailing exchange rates on a
\f[C]{=UNITPRICE}\f[], which hledger currently ignores). certain date.
.PP .PP
There are several ways to record a transaction price: There are several ways to record a transaction price:
.IP "1." 3 .IP "1." 3
@ -680,10 +680,13 @@ hledger infer the price that balances the transaction:
.fi .fi
.RE .RE
.PP .PP
Amounts with transaction prices can be displayed in the transaction (Ledger users: Ledger uses a different syntax for fixed prices,
price's commodity by using the \f[C]\-B/\-\-cost\f[] flag (except for \f[C]{=UNITPRICE}\f[], which hledger currently ignores).
#551) (\[lq]B\[rq] is from \[lq]cost Basis\[rq]). .PP
Eg for the above, here is how \-B affects the balance report: Use the \f[C]\-B/\-\-cost\f[] flag to convert amounts to their
transaction price's commodity, if any.
(mnemonic: \[lq]B\[rq] is from \[lq]cost Basis\[rq], as in Ledger).
Eg here is how \-B affects the balance report for the example above:
.IP .IP
.nf .nf
\f[C] \f[C]
@ -717,40 +720,6 @@ $\ hledger\ bal\ \-N\ \-\-flat\ \-B
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros
\f[] \f[]
.fi .fi
.SS Market prices
.PP
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities.
(Ledger calls them historical prices.) For example, the prices published
by a stock exchange or the foreign exchange market.
hledger can use these prices to show the market value of things at a
given date, see market value.
.PP
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\ COMMODITYBEINGPRICED\ UNITPRICE
\f[]
.fi
.PP
DATE is a simple date as usual.
COMMODITYBEINGPRICED is the symbol of the commodity being priced.
UNITPRICE is an ordinary amount (symbol and quantity) in a second
commodity, specifying the unit price or 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]
P\ 2009/1/1\ \ $1.35
P\ 2010/1/1\ \ $1.40
\f[]
.fi
.SS Comments .SS Comments
.PP .PP
Lines in the journal beginning with a semicolon (\f[C];\f[]) or hash Lines in the journal beginning with a semicolon (\f[C];\f[]) or hash
@ -853,6 +822,53 @@ For example, the following transaction has three tags (\f[C]A\f[],
Tags are like Ledger's metadata feature, except hledger's tag values are Tags are like Ledger's metadata feature, except hledger's tag values are
simple strings. simple strings.
.SS Directives .SS Directives
.PP
A directive is a line in the journal beginning with a special keyword,
that influences how the journal is processed.
Some directives may also have indented sub\-directives on the following
lines (\f[C]commodity\f[]).
.SS Directive scope, multiple files
.PP
Directives vary in which journal entries they affect:
.IP \[bu] 2
some form a begin/end pair, and affect the enclosed journal entries (and
included files):
.PD 0
.P
.PD
\f[C]alias\f[] & \f[C]end\ aliases\f[]; \f[C]comment\f[] &
\f[C]end\ comment\f[]
.IP \[bu] 2
some affect the subsequent journal entries (and included files) in the
current file:
.PD 0
.P
.PD
\f[C]alias\f[] or \f[C]comment\f[] without an end directive, \f[C]Y\f[]
.IP \[bu] 2
some affect all journal entries (and included files) anywhere in the
current file:
.PD 0
.P
.PD
\f[C]account\f[], \f[C]commodity\f[], \f[C]D\f[], \f[C]P\f[].
.PP
It's important to note that directives can affect the current file and
child (included) files, but not sibling or parent (including) files.
This is by design, for simplicity and predictability of reports, but it
can be surprising at times.
Eg, in:
.IP
.nf
\f[C]
hledger\ \-f\ a.prices\ \-f\ b.journal
\f[]
.fi
.PP
the prices defined in a.prices will not be effective in b.journal (a
sibling file).
Instead, you have to include (or inline) a.prices in b.journal, or vice
versa.
.SS Comment blocks .SS Comment blocks
.PP .PP
A line containing just \f[C]comment\f[] starts a commented region of the A line containing just \f[C]comment\f[] starts a commented region of the
@ -946,11 +962,11 @@ with a decimal point (a period or comma, followed by 0 or more decimal
digits). digits).
.SS Default commodity .SS Default commodity
.PP .PP
The D directive sets a default commodity (and display format), to be The \f[C]D\f[] directive sets a default commodity (and display format),
used for amounts without a commodity symbol (ie, plain numbers). to be used for amounts without a commodity symbol (ie, plain numbers).
(Note this differs from Ledger's default commodity directive.) The (Note this differs from Ledger's default commodity directive.) The
commodity and display format will be applied to all subsequent commodity and display format will be applied to all subsequent
commodity\-less amounts, or until the next D directive. commodity\-less amounts, or until the next \f[C]D\f[] directive.
.IP .IP
.nf .nf
\f[C] \f[C]
@ -966,6 +982,41 @@ D\ $1,000.00
.PP .PP
As with the \f[C]commodity\f[] directive, the amount must always be As with the \f[C]commodity\f[] directive, the amount must always be
written with a decimal point. written with a decimal point.
.SS Market prices
.PP
The \f[C]P\f[] directive declares a market price, which is an exchange
rate between two commodities on a certain date.
(In Ledger, they are called \[lq]historical prices\[rq].) These are
often obtained from a stock exchange, cryptocurrency exchange, or the
foreign exchange market.
.PP
Here is the format:
.IP
.nf
\f[C]
P\ DATE\ COMMODITYA\ COMMODITYBAMOUNT
\f[]
.fi
.IP \[bu] 2
DATE is a simple date
.IP \[bu] 2
COMMODITYA is the symbol of the commodity being priced
.IP \[bu] 2
COMMODITYBAMOUNT is an amount (symbol and quantity) in a second
commodity, giving the price in commodity B of one unit of commodity A.
.PP
These two market price directives say that one euro was worth 1.35 US
dollars during 2009, and $1.40 from 2010 onward:
.IP
.nf
\f[C]
P\ 2009/1/1\ \ $1.35
P\ 2010/1/1\ \ $1.40
\f[]
.fi
.PP
The \f[C]\-V/\-\-value\f[] flag can be used to convert reported amounts
to another commodity using these prices.
.SS Declaring accounts .SS Declaring accounts
.PP .PP
The \f[C]account\f[] directive predeclares account names. The \f[C]account\f[] directive predeclares account names.

View File

@ -77,7 +77,7 @@ File: hledger_journal.info, Node: FILE FORMAT, Next: EDITOR SUPPORT, Prev: To
* Virtual Postings:: * Virtual Postings::
* Balance Assertions:: * Balance Assertions::
* Balance Assignments:: * Balance Assignments::
* Prices:: * Transaction prices::
* Comments:: * Comments::
* Tags:: * Tags::
* Directives:: * Directives::
@ -400,12 +400,12 @@ written). The display format is chosen as follows:
* or if there are no such amounts in the journal, a default format is * or if there are no such amounts in the journal, a default format is
used (like '$1000.00'). used (like '$1000.00').
Price amounts and amounts in D directives usually don't affect amount Price amounts and amounts in 'D' directives usually don't affect
format inference, but in some situations they can do so indirectly. (Eg amount format inference, but in some situations they can do so
when D's default commodity is applied to a commodity-less amount, or indirectly. (Eg when D's default commodity is applied to a
when an amountless posting is balanced using a price's commodity, or commodity-less amount, or when an amountless posting is balanced using a
when -V is used.) If you find this causing problems, set the desired price's commodity, or when -V is used.) If you find this causing
format with a commodity directive. problems, set the desired format with a commodity directive.
 
File: hledger_journal.info, Node: Virtual Postings, Next: Balance Assertions, Prev: Amounts, Up: FILE FORMAT File: hledger_journal.info, Node: Virtual Postings, Next: Balance Assertions, Prev: Amounts, Up: FILE FORMAT
@ -569,7 +569,7 @@ virtual. They are not affected by the '--real/-R' flag or 'real:'
query. query.
 
File: hledger_journal.info, Node: Balance Assignments, Next: Prices, Prev: Balance Assertions, Up: FILE FORMAT File: hledger_journal.info, Node: Balance Assignments, Next: Transaction prices, Prev: Balance Assertions, Up: FILE FORMAT
1.10 Balance Assignments 1.10 Balance Assignments
======================== ========================
@ -602,30 +602,18 @@ little less explicit; to know the exact amount posted, you have to run
hledger or do the calculations yourself, instead of just reading it. hledger or do the calculations yourself, instead of just reading it.
 
File: hledger_journal.info, Node: Prices, Next: Comments, Prev: Balance Assignments, Up: FILE FORMAT File: hledger_journal.info, Node: Transaction prices, Next: Comments, Prev: Balance Assignments, Up: FILE FORMAT
1.11 Prices 1.11 Transaction prices
=========== =======================
* Menu:
* Transaction prices::
* Market prices::

File: hledger_journal.info, Node: Transaction prices, Next: Market prices, Up: Prices
1.11.1 Transaction prices
-------------------------
Within a transaction, you can note an amount's price in another Within a transaction, you can note an amount's price in another
commodity. This can be used to document the cost (in a purchase) or commodity. This can be used to document the cost (in a purchase) or
selling price (in a sale). For example, transaction prices are useful selling price (in a sale). For example, transaction prices are useful
to record purchases of a foreign currency. to record purchases of a foreign currency. Note transaction prices are
fixed at the time of the transaction, and do not change over time. See
Transaction prices are fixed, and do not change over time. (Ledger also market prices, which represent prevailing exchange rates on a
users: Ledger uses a different syntax for fixed prices, '{=UNITPRICE}', certain date.
which hledger currently ignores).
There are several ways to record a transaction price: There are several ways to record a transaction price:
@ -648,10 +636,13 @@ which hledger currently ignores).
assets:euros €100 ; one hundred euros purchased assets:euros €100 ; one hundred euros purchased
assets:dollars $-135 ; for $135 assets:dollars $-135 ; for $135
Amounts with transaction prices can be displayed in the transaction (Ledger users: Ledger uses a different syntax for fixed prices,
price's commodity by using the '-B/--cost' flag (except for #551) ("B" '{=UNITPRICE}', which hledger currently ignores).
is from "cost Basis"). Eg for the above, here is how -B affects the
balance report: Use the '-B/--cost' flag to convert amounts to their transaction
price's commodity, if any. (mnemonic: "B" is from "cost Basis", as in
Ledger). Eg here is how -B affects the balance report for the example
above:
$ hledger bal -N --flat $ hledger bal -N --flat
$-135 assets:dollars $-135 assets:dollars
@ -674,36 +665,7 @@ $ hledger bal -N --flat -B
€100 assets:euros €100 assets:euros
 
File: hledger_journal.info, Node: Market prices, Prev: Transaction prices, Up: Prices File: hledger_journal.info, Node: Comments, Next: Tags, Prev: Transaction prices, Up: FILE FORMAT
1.11.2 Market prices
--------------------
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. hledger can use these prices
to show the market value of things at a given date, see market value.
To record market prices, use P directives in the main journal or in
an included file. Their format is:
P DATE COMMODITYBEINGPRICED UNITPRICE
DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol
of the commodity being priced. UNITPRICE is an ordinary amount (symbol
and quantity) in a second commodity, specifying the unit price or
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

File: hledger_journal.info, Node: Comments, Next: Tags, Prev: Prices, Up: FILE FORMAT
1.12 Comments 1.12 Comments
============= =============
@ -792,21 +754,55 @@ File: hledger_journal.info, Node: Directives, Next: Periodic transactions, Pr
1.14 Directives 1.14 Directives
=============== ===============
A directive is a line in the journal beginning with a special keyword,
that influences how the journal is processed. Some directives may also
have indented sub-directives on the following lines ('commodity').
* Menu: * Menu:
* Directive scope multiple files::
* Comment blocks:: * Comment blocks::
* Including other files:: * Including other files::
* Default year:: * Default year::
* Declaring commodities:: * Declaring commodities::
* Default commodity:: * Default commodity::
* Market prices::
* Declaring accounts:: * Declaring accounts::
* Rewriting accounts:: * Rewriting accounts::
* Default parent account:: * Default parent account::
 
File: hledger_journal.info, Node: Comment blocks, Next: Including other files, Up: Directives File: hledger_journal.info, Node: Directive scope multiple files, Next: Comment blocks, Up: Directives
1.14.1 Comment blocks 1.14.1 Directive scope, multiple files
--------------------------------------
Directives vary in which journal entries they affect:
* some form a begin/end pair, and affect the enclosed journal entries
(and included files):
'alias' & 'end aliases'; 'comment' & 'end comment'
* some affect the subsequent journal entries (and included files) in
the current file:
'alias' or 'comment' without an end directive, 'Y'
* some affect all journal entries (and included files) anywhere in
the current file:
'account', 'commodity', 'D', 'P'.
It's important to note that directives can affect the current file
and child (included) files, but not sibling or parent (including) files.
This is by design, for simplicity and predictability of reports, but it
can be surprising at times. Eg, in:
hledger -f a.prices -f b.journal
the prices defined in a.prices will not be effective in b.journal (a
sibling file). Instead, you have to include (or inline) a.prices in
b.journal, or vice versa.

File: hledger_journal.info, Node: Comment blocks, Next: Including other files, Prev: Directive scope multiple files, Up: Directives
1.14.2 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,
@ -816,7 +812,7 @@ file) ends it. See also comments.
 
File: hledger_journal.info, Node: Including other files, Next: Default year, Prev: Comment blocks, Up: Directives File: hledger_journal.info, Node: Including other files, Next: Default year, Prev: Comment blocks, Up: Directives
1.14.2 Including other files 1.14.3 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
@ -833,7 +829,7 @@ include journal, timeclock or timedot files, but not CSV files.
 
File: hledger_journal.info, Node: Default year, Next: Declaring commodities, Prev: Including other files, Up: Directives File: hledger_journal.info, Node: Default year, Next: Declaring commodities, Prev: Including other files, Up: Directives
1.14.3 Default year 1.14.4 Default year
------------------- -------------------
You can set a default year to be used for subsequent dates which don't You can set a default year to be used for subsequent dates which don't
@ -859,7 +855,7 @@ Y2010 ; change default year to 2010
 
File: hledger_journal.info, Node: Declaring commodities, Next: Default commodity, Prev: Default year, Up: Directives File: hledger_journal.info, Node: Declaring commodities, Next: Default commodity, Prev: Default year, Up: Directives
1.14.4 Declaring commodities 1.14.5 Declaring commodities
---------------------------- ----------------------------
The 'commodity' directive declares commodities which may be used in the The 'commodity' directive declares commodities which may be used in the
@ -895,16 +891,16 @@ always be written with a decimal point (a period or comma, followed by 0
or more decimal digits). or more decimal digits).
 
File: hledger_journal.info, Node: Default commodity, Next: Declaring accounts, Prev: Declaring commodities, Up: Directives File: hledger_journal.info, Node: Default commodity, Next: Market prices, Prev: Declaring commodities, Up: Directives
1.14.5 Default commodity 1.14.6 Default commodity
------------------------ ------------------------
The D directive sets a default commodity (and display format), to be The 'D' directive sets a default commodity (and display format), to be
used for amounts without a commodity symbol (ie, plain numbers). (Note used for amounts without a commodity symbol (ie, plain numbers). (Note
this differs from Ledger's default commodity directive.) The commodity this differs from Ledger's default commodity directive.) The commodity
and display format will be applied to all subsequent commodity-less and display format will be applied to all subsequent commodity-less
amounts, or until the next D directive. amounts, or until the next 'D' directive.
# commodity-less amounts should be treated as dollars # commodity-less amounts should be treated as dollars
# (and displayed with symbol on the left, thousands separators and two decimal places) # (and displayed with symbol on the left, thousands separators and two decimal places)
@ -918,9 +914,39 @@ D $1,000.00
with a decimal point. with a decimal point.
 
File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Default commodity, Up: Directives File: hledger_journal.info, Node: Market prices, Next: Declaring accounts, Prev: Default commodity, Up: Directives
1.14.6 Declaring accounts 1.14.7 Market prices
--------------------
The 'P' directive declares a market price, which is an exchange rate
between 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:
P DATE COMMODITYA COMMODITYBAMOUNT
* DATE is a simple date
* COMMODITYA is the symbol of the commodity being priced
* COMMODITYBAMOUNT is an amount (symbol and quantity) in a second
commodity, 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
dollars during 2009, and $1.40 from 2010 onward:
P 2009/1/1 € $1.35
P 2010/1/1 € $1.40
The '-V/--value' flag can be used to convert reported amounts to
another commodity using these prices.

File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Market prices, Up: Directives
1.14.8 Declaring accounts
------------------------- -------------------------
The 'account' directive predeclares account names. The simplest form is The 'account' directive predeclares account names. The simplest form is
@ -962,7 +988,7 @@ account assets:bank:checking 1110
 
File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Declaring accounts, Up: Directives File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Declaring accounts, Up: Directives
1.14.7 Rewriting accounts 1.14.9 Rewriting accounts
------------------------- -------------------------
You can define aliases which rewrite your account names (after reading You can define aliases which rewrite your account names (after reading
@ -987,7 +1013,7 @@ be useful for:
 
File: hledger_journal.info, Node: Basic aliases, Next: Regex aliases, Up: Rewriting accounts File: hledger_journal.info, Node: Basic aliases, Next: Regex aliases, Up: Rewriting accounts
1.14.7.1 Basic aliases 1.14.9.1 Basic aliases
...................... ......................
To set an account alias, use the 'alias' directive in your journal file. To set an account alias, use the 'alias' directive in your journal file.
@ -1010,7 +1036,7 @@ alias checking = assets:bank:wells fargo:checking
 
File: hledger_journal.info, Node: Regex aliases, Next: Multiple aliases, Prev: Basic aliases, Up: Rewriting accounts File: hledger_journal.info, Node: Regex aliases, Next: Multiple aliases, Prev: Basic aliases, Up: Rewriting accounts
1.14.7.2 Regex aliases 1.14.9.2 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,
@ -1035,7 +1061,7 @@ whitespace.
 
File: hledger_journal.info, Node: Multiple aliases, Next: end aliases, Prev: Regex aliases, Up: Rewriting accounts File: hledger_journal.info, Node: Multiple aliases, Next: end aliases, Prev: Regex aliases, Up: Rewriting accounts
1.14.7.3 Multiple aliases 1.14.9.3 Multiple aliases
......................... .........................
You can define as many aliases as you like using directives or You can define as many aliases as you like using directives or
@ -1051,7 +1077,7 @@ following order:
 
File: hledger_journal.info, Node: end aliases, Prev: Multiple aliases, Up: Rewriting accounts File: hledger_journal.info, Node: end aliases, Prev: Multiple aliases, Up: Rewriting accounts
1.14.7.4 'end aliases' 1.14.9.4 'end aliases'
...................... ......................
You can clear (forget) all currently defined aliases with the 'end You can clear (forget) all currently defined aliases with the 'end
@ -1062,8 +1088,8 @@ end aliases
 
File: hledger_journal.info, Node: Default parent account, Prev: Rewriting accounts, Up: Directives File: hledger_journal.info, Node: Default parent account, Prev: Rewriting accounts, Up: Directives
1.14.8 Default parent account 1.14.10 Default parent account
----------------------------- ------------------------------
You can specify a parent account which will be prepended to all accounts 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 within a section of the journal. Use the 'apply account' and 'end apply
@ -1204,87 +1230,87 @@ Tag Table:
Node: Top76 Node: Top76
Node: FILE FORMAT2376 Node: FILE FORMAT2376
Ref: #file-format2500 Ref: #file-format2500
Node: Transactions2772 Node: Transactions2784
Ref: #transactions2893 Ref: #transactions2905
Node: Postings3577 Node: Postings3589
Ref: #postings3704 Ref: #postings3716
Node: Dates4699 Node: Dates4711
Ref: #dates4814 Ref: #dates4826
Node: Simple dates4879 Node: Simple dates4891
Ref: #simple-dates5005 Ref: #simple-dates5017
Node: Secondary dates5371 Node: Secondary dates5383
Ref: #secondary-dates5525 Ref: #secondary-dates5537
Node: Posting dates7088 Node: Posting dates7100
Ref: #posting-dates7217 Ref: #posting-dates7229
Node: Status8591 Node: Status8603
Ref: #status8711 Ref: #status8723
Node: Description10419 Node: Description10431
Ref: #description10557 Ref: #description10569
Node: Payee and note10876 Node: Payee and note10888
Ref: #payee-and-note10990 Ref: #payee-and-note11002
Node: Account names11232 Node: Account names11244
Ref: #account-names11375 Ref: #account-names11387
Node: Amounts11862 Node: Amounts11874
Ref: #amounts11998 Ref: #amounts12010
Node: Virtual Postings15013 Node: Virtual Postings15027
Ref: #virtual-postings15172 Ref: #virtual-postings15186
Node: Balance Assertions16392 Node: Balance Assertions16406
Ref: #balance-assertions16567 Ref: #balance-assertions16581
Node: Assertions and ordering17463 Node: Assertions and ordering17477
Ref: #assertions-and-ordering17649 Ref: #assertions-and-ordering17663
Node: Assertions and included files18349 Node: Assertions and included files18363
Ref: #assertions-and-included-files18590 Ref: #assertions-and-included-files18604
Node: Assertions and multiple -f options18923 Node: Assertions and multiple -f options18937
Ref: #assertions-and-multiple--f-options19177 Ref: #assertions-and-multiple--f-options19191
Node: Assertions and commodities19309 Node: Assertions and commodities19323
Ref: #assertions-and-commodities19544 Ref: #assertions-and-commodities19558
Node: Assertions and subaccounts20240 Node: Assertions and subaccounts20254
Ref: #assertions-and-subaccounts20472 Ref: #assertions-and-subaccounts20486
Node: Assertions and virtual postings20993 Node: Assertions and virtual postings21007
Ref: #assertions-and-virtual-postings21200 Ref: #assertions-and-virtual-postings21214
Node: Balance Assignments21342 Node: Balance Assignments21356
Ref: #balance-assignments21511 Ref: #balance-assignments21537
Node: Prices22631 Node: Transaction prices22657
Ref: #prices22764 Ref: #transaction-prices22826
Node: Transaction prices22815 Node: Comments25094
Ref: #transaction-prices22960 Ref: #comments25228
Node: Market prices25116 Node: Tags26398
Ref: #market-prices25251 Ref: #tags26516
Node: Comments26211 Node: Directives27918
Ref: #comments26333 Ref: #directives28061
Node: Tags27503 Node: Directive scope multiple files28517
Ref: #tags27621 Ref: #directive-scope-multiple-files28705
Node: Directives29023 Node: Comment blocks29655
Ref: #directives29166 Ref: #comment-blocks29839
Node: Comment blocks29359 Node: Including other files30015
Ref: #comment-blocks29504 Ref: #including-other-files30195
Node: Including other files29680 Node: Default year30584
Ref: #including-other-files29860 Ref: #default-year30753
Node: Default year30249 Node: Declaring commodities31176
Ref: #default-year30418 Ref: #declaring-commodities31359
Node: Declaring commodities30841 Node: Default commodity32586
Ref: #declaring-commodities31024 Ref: #default-commodity32762
Node: Default commodity32251 Node: Market prices33398
Ref: #default-commodity32432 Ref: #market-prices33563
Node: Declaring accounts33064 Node: Declaring accounts34404
Ref: #declaring-accounts33244 Ref: #declaring-accounts34580
Node: Rewriting accounts34591 Node: Rewriting accounts35927
Ref: #rewriting-accounts34776 Ref: #rewriting-accounts36112
Node: Basic aliases35380 Node: Basic aliases36716
Ref: #basic-aliases35526 Ref: #basic-aliases36862
Node: Regex aliases36216 Node: Regex aliases37552
Ref: #regex-aliases36387 Ref: #regex-aliases37723
Node: Multiple aliases37105 Node: Multiple aliases38441
Ref: #multiple-aliases37280 Ref: #multiple-aliases38616
Node: end aliases37778 Node: end aliases39114
Ref: #end-aliases37925 Ref: #end-aliases39261
Node: Default parent account38026 Node: Default parent account39362
Ref: #default-parent-account38192 Ref: #default-parent-account39530
Node: Periodic transactions38851 Node: Periodic transactions40189
Ref: #periodic-transactions39030 Ref: #periodic-transactions40368
Node: Automated postings40329 Node: Automated postings41667
Ref: #automated-postings40483 Ref: #automated-postings41821
Node: EDITOR SUPPORT41616 Node: EDITOR SUPPORT42954
Ref: #editor-support41734 Ref: #editor-support43072
 
End Tag Table End Tag Table

View File

@ -466,16 +466,14 @@ FILE FORMAT
less explicit; to know the exact amount posted, you have to run hledger less explicit; to know the exact amount posted, you have to run hledger
or do the calculations yourself, instead of just reading it. or do the calculations yourself, instead of just reading it.
Prices
Transaction prices Transaction prices
Within a transaction, you can note an amount's price in another commod- Within a transaction, you can note an amount's price in another commod-
ity. This can be used to document the cost (in a purchase) or selling ity. This can be used to document the cost (in a purchase) or selling
price (in a sale). For example, transaction prices are useful to price (in a sale). For example, transaction prices are useful to
record purchases of a foreign currency. record purchases of a foreign currency. Note transaction prices are
fixed at the time of the transaction, and do not change over time. See
Transaction prices are fixed, and do not change over time. (Ledger also market prices, which represent prevailing exchange rates on a cer-
users: Ledger uses a different syntax for fixed prices, {=UNITPRICE}, tain date.
which hledger currently ignores).
There are several ways to record a transaction price: There are several ways to record a transaction price:
@ -498,10 +496,12 @@ FILE FORMAT
assets:euros 100 ; one hundred euros purchased assets:euros 100 ; one hundred euros purchased
assets:dollars $-135 ; for $135 assets:dollars $-135 ; for $135
Amounts with transaction prices can be displayed in the transaction (Ledger users: Ledger uses a different syntax for fixed prices, {=UNIT-
price's commodity by using the -B/--cost flag (except for #551) ("B" is PRICE}, which hledger currently ignores).
from "cost Basis"). Eg for the above, here is how -B affects the bal-
ance report: Use the -B/--cost flag to convert amounts to their transaction price's
commodity, if any. (mnemonic: "B" is from "cost Basis", as in Ledger).
Eg here is how -B affects the balance report for the example above:
$ hledger bal -N --flat $ hledger bal -N --flat
$-135 assets:dollars $-135 assets:dollars
@ -510,8 +510,8 @@ FILE FORMAT
$-135 assets:dollars $-135 assets:dollars
$135 assets:euros # <- the euros' cost $135 assets:euros # <- the euros' cost
Note -B is sensitive to the order of postings when a transaction price Note -B is sensitive to the order of postings when a transaction price
is inferred: the inferred price will be in the commodity of the last is inferred: the inferred price will be in the commodity of the last
amount. So if example 3's postings are reversed, while the transaction amount. So if example 3's postings are reversed, while the transaction
is equivalent, -B shows something different: is equivalent, -B shows something different:
@ -523,40 +523,16 @@ FILE FORMAT
-100 assets:dollars # <- the dollars' selling price -100 assets:dollars # <- the dollars' selling price
100 assets:euros 100 assets:euros
Market prices
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. hledger can use these prices
to show the market value of things at a given date, see market value.
To record market prices, use P directives in the main journal or in an
included file. Their format is:
P DATE COMMODITYBEINGPRICED UNITPRICE
DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of
the commodity being priced. UNITPRICE is an ordinary amount (symbol
and quantity) in a second commodity, specifying the unit price or con-
version rate for the first commodity in terms of the second, on the
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
Comments Comments
Lines in the journal beginning with a semicolon (;) or hash (#) or star Lines in the journal beginning with a semicolon (;) or hash (#) or star
(*) are comments, and will be ignored. (Star comments cause org-mode (*) are comments, and will be ignored. (Star comments cause org-mode
nodes to be ignored, allowing emacs users to fold and navigate their nodes to be ignored, allowing emacs users to fold and navigate their
journals with org-mode or orgstruct-mode.) journals with org-mode or orgstruct-mode.)
You can attach comments to a transaction by writing them after the You can attach comments to a transaction by writing them after the
description and/or indented on the following lines (before the post- description and/or indented on the following lines (before the post-
ings). Similarly, you can attach comments to an individual posting by ings). Similarly, you can attach comments to an individual posting by
writing them after the amount and/or indented on the following lines. writing them after the amount and/or indented on the following lines.
Transaction and posting comments must begin with a semicolon (;). Transaction and posting comments must begin with a semicolon (;).
Some examples: Some examples:
@ -580,24 +556,24 @@ FILE FORMAT
; another comment line for posting 2 ; another comment line for posting 2
; a file comment (because not indented) ; a file comment (because not indented)
You can also comment larger regions of a file using comment and You can also comment larger regions of a file using comment and
end comment directives. end comment directives.
Tags Tags
Tags are a way to add extra labels or labelled data to postings and Tags are a way to add extra labels or labelled data to postings and
transactions, which you can then search or pivot on. transactions, which you can then search or pivot on.
A simple tag is a word (which may contain hyphens) followed by a full A simple tag is a word (which may contain hyphens) followed by a full
colon, written inside a transaction or posting comment line: colon, written inside a transaction or posting comment line:
2017/1/16 bought groceries ; sometag: 2017/1/16 bought groceries ; sometag:
Tags can have a value, which is the text after the colon, up to the Tags can have a value, which is the text after the colon, up to the
next comma or end of line, with leading/trailing whitespace removed: next comma or end of line, with leading/trailing whitespace removed:
expenses:food $10 ; a-posting-tag: the tag value expenses:food $10 ; a-posting-tag: the tag value
Note this means hledger's tag values can not contain commas or new- Note this means hledger's tag values can not contain commas or new-
lines. Ending at commas means you can write multiple short tags on one lines. Ending at commas means you can write multiple short tags on one
line, comma separated: line, comma separated:
@ -611,39 +587,69 @@ FILE FORMAT
o "tag2" is another tag, whose value is "some value ..." o "tag2" is another tag, whose value is "some value ..."
Tags in a transaction comment affect the transaction and all of its Tags in a transaction comment affect the transaction and all of its
postings, while tags in a posting comment affect only that posting. postings, while tags in a posting comment affect only that posting.
For example, the following transaction has three tags (A, TAG2, For example, the following transaction has three tags (A, TAG2,
third-tag) and the posting has four (those plus posting-tag): third-tag) and the posting has four (those plus posting-tag):
1/1 a transaction ; A:, TAG2: 1/1 a transaction ; A:, TAG2:
; third-tag: a third transaction tag, <- with a value ; third-tag: a third transaction tag, <- with a value
(a) $1 ; posting-tag: (a) $1 ; posting-tag:
Tags are like Ledger's metadata feature, except hledger's tag values Tags are like Ledger's metadata feature, except hledger's tag values
are simple strings. are simple strings.
Directives Directives
A directive is a line in the journal beginning with a special keyword,
that influences how the journal is processed. Some directives may also
have indented sub-directives on the following lines (commodity).
Directive scope, multiple files
Directives vary in which journal entries they affect:
o some form a begin/end pair, and affect the enclosed journal entries
(and included files):
alias & end aliases; comment & end comment
o some affect the subsequent journal entries (and included files) in
the current file:
alias or comment without an end directive, Y
o some affect all journal entries (and included files) anywhere in the
current file:
account, commodity, D, P.
It's important to note that directives can affect the current file and
child (included) files, but not sibling or parent (including) files.
This is by design, for simplicity and predictability of reports, but it
can be surprising at times. Eg, in:
hledger -f a.prices -f b.journal
the prices defined in a.prices will not be effective in b.journal (a
sibling file). Instead, you have to include (or inline) a.prices in
b.journal, or vice versa.
Comment blocks 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) and a line containing just end comment (or the end of the current file)
ends it. See also comments. ends it. See also comments.
Including other files 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: directive, like this:
include path/to/file.journal include path/to/file.journal
If the path does not begin with a slash, it is relative to the current If the path does not begin with a slash, it is relative to the current
file. Glob patterns (*) are not currently supported. file. Glob patterns (*) are not currently supported.
The include directive can only be used in journal files. It can The include directive can only be used in journal files. It can
include journal, timeclock or timedot files, but not CSV files. include journal, timeclock or timedot files, but not CSV files.
Default year Default year
You can set a default year to be used for subsequent dates which don't 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. specify a year. This is a line beginning with Y followed by the year.
Eg: Eg:
Y2009 ; set default year to 2009 Y2009 ; set default year to 2009
@ -663,8 +669,8 @@ FILE FORMAT
assets assets
Declaring commodities Declaring commodities
The commodity directive declares commodities which may be used in the The commodity directive declares commodities which may be used in the
journal (though currently we do not enforce this). It may be written journal (though currently we do not enforce this). It may be written
on a single line, like this: on a single line, like this:
; commodity EXAMPLEAMOUNT ; commodity EXAMPLEAMOUNT
@ -674,8 +680,8 @@ FILE FORMAT
; separating thousands with comma. ; separating thousands with comma.
commodity 1,000.0000 AAAA commodity 1,000.0000 AAAA
or on multiple lines, using the "format" subdirective. In this case or on multiple lines, using the "format" subdirective. In this case
the commodity symbol appears twice and should be the same in both the commodity symbol appears twice and should be the same in both
places: places:
; commodity SYMBOL ; commodity SYMBOL
@ -687,19 +693,19 @@ FILE FORMAT
commodity INR commodity INR
format INR 9,99,99,999.00 format INR 9,99,99,999.00
Commodity directives have a second purpose: they define the standard Commodity directives have a second purpose: they define the standard
display format for amounts in the commodity. Normally the display for- display format for amounts in the commodity. Normally the display for-
mat is inferred from journal entries, but this can be unpredictable; mat is inferred from journal entries, but this can be unpredictable;
declaring it with a commodity directive overrides this and removes declaring it with a commodity directive overrides this and removes
ambiguity. Towards this end, amounts in commodity directives must ambiguity. Towards this end, amounts in commodity directives must
always be written with a decimal point (a period or comma, followed by always be written with a decimal point (a period or comma, followed by
0 or more decimal digits). 0 or more decimal digits).
Default commodity Default commodity
The D directive sets a default commodity (and display format), to be The D directive sets a default commodity (and display format), to be
used for amounts without a commodity symbol (ie, plain numbers). (Note used for amounts without a commodity symbol (ie, plain numbers). (Note
this differs from Ledger's default commodity directive.) The commodity this differs from Ledger's default commodity directive.) The commodity
and display format will be applied to all subsequent commodity-less and display format will be applied to all subsequent commodity-less
amounts, or until the next D directive. amounts, or until the next D directive.
# commodity-less amounts should be treated as dollars # commodity-less amounts should be treated as dollars
@ -713,13 +719,39 @@ FILE FORMAT
As with the commodity directive, the amount must always be written with As with the commodity directive, the amount must always be written with
a decimal point. a decimal point.
Market prices
The P directive declares a market price, which is an exchange rate
between 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:
P DATE COMMODITYA COMMODITYBAMOUNT
o DATE is a simple date
o COMMODITYA is the symbol of the commodity being priced
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
dollars during 2009, and $1.40 from 2010 onward:
P 2009/1/1 $1.35
P 2010/1/1 $1.40
The -V/--value flag can be used to convert reported amounts to another
commodity using these prices.
Declaring accounts Declaring accounts
The account directive predeclares account names. The simplest form is The account directive predeclares account names. The simplest form is
account ACCTNAME, eg: account ACCTNAME, eg:
account assets:bank:checking account assets:bank:checking
Currently this mainly helps with account name autocompletion in eg Currently this mainly helps with account name autocompletion in eg
hledger add, hledger-iadd, hledger-web, and ledger-mode. hledger add, hledger-iadd, hledger-web, and ledger-mode.
In future it will also help detect misspelled accounts. In future it will also help detect misspelled accounts.
@ -731,13 +763,13 @@ FILE FORMAT
account revenues 4000 account revenues 4000
account expenses 6000 account expenses 6000
This affects account display order in reports: accounts with codes are This affects account display order in reports: accounts with codes are
listed before accounts without codes, in increasing code order. (Oth- listed before accounts without codes, in increasing code order. (Oth-
erwise, accounts are listed alphabetically.) Account codes should be erwise, accounts are listed alphabetically.) Account codes should be
all numeric digits, unique, and separated from the account name by at all numeric digits, unique, and separated from the account name by at
least two spaces (since account names may contain single spaces). By least two spaces (since account names may contain single spaces). By
convention, often the first digit indicates the type of account, as in convention, often the first digit indicates the type of account, as in
this numbering scheme and the example above. In future, we might use this numbering scheme and the example above. In future, we might use
this to recognize account types. this to recognize account types.
An account directive can also have indented subdirectives following it, An account directive can also have indented subdirectives following it,
@ -751,7 +783,7 @@ FILE FORMAT
some-tag:12345 some-tag:12345
Rewriting accounts Rewriting accounts
You can define aliases which rewrite your account names (after reading You can define aliases which rewrite your account names (after reading
the journal, before generating reports). hledger's account aliases can the journal, before generating reports). hledger's account aliases can
be useful for: be useful for:
@ -768,8 +800,8 @@ FILE FORMAT
See also Cookbook: Rewrite account names. See also Cookbook: Rewrite account names.
Basic aliases Basic aliases
To set an account alias, use the alias directive in your journal file. 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 This affects all subsequent journal entries in the current file or its
included files. The spaces around the = are optional: included files. The spaces around the = are optional:
alias OLD = NEW alias OLD = NEW
@ -777,54 +809,54 @@ FILE FORMAT
Or, you can use the --alias 'OLD=NEW' option on the command line. This 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. affects all entries. It's useful for trying out aliases interactively.
OLD and NEW are full account names. hledger will replace any occur- OLD and NEW are full account names. hledger will replace any occur-
rence of the old account name with the new one. Subaccounts are also rence of the old account name with the new one. Subaccounts are also
affected. Eg: affected. Eg:
alias checking = assets:bank:wells fargo:checking 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" # rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a"
Regex aliases 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: indicated by the forward slashes:
alias /REGEX/ = REPLACEMENT alias /REGEX/ = REPLACEMENT
or --alias '/REGEX/=REPLACEMENT'. or --alias '/REGEX/=REPLACEMENT'.
REGEX is a case-insensitive regular expression. Anywhere it matches REGEX is a case-insensitive regular expression. Anywhere it matches
inside an account name, the matched part will be replaced by REPLACE- inside an account name, the matched part will be replaced by REPLACE-
MENT. If REGEX contains parenthesised match groups, these can be ref- MENT. If REGEX contains parenthesised match groups, these can be ref-
erenced by the usual numeric backreferences in REPLACEMENT. Eg: erenced by the usual numeric backreferences in REPLACEMENT. Eg:
alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3
# rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking" # rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking"
Also note that REPLACEMENT continues to the end of line (or on command 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- line, to end of option argument), so it can contain trailing white-
space. space.
Multiple aliases Multiple aliases
You can define as many aliases as you like using directives or com- You can define as many aliases as you like using directives or com-
mand-line options. Aliases are recursive - each alias sees the result mand-line options. Aliases are recursive - each alias sees the result
of applying previous ones. (This is different from Ledger, where of applying previous ones. (This is different from Ledger, where
aliases are non-recursive by default). Aliases are applied in the fol- aliases are non-recursive by default). Aliases are applied in the fol-
lowing order: lowing order:
1. alias directives, most recently seen first (recent directives take 1. alias directives, most recently seen first (recent directives take
precedence over earlier ones; directives not yet seen are ignored) precedence over earlier ones; directives not yet seen are ignored)
2. alias options, in the order they appear on the command line 2. alias options, in the order they appear on the command line
end aliases end aliases
You can clear (forget) all currently defined aliases with the You can clear (forget) all currently defined aliases with the
end aliases directive: end aliases directive:
end aliases end aliases
Default parent account Default parent account
You can specify a parent account which will be prepended to all You can specify a parent account which will be prepended to all
accounts within a section of the journal. Use the apply account and accounts within a section of the journal. Use the apply account and
end apply account directives like so: end apply account directives like so:
apply account home apply account home
@ -841,7 +873,7 @@ FILE FORMAT
home:food $10 home:food $10
home:cash $-10 home:cash $-10
If end apply account is omitted, the effect lasts to the end of the If end apply account is omitted, the effect lasts to the end of the
file. Included files are also affected, eg: file. Included files are also affected, eg:
apply account business apply account business
@ -850,13 +882,13 @@ FILE FORMAT
apply account personal apply account personal
include personal.journal include personal.journal
Prior to hledger 1.0, legacy account and end spellings were also sup- Prior to hledger 1.0, legacy account and end spellings were also sup-
ported. ported.
Periodic transactions Periodic transactions
Periodic transaction rules (enabled by --forecast or --budget) describe Periodic transaction rules (enabled by --forecast or --budget) describe
recurring transactions. They look like a transaction where the first recurring transactions. They look like a transaction where the first
line is a tilde (~) followed by a period expression (mnemonic: ~ is line is a tilde (~) followed by a period expression (mnemonic: ~ is
like a recurring sine wave): like a recurring sine wave):
~ weekly ~ weekly
@ -865,29 +897,29 @@ FILE FORMAT
Periodic transactions have a dual purpose: Periodic transactions have a dual purpose:
o With --forecast, each periodic transaction rule generates future o With --forecast, each periodic transaction rule generates future
transactions, recurring at the specified interval, which can be seen transactions, recurring at the specified interval, which can be seen
in reports. Forecast transactions begin the day after the latest in reports. Forecast transactions begin the day after the latest
recorded journal transaction (or today, if there are no transactions) recorded journal transaction (or today, if there are no transactions)
and end 6 months from today (or at the report end date, if speci- and end 6 months from today (or at the report end date, if speci-
fied). fied).
o With --budget (supported by the balance command), each periodic o With --budget (supported by the balance command), each periodic
transaction rule declares recurring budget goals for the specified transaction rule declares recurring budget goals for the specified
accounts, which can be seen in budget reports. Eg the example above accounts, which can be seen in budget reports. Eg the example above
declares the goal of receiving $400 from income:acme inc (and also, declares the goal of receiving $400 from income:acme inc (and also,
depositing $400 into assets:bank:checking) every week. depositing $400 into assets:bank:checking) every week.
(Actually, you can generate one-off transactions too, by writing a (Actually, you can generate one-off transactions too, by writing a
period expression with no report interval.) period expression with no report interval.)
For more details, see: balance: Budget report and Cookbook: Budgeting For more details, see: balance: Budget report and Cookbook: Budgeting
and Forecasting. and Forecasting.
Automated postings Automated postings
Automated postings (enabled by --auto) are postings added automatically Automated postings (enabled by --auto) are postings added automatically
by rule to certain transactions. An automated posting rule looks like by rule to certain transactions. An automated posting rule looks like
a transaction where the first line is an equal sign (=) followed by a a transaction where the first line is an equal sign (=) followed by a
query (mnemonic: = tests for matching transactions, and also looks like query (mnemonic: = tests for matching transactions, and also looks like
posting lines): posting lines):
@ -895,13 +927,13 @@ FILE FORMAT
budget:gifts *-1 budget:gifts *-1
assets:budget *1 assets:budget *1
The posting amounts can be of the form *N, which means "the amount of The posting amounts can be of the form *N, which means "the amount of
the matched transaction's first posting, multiplied by N". They can the matched transaction's first posting, multiplied by N". They can
also be ordinary fixed amounts. Fixed amounts with no commodity symbol also be ordinary fixed amounts. Fixed amounts with no commodity symbol
will be given the same commodity as the matched transaction's first will be given the same commodity as the matched transaction's first
posting. posting.
This example adds a corresponding (unbalanced) budget posting to every This example adds a corresponding (unbalanced) budget posting to every
transaction involving the expenses:gifts account: transaction involving the expenses:gifts account:
= expenses:gifts = expenses:gifts
@ -917,16 +949,16 @@ FILE FORMAT
(budget:gifts) $-20 (budget:gifts) $-20
assets assets
Like postings recorded by hand, automated postings participate in Like postings recorded by hand, automated postings participate in
transaction balancing, missing amount inference and balance assertions. transaction balancing, missing amount inference and balance assertions.
EDITOR SUPPORT EDITOR SUPPORT
Add-on modes exist for various text editors, to make working with jour- Add-on modes exist for various text editors, to make working with jour-
nal files easier. They add colour, navigation aids and helpful com- nal files easier. They add colour, navigation aids and helpful com-
mands. For hledger users who edit the journal file directly (the mands. For hledger users who edit the journal file directly (the
majority), using one of these modes is quite recommended. majority), using one of these modes is quite recommended.
These were written with Ledger in mind, but also work with hledger These were written with Ledger in mind, but also work with hledger
files: files:
@ -945,7 +977,7 @@ EDITOR SUPPORT
REPORTING 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) or hledger mail list)
@ -959,7 +991,7 @@ COPYRIGHT
SEE ALSO 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- hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1) dot(5), ledger(1)

View File

@ -962,6 +962,9 @@ transaction time, if they have a transaction price specified.
.PP .PP
The \f[C]\-V/\-\-value\f[] flag converts reported amounts to their The \f[C]\-V/\-\-value\f[] flag converts reported amounts to their
current market value. current market value.
.PD 0
.P
.PD
Specifically, when there is a market price (P directive) for the Specifically, when there is a market price (P directive) for the
amount's commodity, dated on or before today's date (or the report end amount's commodity, dated on or before today's date (or the report end
date if specified), the amount will be converted to the price's date if specified), the amount will be converted to the price's

View File

@ -645,7 +645,8 @@ File: hledger.info, Node: Market value, Next: Combining -B and -V, Prev: Cost
================= =================
The '-V/--value' flag converts reported amounts to their current market The '-V/--value' flag converts reported amounts to their current market
value. Specifically, when there is a market price (P directive) for the value.
Specifically, when there is a market price (P directive) for the
amount's commodity, dated on or before today's date (or the report end amount's commodity, dated on or before today's date (or the report end
date if specified), the amount will be converted to the price's date if specified), the amount will be converted to the price's
commodity. commodity.
@ -2464,106 +2465,106 @@ Node: Cost21487
Ref: #cost21595 Ref: #cost21595
Node: Market value21713 Node: Market value21713
Ref: #market-value21848 Ref: #market-value21848
Node: Combining -B and -V23215 Node: Combining -B and -V23214
Ref: #combining--b-and--v23378 Ref: #combining--b-and--v23377
Node: Output destination23525 Node: Output destination23524
Ref: #output-destination23687 Ref: #output-destination23686
Node: Output format23970 Node: Output format23969
Ref: #output-format24122 Ref: #output-format24121
Node: Regular expressions24507 Node: Regular expressions24506
Ref: #regular-expressions24644 Ref: #regular-expressions24643
Node: QUERIES26005 Node: QUERIES26004
Ref: #queries26107 Ref: #queries26106
Node: COMMANDS30069 Node: COMMANDS30068
Ref: #commands30181 Ref: #commands30180
Node: accounts31163 Node: accounts31162
Ref: #accounts31261 Ref: #accounts31260
Node: activity32507 Node: activity32506
Ref: #activity32617 Ref: #activity32616
Node: add32977 Node: add32976
Ref: #add33076 Ref: #add33075
Node: balance35737 Node: balance35736
Ref: #balance35848 Ref: #balance35847
Node: Classic balance report38931 Node: Classic balance report38930
Ref: #classic-balance-report39104 Ref: #classic-balance-report39103
Node: Customising the classic balance report40473 Node: Customising the classic balance report40472
Ref: #customising-the-classic-balance-report40701 Ref: #customising-the-classic-balance-report40700
Node: Colour support42775 Node: Colour support42774
Ref: #colour-support42942 Ref: #colour-support42941
Node: Flat mode43115 Node: Flat mode43114
Ref: #flat-mode43263 Ref: #flat-mode43262
Node: Depth limited balance reports43676 Node: Depth limited balance reports43675
Ref: #depth-limited-balance-reports43876 Ref: #depth-limited-balance-reports43875
Node: Multicolumn balance report44332 Node: Multicolumn balance report44331
Ref: #multicolumn-balance-report44530 Ref: #multicolumn-balance-report44529
Node: Budget report49710 Node: Budget report49709
Ref: #budget-report49853 Ref: #budget-report49852
Ref: #output-format-152887 Ref: #output-format-152886
Node: balancesheet52965 Node: balancesheet52964
Ref: #balancesheet53101 Ref: #balancesheet53100
Node: balancesheetequity55412 Node: balancesheetequity55411
Ref: #balancesheetequity55561 Ref: #balancesheetequity55560
Node: cashflow56098 Node: cashflow56097
Ref: #cashflow56226 Ref: #cashflow56225
Node: check-dates58349 Node: check-dates58348
Ref: #check-dates58476 Ref: #check-dates58475
Node: check-dupes58593 Node: check-dupes58592
Ref: #check-dupes58717 Ref: #check-dupes58716
Node: close58854 Node: close58853
Ref: #close58961 Ref: #close58960
Node: help59291 Node: help59290
Ref: #help59391 Ref: #help59390
Node: import60465 Node: import60464
Ref: #import60579 Ref: #import60578
Node: incomestatement61309 Node: incomestatement61308
Ref: #incomestatement61443 Ref: #incomestatement61442
Node: prices63847 Node: prices63846
Ref: #prices63962 Ref: #prices63961
Node: print64005 Node: print64004
Ref: #print64115 Ref: #print64114
Node: print-unique69009 Node: print-unique69008
Ref: #print-unique69135 Ref: #print-unique69134
Node: register69203 Node: register69202
Ref: #register69330 Ref: #register69329
Node: Custom register output73831 Node: Custom register output73830
Ref: #custom-register-output73960 Ref: #custom-register-output73959
Node: register-match75190 Node: register-match75189
Ref: #register-match75324 Ref: #register-match75323
Node: rewrite75507 Node: rewrite75506
Ref: #rewrite75624 Ref: #rewrite75623
Node: stats75693 Node: stats75692
Ref: #stats75796 Ref: #stats75795
Node: tags76666 Node: tags76665
Ref: #tags76764 Ref: #tags76763
Node: test77000 Node: test76999
Ref: #test77084 Ref: #test77083
Node: ADD-ON COMMANDS77452 Node: ADD-ON COMMANDS77451
Ref: #add-on-commands77562 Ref: #add-on-commands77561
Node: Official add-ons78849 Node: Official add-ons78848
Ref: #official-add-ons78989 Ref: #official-add-ons78988
Node: api79076 Node: api79075
Ref: #api79165 Ref: #api79164
Node: ui79217 Node: ui79216
Ref: #ui79316 Ref: #ui79315
Node: web79374 Node: web79373
Ref: #web79463 Ref: #web79462
Node: Third party add-ons79509 Node: Third party add-ons79508
Ref: #third-party-add-ons79684 Ref: #third-party-add-ons79683
Node: diff79819 Node: diff79818
Ref: #diff79916 Ref: #diff79915
Node: iadd80015 Node: iadd80014
Ref: #iadd80129 Ref: #iadd80128
Node: interest80212 Node: interest80211
Ref: #interest80333 Ref: #interest80332
Node: irr80428 Node: irr80427
Ref: #irr80526 Ref: #irr80525
Node: Experimental add-ons80604 Node: Experimental add-ons80603
Ref: #experimental-add-ons80756 Ref: #experimental-add-ons80755
Node: autosync81036 Node: autosync81035
Ref: #autosync81147 Ref: #autosync81146
Node: chart81386 Node: chart81385
Ref: #chart81505 Ref: #chart81504
Node: check81576 Node: check81575
Ref: #check81678 Ref: #check81677
 
End Tag Table End Tag Table

View File

@ -611,10 +611,11 @@ OPTIONS
Market value Market value
The -V/--value flag converts reported amounts to their current market The -V/--value flag converts reported amounts to their current market
value. Specifically, when there is a market price (P directive) for value.
the amount's commodity, dated on or before today's date (or the report Specifically, when there is a market price (P directive) for the
end date if specified), the amount will be converted to the price's amount's commodity, dated on or before today's date (or the report end
commodity. date if specified), the amount will be converted to the price's commod-
ity.
When there are multiple applicable P directives, -V chooses the most When there are multiple applicable P directives, -V chooses the most
recent one, or in case of equal dates, the last-parsed one. recent one, or in case of equal dates, the last-parsed one.