update embedded manuals
[ci skip]
This commit is contained in:
parent
312bf2fcb5
commit
42f47e2b6b
@ -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
|
||||
(like \f[C]$1000.00\f[]).
|
||||
.PP
|
||||
Price amounts and amounts in D directives usually don't affect amount
|
||||
format inference, but in some situations they can do so indirectly.
|
||||
Price amounts and amounts in \f[C]D\f[] directives usually don't affect
|
||||
amount format inference, but in some situations they can do so
|
||||
indirectly.
|
||||
(Eg when D's default commodity is applied to a commodity\-less amount,
|
||||
or when an amountless posting is balanced using a price's commodity, or
|
||||
when \-V is used.) If you find this causing problems, set the desired
|
||||
@ -627,7 +628,6 @@ assignment).
|
||||
Note that using balance assignments makes your journal a little less
|
||||
explicit; to know the exact amount posted, you have to run hledger or do
|
||||
the calculations yourself, instead of just reading it.
|
||||
.SS Prices
|
||||
.SS Transaction prices
|
||||
.PP
|
||||
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).
|
||||
For example, transaction prices are useful to record purchases of a
|
||||
foreign currency.
|
||||
.PP
|
||||
Transaction prices are fixed, and do not change over time.
|
||||
(Ledger users: Ledger uses a different syntax for fixed prices,
|
||||
\f[C]{=UNITPRICE}\f[], which hledger currently ignores).
|
||||
Note transaction prices are fixed at the time of the transaction, and do
|
||||
not change over time.
|
||||
See also market prices, which represent prevailing exchange rates on a
|
||||
certain date.
|
||||
.PP
|
||||
There are several ways to record a transaction price:
|
||||
.IP "1." 3
|
||||
@ -680,10 +680,13 @@ hledger infer the price that balances the transaction:
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Amounts with transaction prices can be displayed in the transaction
|
||||
price's commodity by using the \f[C]\-B/\-\-cost\f[] flag (except for
|
||||
#551) (\[lq]B\[rq] is from \[lq]cost Basis\[rq]).
|
||||
Eg for the above, here is how \-B affects the balance report:
|
||||
(Ledger users: Ledger uses a different syntax for fixed prices,
|
||||
\f[C]{=UNITPRICE}\f[], which hledger currently ignores).
|
||||
.PP
|
||||
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
|
||||
.nf
|
||||
\f[C]
|
||||
@ -717,40 +720,6 @@ $\ hledger\ bal\ \-N\ \-\-flat\ \-B
|
||||
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros
|
||||
\f[]
|
||||
.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
|
||||
.PP
|
||||
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
|
||||
simple strings.
|
||||
.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
|
||||
.PP
|
||||
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).
|
||||
.SS Default commodity
|
||||
.PP
|
||||
The D directive sets a default commodity (and display format), to be
|
||||
used for amounts without a commodity symbol (ie, plain numbers).
|
||||
The \f[C]D\f[] directive sets a default commodity (and display format),
|
||||
to be used for amounts without a commodity symbol (ie, plain numbers).
|
||||
(Note this differs from Ledger's default commodity directive.) The
|
||||
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
|
||||
.nf
|
||||
\f[C]
|
||||
@ -966,6 +982,41 @@ D\ $1,000.00
|
||||
.PP
|
||||
As with the \f[C]commodity\f[] directive, the amount must always be
|
||||
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
|
||||
.PP
|
||||
The \f[C]account\f[] directive predeclares account names.
|
||||
|
||||
@ -77,7 +77,7 @@ File: hledger_journal.info, Node: FILE FORMAT, Next: EDITOR SUPPORT, Prev: To
|
||||
* Virtual Postings::
|
||||
* Balance Assertions::
|
||||
* Balance Assignments::
|
||||
* Prices::
|
||||
* Transaction prices::
|
||||
* Comments::
|
||||
* Tags::
|
||||
* 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
|
||||
used (like '$1000.00').
|
||||
|
||||
Price amounts and amounts in D directives usually don't affect amount
|
||||
format inference, but in some situations they can do so indirectly. (Eg
|
||||
when D's default commodity is applied to a commodity-less amount, 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
|
||||
format with a commodity directive.
|
||||
Price amounts and amounts in 'D' directives usually don't affect
|
||||
amount format inference, but in some situations they can do so
|
||||
indirectly. (Eg when D's default commodity is applied to a
|
||||
commodity-less amount, or when an amountless posting is balanced using a
|
||||
price's commodity, or when -V is used.) If you find this causing
|
||||
problems, set the desired format with a commodity directive.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
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
|
||||
========================
|
||||
@ -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.
|
||||
|
||||
|
||||
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
|
||||
===========
|
||||
|
||||
* Menu:
|
||||
|
||||
* Transaction prices::
|
||||
* Market prices::
|
||||
|
||||
|
||||
File: hledger_journal.info, Node: Transaction prices, Next: Market prices, Up: Prices
|
||||
|
||||
1.11.1 Transaction prices
|
||||
-------------------------
|
||||
1.11 Transaction prices
|
||||
=======================
|
||||
|
||||
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
|
||||
selling price (in a sale). For example, transaction prices are useful
|
||||
to record purchases of a foreign currency.
|
||||
|
||||
Transaction prices are fixed, and do not change over time. (Ledger
|
||||
users: Ledger uses a different syntax for fixed prices, '{=UNITPRICE}',
|
||||
which hledger currently ignores).
|
||||
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
|
||||
also market prices, which represent prevailing exchange rates on a
|
||||
certain date.
|
||||
|
||||
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:dollars $-135 ; for $135
|
||||
|
||||
Amounts with transaction prices can be displayed in the transaction
|
||||
price's commodity by using the '-B/--cost' flag (except for #551) ("B"
|
||||
is from "cost Basis"). Eg for the above, here is how -B affects the
|
||||
balance report:
|
||||
(Ledger users: Ledger uses a different syntax for fixed prices,
|
||||
'{=UNITPRICE}', which hledger currently ignores).
|
||||
|
||||
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
|
||||
$-135 assets:dollars
|
||||
@ -674,36 +665,7 @@ $ hledger bal -N --flat -B
|
||||
€100 assets:euros
|
||||
|
||||
|
||||
File: hledger_journal.info, Node: Market prices, Prev: Transaction prices, Up: Prices
|
||||
|
||||
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
|
||||
File: hledger_journal.info, Node: Comments, Next: Tags, Prev: Transaction prices, Up: FILE FORMAT
|
||||
|
||||
1.12 Comments
|
||||
=============
|
||||
@ -792,21 +754,55 @@ File: hledger_journal.info, Node: Directives, Next: Periodic transactions, Pr
|
||||
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:
|
||||
|
||||
* Directive scope multiple files::
|
||||
* Comment blocks::
|
||||
* Including other files::
|
||||
* Default year::
|
||||
* Declaring commodities::
|
||||
* Default commodity::
|
||||
* Market prices::
|
||||
* Declaring accounts::
|
||||
* Rewriting accounts::
|
||||
* 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,
|
||||
@ -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
|
||||
|
||||
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
|
||||
@ -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
|
||||
|
||||
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
|
||||
@ -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
|
||||
|
||||
1.14.4 Declaring commodities
|
||||
1.14.5 Declaring commodities
|
||||
----------------------------
|
||||
|
||||
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).
|
||||
|
||||
|
||||
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
|
||||
this differs from Ledger's default commodity directive.) The commodity
|
||||
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
|
||||
# (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.
|
||||
|
||||
|
||||
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
|
||||
@ -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
|
||||
|
||||
1.14.7 Rewriting accounts
|
||||
1.14.9 Rewriting accounts
|
||||
-------------------------
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
@ -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
|
||||
|
||||
1.14.7.2 Regex aliases
|
||||
1.14.9.2 Regex aliases
|
||||
......................
|
||||
|
||||
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
|
||||
|
||||
1.14.7.3 Multiple aliases
|
||||
1.14.9.3 Multiple aliases
|
||||
.........................
|
||||
|
||||
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
|
||||
|
||||
1.14.7.4 'end aliases'
|
||||
1.14.9.4 'end aliases'
|
||||
......................
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
within a section of the journal. Use the 'apply account' and 'end apply
|
||||
@ -1204,87 +1230,87 @@ Tag Table:
|
||||
Node: Top76
|
||||
Node: FILE FORMAT2376
|
||||
Ref: #file-format2500
|
||||
Node: Transactions2772
|
||||
Ref: #transactions2893
|
||||
Node: Postings3577
|
||||
Ref: #postings3704
|
||||
Node: Dates4699
|
||||
Ref: #dates4814
|
||||
Node: Simple dates4879
|
||||
Ref: #simple-dates5005
|
||||
Node: Secondary dates5371
|
||||
Ref: #secondary-dates5525
|
||||
Node: Posting dates7088
|
||||
Ref: #posting-dates7217
|
||||
Node: Status8591
|
||||
Ref: #status8711
|
||||
Node: Description10419
|
||||
Ref: #description10557
|
||||
Node: Payee and note10876
|
||||
Ref: #payee-and-note10990
|
||||
Node: Account names11232
|
||||
Ref: #account-names11375
|
||||
Node: Amounts11862
|
||||
Ref: #amounts11998
|
||||
Node: Virtual Postings15013
|
||||
Ref: #virtual-postings15172
|
||||
Node: Balance Assertions16392
|
||||
Ref: #balance-assertions16567
|
||||
Node: Assertions and ordering17463
|
||||
Ref: #assertions-and-ordering17649
|
||||
Node: Assertions and included files18349
|
||||
Ref: #assertions-and-included-files18590
|
||||
Node: Assertions and multiple -f options18923
|
||||
Ref: #assertions-and-multiple--f-options19177
|
||||
Node: Assertions and commodities19309
|
||||
Ref: #assertions-and-commodities19544
|
||||
Node: Assertions and subaccounts20240
|
||||
Ref: #assertions-and-subaccounts20472
|
||||
Node: Assertions and virtual postings20993
|
||||
Ref: #assertions-and-virtual-postings21200
|
||||
Node: Balance Assignments21342
|
||||
Ref: #balance-assignments21511
|
||||
Node: Prices22631
|
||||
Ref: #prices22764
|
||||
Node: Transaction prices22815
|
||||
Ref: #transaction-prices22960
|
||||
Node: Market prices25116
|
||||
Ref: #market-prices25251
|
||||
Node: Comments26211
|
||||
Ref: #comments26333
|
||||
Node: Tags27503
|
||||
Ref: #tags27621
|
||||
Node: Directives29023
|
||||
Ref: #directives29166
|
||||
Node: Comment blocks29359
|
||||
Ref: #comment-blocks29504
|
||||
Node: Including other files29680
|
||||
Ref: #including-other-files29860
|
||||
Node: Default year30249
|
||||
Ref: #default-year30418
|
||||
Node: Declaring commodities30841
|
||||
Ref: #declaring-commodities31024
|
||||
Node: Default commodity32251
|
||||
Ref: #default-commodity32432
|
||||
Node: Declaring accounts33064
|
||||
Ref: #declaring-accounts33244
|
||||
Node: Rewriting accounts34591
|
||||
Ref: #rewriting-accounts34776
|
||||
Node: Basic aliases35380
|
||||
Ref: #basic-aliases35526
|
||||
Node: Regex aliases36216
|
||||
Ref: #regex-aliases36387
|
||||
Node: Multiple aliases37105
|
||||
Ref: #multiple-aliases37280
|
||||
Node: end aliases37778
|
||||
Ref: #end-aliases37925
|
||||
Node: Default parent account38026
|
||||
Ref: #default-parent-account38192
|
||||
Node: Periodic transactions38851
|
||||
Ref: #periodic-transactions39030
|
||||
Node: Automated postings40329
|
||||
Ref: #automated-postings40483
|
||||
Node: EDITOR SUPPORT41616
|
||||
Ref: #editor-support41734
|
||||
Node: Transactions2784
|
||||
Ref: #transactions2905
|
||||
Node: Postings3589
|
||||
Ref: #postings3716
|
||||
Node: Dates4711
|
||||
Ref: #dates4826
|
||||
Node: Simple dates4891
|
||||
Ref: #simple-dates5017
|
||||
Node: Secondary dates5383
|
||||
Ref: #secondary-dates5537
|
||||
Node: Posting dates7100
|
||||
Ref: #posting-dates7229
|
||||
Node: Status8603
|
||||
Ref: #status8723
|
||||
Node: Description10431
|
||||
Ref: #description10569
|
||||
Node: Payee and note10888
|
||||
Ref: #payee-and-note11002
|
||||
Node: Account names11244
|
||||
Ref: #account-names11387
|
||||
Node: Amounts11874
|
||||
Ref: #amounts12010
|
||||
Node: Virtual Postings15027
|
||||
Ref: #virtual-postings15186
|
||||
Node: Balance Assertions16406
|
||||
Ref: #balance-assertions16581
|
||||
Node: Assertions and ordering17477
|
||||
Ref: #assertions-and-ordering17663
|
||||
Node: Assertions and included files18363
|
||||
Ref: #assertions-and-included-files18604
|
||||
Node: Assertions and multiple -f options18937
|
||||
Ref: #assertions-and-multiple--f-options19191
|
||||
Node: Assertions and commodities19323
|
||||
Ref: #assertions-and-commodities19558
|
||||
Node: Assertions and subaccounts20254
|
||||
Ref: #assertions-and-subaccounts20486
|
||||
Node: Assertions and virtual postings21007
|
||||
Ref: #assertions-and-virtual-postings21214
|
||||
Node: Balance Assignments21356
|
||||
Ref: #balance-assignments21537
|
||||
Node: Transaction prices22657
|
||||
Ref: #transaction-prices22826
|
||||
Node: Comments25094
|
||||
Ref: #comments25228
|
||||
Node: Tags26398
|
||||
Ref: #tags26516
|
||||
Node: Directives27918
|
||||
Ref: #directives28061
|
||||
Node: Directive scope multiple files28517
|
||||
Ref: #directive-scope-multiple-files28705
|
||||
Node: Comment blocks29655
|
||||
Ref: #comment-blocks29839
|
||||
Node: Including other files30015
|
||||
Ref: #including-other-files30195
|
||||
Node: Default year30584
|
||||
Ref: #default-year30753
|
||||
Node: Declaring commodities31176
|
||||
Ref: #declaring-commodities31359
|
||||
Node: Default commodity32586
|
||||
Ref: #default-commodity32762
|
||||
Node: Market prices33398
|
||||
Ref: #market-prices33563
|
||||
Node: Declaring accounts34404
|
||||
Ref: #declaring-accounts34580
|
||||
Node: Rewriting accounts35927
|
||||
Ref: #rewriting-accounts36112
|
||||
Node: Basic aliases36716
|
||||
Ref: #basic-aliases36862
|
||||
Node: Regex aliases37552
|
||||
Ref: #regex-aliases37723
|
||||
Node: Multiple aliases38441
|
||||
Ref: #multiple-aliases38616
|
||||
Node: end aliases39114
|
||||
Ref: #end-aliases39261
|
||||
Node: Default parent account39362
|
||||
Ref: #default-parent-account39530
|
||||
Node: Periodic transactions40189
|
||||
Ref: #periodic-transactions40368
|
||||
Node: Automated postings41667
|
||||
Ref: #automated-postings41821
|
||||
Node: EDITOR SUPPORT42954
|
||||
Ref: #editor-support43072
|
||||
|
||||
End Tag Table
|
||||
|
||||
@ -466,16 +466,14 @@ FILE FORMAT
|
||||
less explicit; to know the exact amount posted, you have to run hledger
|
||||
or do the calculations yourself, instead of just reading it.
|
||||
|
||||
Prices
|
||||
Transaction prices
|
||||
Within a transaction, you can note an amount's price in another commod-
|
||||
ity. This can be used to document the cost (in a purchase) or selling
|
||||
price (in a sale). For example, transaction prices are useful to
|
||||
record purchases of a foreign currency.
|
||||
|
||||
Transaction prices are fixed, and do not change over time. (Ledger
|
||||
users: Ledger uses a different syntax for fixed prices, {=UNITPRICE},
|
||||
which hledger currently ignores).
|
||||
record purchases of a foreign currency. Note transaction prices are
|
||||
fixed at the time of the transaction, and do not change over time. See
|
||||
also market prices, which represent prevailing exchange rates on a cer-
|
||||
tain date.
|
||||
|
||||
There are several ways to record a transaction price:
|
||||
|
||||
@ -498,10 +496,12 @@ FILE FORMAT
|
||||
assets:euros 100 ; one hundred euros purchased
|
||||
assets:dollars $-135 ; for $135
|
||||
|
||||
Amounts with transaction prices can be displayed in the transaction
|
||||
price's commodity by using the -B/--cost flag (except for #551) ("B" is
|
||||
from "cost Basis"). Eg for the above, here is how -B affects the bal-
|
||||
ance report:
|
||||
(Ledger users: Ledger uses a different syntax for fixed prices, {=UNIT-
|
||||
PRICE}, which hledger currently ignores).
|
||||
|
||||
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
|
||||
$-135 assets:dollars
|
||||
@ -523,30 +523,6 @@ FILE FORMAT
|
||||
-100 assets:dollars # <- the dollars' selling price
|
||||
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
|
||||
Lines in the journal beginning with a semicolon (;) or hash (#) or star
|
||||
(*) are comments, and will be ignored. (Star comments cause org-mode
|
||||
@ -624,6 +600,36 @@ FILE FORMAT
|
||||
are simple strings.
|
||||
|
||||
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
|
||||
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)
|
||||
@ -713,6 +719,32 @@ FILE FORMAT
|
||||
As with the commodity directive, the amount must always be written with
|
||||
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
|
||||
The account directive predeclares account names. The simplest form is
|
||||
account ACCTNAME, eg:
|
||||
|
||||
@ -962,6 +962,9 @@ transaction time, if they have a transaction price specified.
|
||||
.PP
|
||||
The \f[C]\-V/\-\-value\f[] flag converts reported amounts to their
|
||||
current market value.
|
||||
.PD 0
|
||||
.P
|
||||
.PD
|
||||
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
|
||||
date if specified), the amount will be converted to the price's
|
||||
|
||||
@ -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
|
||||
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
|
||||
date if specified), the amount will be converted to the price's
|
||||
commodity.
|
||||
@ -2464,106 +2465,106 @@ Node: Cost21487
|
||||
Ref: #cost21595
|
||||
Node: Market value21713
|
||||
Ref: #market-value21848
|
||||
Node: Combining -B and -V23215
|
||||
Ref: #combining--b-and--v23378
|
||||
Node: Output destination23525
|
||||
Ref: #output-destination23687
|
||||
Node: Output format23970
|
||||
Ref: #output-format24122
|
||||
Node: Regular expressions24507
|
||||
Ref: #regular-expressions24644
|
||||
Node: QUERIES26005
|
||||
Ref: #queries26107
|
||||
Node: COMMANDS30069
|
||||
Ref: #commands30181
|
||||
Node: accounts31163
|
||||
Ref: #accounts31261
|
||||
Node: activity32507
|
||||
Ref: #activity32617
|
||||
Node: add32977
|
||||
Ref: #add33076
|
||||
Node: balance35737
|
||||
Ref: #balance35848
|
||||
Node: Classic balance report38931
|
||||
Ref: #classic-balance-report39104
|
||||
Node: Customising the classic balance report40473
|
||||
Ref: #customising-the-classic-balance-report40701
|
||||
Node: Colour support42775
|
||||
Ref: #colour-support42942
|
||||
Node: Flat mode43115
|
||||
Ref: #flat-mode43263
|
||||
Node: Depth limited balance reports43676
|
||||
Ref: #depth-limited-balance-reports43876
|
||||
Node: Multicolumn balance report44332
|
||||
Ref: #multicolumn-balance-report44530
|
||||
Node: Budget report49710
|
||||
Ref: #budget-report49853
|
||||
Ref: #output-format-152887
|
||||
Node: balancesheet52965
|
||||
Ref: #balancesheet53101
|
||||
Node: balancesheetequity55412
|
||||
Ref: #balancesheetequity55561
|
||||
Node: cashflow56098
|
||||
Ref: #cashflow56226
|
||||
Node: check-dates58349
|
||||
Ref: #check-dates58476
|
||||
Node: check-dupes58593
|
||||
Ref: #check-dupes58717
|
||||
Node: close58854
|
||||
Ref: #close58961
|
||||
Node: help59291
|
||||
Ref: #help59391
|
||||
Node: import60465
|
||||
Ref: #import60579
|
||||
Node: incomestatement61309
|
||||
Ref: #incomestatement61443
|
||||
Node: prices63847
|
||||
Ref: #prices63962
|
||||
Node: print64005
|
||||
Ref: #print64115
|
||||
Node: print-unique69009
|
||||
Ref: #print-unique69135
|
||||
Node: register69203
|
||||
Ref: #register69330
|
||||
Node: Custom register output73831
|
||||
Ref: #custom-register-output73960
|
||||
Node: register-match75190
|
||||
Ref: #register-match75324
|
||||
Node: rewrite75507
|
||||
Ref: #rewrite75624
|
||||
Node: stats75693
|
||||
Ref: #stats75796
|
||||
Node: tags76666
|
||||
Ref: #tags76764
|
||||
Node: test77000
|
||||
Ref: #test77084
|
||||
Node: ADD-ON COMMANDS77452
|
||||
Ref: #add-on-commands77562
|
||||
Node: Official add-ons78849
|
||||
Ref: #official-add-ons78989
|
||||
Node: api79076
|
||||
Ref: #api79165
|
||||
Node: ui79217
|
||||
Ref: #ui79316
|
||||
Node: web79374
|
||||
Ref: #web79463
|
||||
Node: Third party add-ons79509
|
||||
Ref: #third-party-add-ons79684
|
||||
Node: diff79819
|
||||
Ref: #diff79916
|
||||
Node: iadd80015
|
||||
Ref: #iadd80129
|
||||
Node: interest80212
|
||||
Ref: #interest80333
|
||||
Node: irr80428
|
||||
Ref: #irr80526
|
||||
Node: Experimental add-ons80604
|
||||
Ref: #experimental-add-ons80756
|
||||
Node: autosync81036
|
||||
Ref: #autosync81147
|
||||
Node: chart81386
|
||||
Ref: #chart81505
|
||||
Node: check81576
|
||||
Ref: #check81678
|
||||
Node: Combining -B and -V23214
|
||||
Ref: #combining--b-and--v23377
|
||||
Node: Output destination23524
|
||||
Ref: #output-destination23686
|
||||
Node: Output format23969
|
||||
Ref: #output-format24121
|
||||
Node: Regular expressions24506
|
||||
Ref: #regular-expressions24643
|
||||
Node: QUERIES26004
|
||||
Ref: #queries26106
|
||||
Node: COMMANDS30068
|
||||
Ref: #commands30180
|
||||
Node: accounts31162
|
||||
Ref: #accounts31260
|
||||
Node: activity32506
|
||||
Ref: #activity32616
|
||||
Node: add32976
|
||||
Ref: #add33075
|
||||
Node: balance35736
|
||||
Ref: #balance35847
|
||||
Node: Classic balance report38930
|
||||
Ref: #classic-balance-report39103
|
||||
Node: Customising the classic balance report40472
|
||||
Ref: #customising-the-classic-balance-report40700
|
||||
Node: Colour support42774
|
||||
Ref: #colour-support42941
|
||||
Node: Flat mode43114
|
||||
Ref: #flat-mode43262
|
||||
Node: Depth limited balance reports43675
|
||||
Ref: #depth-limited-balance-reports43875
|
||||
Node: Multicolumn balance report44331
|
||||
Ref: #multicolumn-balance-report44529
|
||||
Node: Budget report49709
|
||||
Ref: #budget-report49852
|
||||
Ref: #output-format-152886
|
||||
Node: balancesheet52964
|
||||
Ref: #balancesheet53100
|
||||
Node: balancesheetequity55411
|
||||
Ref: #balancesheetequity55560
|
||||
Node: cashflow56097
|
||||
Ref: #cashflow56225
|
||||
Node: check-dates58348
|
||||
Ref: #check-dates58475
|
||||
Node: check-dupes58592
|
||||
Ref: #check-dupes58716
|
||||
Node: close58853
|
||||
Ref: #close58960
|
||||
Node: help59290
|
||||
Ref: #help59390
|
||||
Node: import60464
|
||||
Ref: #import60578
|
||||
Node: incomestatement61308
|
||||
Ref: #incomestatement61442
|
||||
Node: prices63846
|
||||
Ref: #prices63961
|
||||
Node: print64004
|
||||
Ref: #print64114
|
||||
Node: print-unique69008
|
||||
Ref: #print-unique69134
|
||||
Node: register69202
|
||||
Ref: #register69329
|
||||
Node: Custom register output73830
|
||||
Ref: #custom-register-output73959
|
||||
Node: register-match75189
|
||||
Ref: #register-match75323
|
||||
Node: rewrite75506
|
||||
Ref: #rewrite75623
|
||||
Node: stats75692
|
||||
Ref: #stats75795
|
||||
Node: tags76665
|
||||
Ref: #tags76763
|
||||
Node: test76999
|
||||
Ref: #test77083
|
||||
Node: ADD-ON COMMANDS77451
|
||||
Ref: #add-on-commands77561
|
||||
Node: Official add-ons78848
|
||||
Ref: #official-add-ons78988
|
||||
Node: api79075
|
||||
Ref: #api79164
|
||||
Node: ui79216
|
||||
Ref: #ui79315
|
||||
Node: web79373
|
||||
Ref: #web79462
|
||||
Node: Third party add-ons79508
|
||||
Ref: #third-party-add-ons79683
|
||||
Node: diff79818
|
||||
Ref: #diff79915
|
||||
Node: iadd80014
|
||||
Ref: #iadd80128
|
||||
Node: interest80211
|
||||
Ref: #interest80332
|
||||
Node: irr80427
|
||||
Ref: #irr80525
|
||||
Node: Experimental add-ons80603
|
||||
Ref: #experimental-add-ons80755
|
||||
Node: autosync81035
|
||||
Ref: #autosync81146
|
||||
Node: chart81385
|
||||
Ref: #chart81504
|
||||
Node: check81575
|
||||
Ref: #check81677
|
||||
|
||||
End Tag Table
|
||||
|
||||
@ -611,10 +611,11 @@ OPTIONS
|
||||
|
||||
Market value
|
||||
The -V/--value flag converts reported amounts to their current market
|
||||
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 date if specified), the amount will be converted to the price's
|
||||
commodity.
|
||||
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
|
||||
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
|
||||
recent one, or in case of equal dates, the last-parsed one.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user