;doc: update manuals
This commit is contained in:
parent
2b978869dd
commit
460a1fc209
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
.TH "HLEDGER-UI" "1" "December 2021" "hledger-ui-1.24.99 " "hledger User Manuals"
|
.TH "HLEDGER-UI" "1" "December 2021" "hledger-ui-1.25.99 " "hledger User Manuals"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
.PP
|
.PP
|
||||||
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
||||||
tool.
|
tool.
|
||||||
This manual is for hledger-ui 1.24.99.
|
This manual is for hledger-ui 1.25.99.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\f[C]hledger-ui [OPTIONS] [QUERYARGS]\f[R]
|
\f[C]hledger-ui [OPTIONS] [QUERYARGS]\f[R]
|
||||||
|
|||||||
@ -12,7 +12,7 @@ hledger-ui(1)
|
|||||||
*************
|
*************
|
||||||
|
|
||||||
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
||||||
tool. This manual is for hledger-ui 1.24.99.
|
tool. This manual is for hledger-ui 1.25.99.
|
||||||
|
|
||||||
'hledger-ui [OPTIONS] [QUERYARGS]'
|
'hledger-ui [OPTIONS] [QUERYARGS]'
|
||||||
'hledger ui -- [OPTIONS] [QUERYARGS]'
|
'hledger ui -- [OPTIONS] [QUERYARGS]'
|
||||||
|
|||||||
@ -5,7 +5,7 @@ HLEDGER-UI(1) hledger User Manuals HLEDGER-UI(1)
|
|||||||
|
|
||||||
NAME
|
NAME
|
||||||
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
hledger-ui is a terminal interface (TUI) for the hledger accounting
|
||||||
tool. This manual is for hledger-ui 1.24.99.
|
tool. This manual is for hledger-ui 1.25.99.
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
hledger-ui [OPTIONS] [QUERYARGS]
|
hledger-ui [OPTIONS] [QUERYARGS]
|
||||||
@ -548,4 +548,4 @@ SEE ALSO
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
hledger-ui-1.24.99 December 2021 HLEDGER-UI(1)
|
hledger-ui-1.25.99 December 2021 HLEDGER-UI(1)
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
.TH "HLEDGER-WEB" "1" "December 2021" "hledger-web-1.24.99 " "hledger User Manuals"
|
.TH "HLEDGER-WEB" "1" "December 2021" "hledger-web-1.25.99 " "hledger User Manuals"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
||||||
This manual is for hledger-web 1.24.99.
|
This manual is for hledger-web 1.25.99.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\f[C]hledger-web [OPTIONS]\f[R]
|
\f[C]hledger-web [OPTIONS]\f[R]
|
||||||
|
|||||||
@ -12,7 +12,7 @@ hledger-web(1)
|
|||||||
**************
|
**************
|
||||||
|
|
||||||
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
||||||
This manual is for hledger-web 1.24.99.
|
This manual is for hledger-web 1.25.99.
|
||||||
|
|
||||||
'hledger-web [OPTIONS]'
|
'hledger-web [OPTIONS]'
|
||||||
'hledger web -- [OPTIONS]'
|
'hledger web -- [OPTIONS]'
|
||||||
|
|||||||
@ -5,7 +5,7 @@ HLEDGER-WEB(1) hledger User Manuals HLEDGER-WEB(1)
|
|||||||
|
|
||||||
NAME
|
NAME
|
||||||
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
hledger-web is a web interface (WUI) for the hledger accounting tool.
|
||||||
This manual is for hledger-web 1.24.99.
|
This manual is for hledger-web 1.25.99.
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
hledger-web [OPTIONS]
|
hledger-web [OPTIONS]
|
||||||
@ -585,4 +585,4 @@ SEE ALSO
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
hledger-web-1.24.99 December 2021 HLEDGER-WEB(1)
|
hledger-web-1.25.99 December 2021 HLEDGER-WEB(1)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
.\"t
|
.\"t
|
||||||
|
|
||||||
.TH "HLEDGER" "1" "December 2021" "hledger-1.24.99 " "hledger User Manuals"
|
.TH "HLEDGER" "1" "December 2021" "hledger-1.25.99 " "hledger User Manuals"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
This is the command-line interface (CLI) for the hledger accounting
|
This is the command-line interface (CLI) for the hledger accounting
|
||||||
tool.
|
tool.
|
||||||
Here we also describe hledger\[aq]s concepts and file formats.
|
Here we also describe hledger\[aq]s concepts and file formats.
|
||||||
This manual is for hledger 1.24.99.
|
This manual is for hledger 1.25.99.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.PP
|
.PP
|
||||||
\f[C]hledger\f[R]
|
\f[C]hledger\f[R]
|
||||||
@ -706,8 +706,8 @@ Are all commodities declared with a \f[C]commodity\f[R] directive ?
|
|||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
Are all commodity conversions declared explicitly ?
|
Are all commodity conversions declared explicitly ?
|
||||||
.PP
|
.PP
|
||||||
You can also use the check command to run these and some additional
|
You can use the check command to run individual checks -- the ones
|
||||||
checks.
|
listed above and some more.
|
||||||
.SH TIME PERIODS
|
.SH TIME PERIODS
|
||||||
.SS Smart dates
|
.SS Smart dates
|
||||||
.PP
|
.PP
|
||||||
@ -1464,14 +1464,32 @@ Match real or virtual postings respectively.
|
|||||||
.PD
|
.PD
|
||||||
Match unmarked, pending, or cleared transactions respectively.
|
Match unmarked, pending, or cleared transactions respectively.
|
||||||
.PP
|
.PP
|
||||||
|
\f[B]\f[CB]type:TYPECODES\f[B]\f[R]
|
||||||
|
.PD 0
|
||||||
|
.P
|
||||||
|
.PD
|
||||||
|
Match by account type (see Declaring accounts > Account types).
|
||||||
|
\f[C]TYPECODES\f[R] is one or more of the single-letter account type
|
||||||
|
codes \f[C]ALERXCV\f[R], case insensitive.
|
||||||
|
Note \f[C]type:A\f[R] and \f[C]type:E\f[R] will also match their
|
||||||
|
respective subtypes \f[C]C\f[R] (Cash) and \f[C]V\f[R] (Conversion).
|
||||||
|
Certain kinds of account alias can disrupt account types, see Rewriting
|
||||||
|
accounts > Aliases and account types.
|
||||||
|
.PP
|
||||||
\f[B]\f[CB]tag:REGEX[=REGEX]\f[B]\f[R]
|
\f[B]\f[CB]tag:REGEX[=REGEX]\f[B]\f[R]
|
||||||
.PD 0
|
.PD 0
|
||||||
.P
|
.P
|
||||||
.PD
|
.PD
|
||||||
Match by tag name, and optionally also by tag value.
|
Match by tag name, and optionally also by tag value.
|
||||||
(To match only by value, use \f[C]tag:.=REGEX\f[R].) Note that postings
|
(To match only by value, use \f[C]tag:.=REGEX\f[R].)
|
||||||
also inherit tags from their transaction, and transactions also acquire
|
.PP
|
||||||
tags from their postings, when querying.
|
When querying by tag, note that:
|
||||||
|
.IP \[bu] 2
|
||||||
|
Accounts also inherit the tags of their parent accounts
|
||||||
|
.IP \[bu] 2
|
||||||
|
Postings also inherit the tags of their account and their transaction
|
||||||
|
.IP \[bu] 2
|
||||||
|
Transactions also acquire the tags of their postings.
|
||||||
.PP
|
.PP
|
||||||
(\f[B]\f[CB]inacct:ACCTNAME\f[B]\f[R]
|
(\f[B]\f[CB]inacct:ACCTNAME\f[B]\f[R]
|
||||||
.PD 0
|
.PD 0
|
||||||
@ -2934,6 +2952,10 @@ account name components.
|
|||||||
Account names can be depth-clipped with \f[C]depth:N\f[R] or
|
Account names can be depth-clipped with \f[C]depth:N\f[R] or
|
||||||
\f[C]--depth N\f[R] or \f[C]-N\f[R].
|
\f[C]--depth N\f[R] or \f[C]-N\f[R].
|
||||||
.PP
|
.PP
|
||||||
|
With \f[C]--types\f[R], it also shows each account\[aq]s type, if
|
||||||
|
it\[aq]s known.
|
||||||
|
(See Declaring accounts > Account types.)
|
||||||
|
.PP
|
||||||
Examples:
|
Examples:
|
||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
@ -7031,8 +7053,8 @@ write multiple postings, each asserting one commodity\[aq]s balance.
|
|||||||
.PP
|
.PP
|
||||||
You can make a stronger \[dq]total\[dq] balance assertion by writing a
|
You can make a stronger \[dq]total\[dq] balance assertion by writing a
|
||||||
double equals sign (\f[C]== EXPECTEDBALANCE\f[R]).
|
double equals sign (\f[C]== EXPECTEDBALANCE\f[R]).
|
||||||
This asserts that there are no other unasserted commodities in the
|
This asserts that there are no other commodities in the account besides
|
||||||
account (or, that their balance is 0).
|
the asserted one (or at least, that their balance is 0).
|
||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
@ -7695,18 +7717,18 @@ Though not required, these declarations can provide several benefits:
|
|||||||
They can document your intended chart of accounts, providing a
|
They can document your intended chart of accounts, providing a
|
||||||
reference.
|
reference.
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
|
They control account display order in reports, allowing non-alphabetic
|
||||||
|
sorting (eg Revenues to appear above Expenses).
|
||||||
|
.IP \[bu] 2
|
||||||
They can help hledger know your accounts\[aq] types (asset, liability,
|
They can help hledger know your accounts\[aq] types (asset, liability,
|
||||||
equity, revenue, expense), useful for reports like balancesheet and
|
equity, revenue, expense), useful for reports like balancesheet and
|
||||||
incomestatement.
|
incomestatement.
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
They control account display order in reports, allowing non-alphabetic
|
They can store other account information, as comments or as tags which
|
||||||
sorting (eg Revenues to appear above Expenses).
|
can be used to filter reports.
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
They can store extra information about accounts (account numbers, notes,
|
They help with account name completion (in hledger add, hledger-web,
|
||||||
etc.)
|
hledger-iadd, ledger-mode, etc.)
|
||||||
.IP \[bu] 2
|
|
||||||
They help with account name completion in the add command, hledger-iadd,
|
|
||||||
hledger-web, ledger-mode etc.
|
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
In strict mode, they restrict which accounts may be posted to by
|
In strict mode, they restrict which accounts may be posted to by
|
||||||
transactions, which helps detect typos.
|
transactions, which helps detect typos.
|
||||||
@ -7763,13 +7785,14 @@ An example of both:
|
|||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
account assets:bank:checking ; same-line comment, note 2+ spaces before ;
|
account assets:bank:checking ; same-line comment, note 2+ spaces required before ;
|
||||||
; next-line comment
|
; next-line comment
|
||||||
; another with tag, acctno:12345 (not used yet)
|
; some tags, type:A, acctnum:12345
|
||||||
\f[R]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
Same-line comments are not supported by Ledger, or hledger <1.13.
|
Compatibility note: same-line comments are not supported by Ledger or
|
||||||
|
hledger <1.13.
|
||||||
.SS Account subdirectives
|
.SS Account subdirectives
|
||||||
.PP
|
.PP
|
||||||
We also allow (and ignore) Ledger-style indented subdirectives, just for
|
We also allow (and ignore) Ledger-style indented subdirectives, just for
|
||||||
@ -7786,49 +7809,48 @@ Here is the full syntax of account directives:
|
|||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
account ACCTNAME [ACCTTYPE] [;COMMENT]
|
account ACCTNAME [;type:ACCTTYPE] [COMMENT]
|
||||||
[;COMMENTS]
|
[;COMMENTS]
|
||||||
[LEDGER-STYLE SUBDIRECTIVES, IGNORED]
|
[LEDGER-STYLE SUBDIRECTIVES, IGNORED]
|
||||||
\f[R]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
.SS Account types
|
.SS Account types
|
||||||
.PP
|
.PP
|
||||||
By adding a \f[C]type\f[R] tag to the account directive, with value
|
hledger knows that accounts come in several types: assets, liabilities,
|
||||||
\f[C]A\f[R], \f[C]L\f[R], \f[C]E\f[R], \f[C]R\f[R], \f[C]X\f[R],
|
expenses and so on.
|
||||||
\f[C]C\f[R], \f[C]V\f[R] (or if you prefer: \f[C]Asset\f[R],
|
This enables easy reports like balancesheet and incomestatement, and
|
||||||
\f[C]Liability\f[R], \f[C]Equity\f[R], \f[C]Revenue\f[R],
|
filtering by account type with the \f[C]type:\f[R] query.
|
||||||
\f[C]Expense\f[R], \f[C]Cash\f[R], \f[C]Conversion\f[R]), you can
|
|
||||||
declare hledger accounts to be of a certain type:
|
|
||||||
.IP \[bu] 2
|
|
||||||
\f[B]asset\f[R], \f[B]liability\f[R], \f[B]equity\f[R],
|
|
||||||
\f[B]revenue\f[R], \f[B]expense\f[R]
|
|
||||||
.PD 0
|
|
||||||
.P
|
|
||||||
.PD
|
|
||||||
the standard types in accounting, or
|
|
||||||
.IP \[bu] 2
|
|
||||||
\f[B]cash\f[R]
|
|
||||||
.PD 0
|
|
||||||
.P
|
|
||||||
.PD
|
|
||||||
a subtype of asset, used for liquid assets.
|
|
||||||
.IP \[bu] 2
|
|
||||||
\f[B]conversion\f[R]
|
|
||||||
.PD 0
|
|
||||||
.P
|
|
||||||
.PD
|
|
||||||
a subtype of equity, used for conversion postings
|
|
||||||
.PP
|
.PP
|
||||||
Declaring account types is a good idea, since it helps enable the easy
|
As a convenience, hledger will detect these account types automatically
|
||||||
balancesheet, balancesheetequity, incomestatement and cashflow reports,
|
if you are using common english-language top-level account names
|
||||||
and probably other things in future.
|
(described below).
|
||||||
As a convenience, when account types are not declared, hledger will try
|
But generally we recommend you declare types explicitly, by adding a
|
||||||
to guess them based on english-language account names.
|
\f[C]type:\f[R] tag to your top-level account directives.
|
||||||
|
Subaccounts will inherit the type of their parent.
|
||||||
|
The tag\[aq]s value should be one of the five main account types:
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]A\f[R] or \f[C]Asset\f[R] (things you own)
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]L\f[R] or \f[C]Liability\f[R] (things you owe)
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]E\f[R] or \f[C]Equity\f[R] (investment/ownership; balanced
|
||||||
|
counterpart of assets & liabilities)
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]R\f[R] or \f[C]Revenue\f[R] (what you received money from, AKA
|
||||||
|
income; technically part of Equity)
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]X\f[R] or \f[C]Expense\f[R] (what you spend money on; technically
|
||||||
|
part of Equity)
|
||||||
.PP
|
.PP
|
||||||
Here is a typical set of top-level account declarations (because of the
|
or, it can be (these are used less often):
|
||||||
aforementioned, with these account names the type tags are not strictly
|
.IP \[bu] 2
|
||||||
needed, but with non-english or non-standard account names, they will
|
\f[C]C\f[R] or \f[C]Cash\f[R] (a subtype of Asset, indicating liquid
|
||||||
be):
|
assets for the cashflow report)
|
||||||
|
.IP \[bu] 2
|
||||||
|
\f[C]V\f[R] or \f[C]Conversion\f[R] (a subtype of Equity, for
|
||||||
|
conversions (see CONVERSION & COST).)
|
||||||
|
.PP
|
||||||
|
Here is a typical set of account type declarations:
|
||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
@ -7840,38 +7862,71 @@ account expenses ; type: X
|
|||||||
|
|
||||||
account assets:bank ; type: C
|
account assets:bank ; type: C
|
||||||
account assets:cash ; type: C
|
account assets:cash ; type: C
|
||||||
|
|
||||||
|
account equity:conversion ; type: V
|
||||||
\f[R]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
It\[aq]s not necessary to declare the type of subaccounts.
|
Here are some tips for working with account types.
|
||||||
(You can, if they are different from the parent, but this is not
|
.IP \[bu] 2
|
||||||
common.)
|
The rules for inferring types from account names are as follows.
|
||||||
.SS Auto-detected account types
|
These are just a convenience that sometimes help new users get going; if
|
||||||
.PP
|
they don\[aq]t work for you, just ignore them and declare your account
|
||||||
More about \[dq]guessing\[dq] account types: hledger tries to find at
|
types.
|
||||||
least one top level account in each of the six account types (Asset,
|
See also Regular expressions.
|
||||||
Liability, Equity, Revenue, Expense, Cash).
|
Note the Cash regexp changed in hledger 1.24.99.2.
|
||||||
When no accounts have been declared for a particular type, it tries to
|
.RS 2
|
||||||
auto-detect some accounts by name, using the regular expressions below.
|
|
||||||
Note: if you declare any account\[aq]s type, it\[aq]s a good idea to
|
|
||||||
declare an account for all six types, because a mix of declared and
|
|
||||||
auto-detected types can cause confusing results.
|
|
||||||
.PP
|
|
||||||
The auto-detection rules are:
|
|
||||||
.IP
|
.IP
|
||||||
.nf
|
.nf
|
||||||
\f[C]
|
\f[C]
|
||||||
If account\[aq]s name matches this case insensitive regular expression:| its type is:
|
If account\[aq]s name contains this (CI) regular expression: | its type is:
|
||||||
------------------------------------------------------------------- | ------------
|
--------------------------------------------------------------------|-------------
|
||||||
\[ha]assets?(:|$) |
|
\[ha]assets?(:.+)?:(cash|bank|che(ck|que?)(ing)?|savings?|current)(:|$) | Cash
|
||||||
and does not contain regexp (investment|receivable|:A/R|:fixed) | Cash
|
\[ha]assets?(:|$) | Asset
|
||||||
otherwise | Asset
|
\[ha](debts?|liabilit(y|ies))(:|$) | Liability
|
||||||
\[ha](debts?|liabilit(y|ies))(:|$) | Liability
|
\[ha]equity:(trad(e|ing)|conversion)s?(:|$) | Conversion
|
||||||
\[ha]equity(:|$) | Equity
|
\[ha]equity(:|$) | Equity
|
||||||
\[ha](income|revenue)s?(:|$) | Revenue
|
\[ha](income|revenue)s?(:|$) | Revenue
|
||||||
\[ha]expenses?(:|$) | Expense
|
\[ha]expenses?(:|$) | Expense
|
||||||
\f[R]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
|
.RE
|
||||||
|
.IP \[bu] 2
|
||||||
|
If you declare any account types, it\[aq]s a good idea to declare an
|
||||||
|
account for each of them, because a mixture of declared and
|
||||||
|
name-inferred types can disrupt certain reports.
|
||||||
|
.IP \[bu] 2
|
||||||
|
Certain uses of account aliases can disrupt account types.
|
||||||
|
See Rewriting accounts > Aliases and account types.
|
||||||
|
.IP \[bu] 2
|
||||||
|
As mentioned above, subaccounts will inherit a type from their parent
|
||||||
|
account.
|
||||||
|
To be precise, an account\[aq]s type is decided by the first of these
|
||||||
|
that exists:
|
||||||
|
.RS 2
|
||||||
|
.IP "1." 3
|
||||||
|
A \f[C]type:\f[R] declaration for this account.
|
||||||
|
.IP "2." 3
|
||||||
|
A \f[C]type:\f[R] declaration in the parent accounts above it,
|
||||||
|
preferring the nearest.
|
||||||
|
.IP "3." 3
|
||||||
|
An account type inferred from this account\[aq]s name.
|
||||||
|
.IP "4." 3
|
||||||
|
An account type inferred from a parent account\[aq]s name, preferring
|
||||||
|
the nearest parent.
|
||||||
|
.IP "5." 3
|
||||||
|
Otherwise, it will have no type.
|
||||||
|
.RE
|
||||||
|
.IP \[bu] 2
|
||||||
|
For troubleshooting, you can list accounts and their types with:
|
||||||
|
.RS 2
|
||||||
|
.IP
|
||||||
|
.nf
|
||||||
|
\f[C]
|
||||||
|
$ hledger accounts --types [ACCTPAT] [-DEPTH] [type:TYPECODES]
|
||||||
|
\f[R]
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
.SS Account display order
|
.SS Account display order
|
||||||
.PP
|
.PP
|
||||||
Account directives also set the order in which accounts are displayed,
|
Account directives also set the order in which accounts are displayed,
|
||||||
@ -8139,6 +8194,28 @@ $ hledger print --alias old=\[dq]new USD\[dq] | hledger -f- print
|
|||||||
other
|
other
|
||||||
\f[R]
|
\f[R]
|
||||||
.fi
|
.fi
|
||||||
|
.SS Aliases and account types
|
||||||
|
.PP
|
||||||
|
If an account with a type declaration (see Declaring accounts > Account
|
||||||
|
types) is renamed by an alias, normally the account type remains in
|
||||||
|
effect.
|
||||||
|
.PP
|
||||||
|
However, renaming in a way that reshapes the account tree (eg renaming
|
||||||
|
parent accounts but not their children, or vice versa) could prevent
|
||||||
|
child accounts from inheriting the account type of their parents.
|
||||||
|
.PP
|
||||||
|
Secondly, if an account\[aq]s type is being inferred from its name,
|
||||||
|
renaming it by an alias could prevent or alter that.
|
||||||
|
.PP
|
||||||
|
If you are using account aliases and the \f[C]type:\f[R] query is not
|
||||||
|
matching accounts as you expect, try troubleshooting with the accounts
|
||||||
|
command, eg something like:
|
||||||
|
.IP
|
||||||
|
.nf
|
||||||
|
\f[C]
|
||||||
|
$ hledger accounts --alias assets=bassetts type:a
|
||||||
|
\f[R]
|
||||||
|
.fi
|
||||||
.SS Default parent account
|
.SS Default parent account
|
||||||
.PP
|
.PP
|
||||||
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
|
||||||
|
|||||||
1198
hledger/hledger.info
1198
hledger/hledger.info
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@ HLEDGER(1) hledger User Manuals HLEDGER(1)
|
|||||||
NAME
|
NAME
|
||||||
This is the command-line interface (CLI) for the hledger accounting
|
This is the command-line interface (CLI) for the hledger accounting
|
||||||
tool. Here we also describe hledger's concepts and file formats. This
|
tool. Here we also describe hledger's concepts and file formats. This
|
||||||
manual is for hledger 1.24.99.
|
manual is for hledger 1.25.99.
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
hledger
|
hledger
|
||||||
@ -536,8 +536,8 @@ DATA FILES
|
|||||||
|
|
||||||
o Are all commodity conversions declared explicitly ?
|
o Are all commodity conversions declared explicitly ?
|
||||||
|
|
||||||
You can also use the check command to run these and some additional
|
You can use the check command to run individual checks -- the ones
|
||||||
checks.
|
listed above and some more.
|
||||||
|
|
||||||
TIME PERIODS
|
TIME PERIODS
|
||||||
Smart dates
|
Smart dates
|
||||||
@ -973,11 +973,25 @@ QUERIES
|
|||||||
status:, status:!, status:*
|
status:, status:!, status:*
|
||||||
Match unmarked, pending, or cleared transactions respectively.
|
Match unmarked, pending, or cleared transactions respectively.
|
||||||
|
|
||||||
|
type:TYPECODES
|
||||||
|
Match by account type (see Declaring accounts > Account types). TYPE-
|
||||||
|
CODES is one or more of the single-letter account type codes ALERXCV,
|
||||||
|
case insensitive. Note type:A and type:E will also match their respec-
|
||||||
|
tive subtypes C (Cash) and V (Conversion). Certain kinds of account
|
||||||
|
alias can disrupt account types, see Rewriting accounts > Aliases and
|
||||||
|
account types.
|
||||||
|
|
||||||
tag:REGEX[=REGEX]
|
tag:REGEX[=REGEX]
|
||||||
Match by tag name, and optionally also by tag value. (To match only by
|
Match by tag name, and optionally also by tag value. (To match only by
|
||||||
value, use tag:.=REGEX.) Note that postings also inherit tags from
|
value, use tag:.=REGEX.)
|
||||||
their transaction, and transactions also acquire tags from their post-
|
|
||||||
ings, when querying.
|
When querying by tag, note that:
|
||||||
|
|
||||||
|
o Accounts also inherit the tags of their parent accounts
|
||||||
|
|
||||||
|
o Postings also inherit the tags of their account and their transaction
|
||||||
|
|
||||||
|
o Transactions also acquire the tags of their postings.
|
||||||
|
|
||||||
(inacct:ACCTNAME
|
(inacct:ACCTNAME
|
||||||
A special query term used automatically in hledger-web only: tells
|
A special query term used automatically in hledger-web only: tells
|
||||||
@ -1530,8 +1544,6 @@ VALUATION
|
|||||||
Related: #329, #1083.
|
Related: #329, #1083.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Report -B, --cost -V, -X --value=then --value=end --value=DATE,
|
Report -B, --cost -V, -X --value=then --value=end --value=DATE,
|
||||||
type --value=now
|
type --value=now
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
@ -1593,6 +1605,7 @@ VALUATION
|
|||||||
is, bs postings in period at respec- each period, sums of post-
|
is, bs postings in period at respec- each period, sums of post-
|
||||||
--change, cf period tive posting valued at ings
|
--change, cf period tive posting valued at ings
|
||||||
--change) dates period ends
|
--change) dates period ends
|
||||||
|
|
||||||
end balances sums of same as sums of values of period end value at
|
end balances sums of same as sums of values of period end value at
|
||||||
(bal -H, is costs of --value=end postings from balances, DATE/today of
|
(bal -H, is costs of --value=end postings from balances, DATE/today of
|
||||||
--H, bs, cf) postings before period valued at sums of post-
|
--H, bs, cf) postings before period valued at sums of post-
|
||||||
@ -1603,7 +1616,6 @@ VALUATION
|
|||||||
budget like balance like balance like balance like bal- like balance
|
budget like balance like balance like balance like bal- like balance
|
||||||
amounts changes/end changes/end changes/end bal- ances changes/end
|
amounts changes/end changes/end changes/end bal- ances changes/end
|
||||||
(--budget) balances balances ances balances
|
(--budget) balances balances ances balances
|
||||||
|
|
||||||
row totals, sums, aver- sums, aver- sums, averages of sums, aver- sums, aver-
|
row totals, sums, aver- sums, aver- sums, averages of sums, aver- sums, aver-
|
||||||
row averages ages of dis- ages of dis- displayed values ages of dis- ages of dis-
|
row averages ages of dis- ages of dis- displayed values ages of dis- ages of dis-
|
||||||
(-T, -A) played val- played val- played val- played values
|
(-T, -A) played val- played val- played val- played values
|
||||||
@ -1746,8 +1758,6 @@ OUTPUT
|
|||||||
balance Y 1 Y 1 Y 1,2 Y
|
balance Y 1 Y 1 Y 1,2 Y
|
||||||
bal- Y 1 Y 1 Y 1 Y
|
bal- Y 1 Y 1 Y 1 Y
|
||||||
ancesheet
|
ancesheet
|
||||||
|
|
||||||
|
|
||||||
bal- Y 1 Y 1 Y 1 Y
|
bal- Y 1 Y 1 Y 1 Y
|
||||||
ancesheete-
|
ancesheete-
|
||||||
quity
|
quity
|
||||||
@ -1947,6 +1957,9 @@ COMMANDS
|
|||||||
ponents. Account names can be depth-clipped with depth:N or --depth N
|
ponents. Account names can be depth-clipped with depth:N or --depth N
|
||||||
or -N.
|
or -N.
|
||||||
|
|
||||||
|
With --types, it also shows each account's type, if it's known. (See
|
||||||
|
Declaring accounts > Account types.)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ hledger accounts
|
$ hledger accounts
|
||||||
@ -2690,8 +2703,6 @@ COMMANDS
|
|||||||
period end ues from report from report report start
|
period end ues from report from report report start
|
||||||
start to period start to period to period end
|
start to period start to period to period end
|
||||||
end end
|
end end
|
||||||
|
|
||||||
|
|
||||||
--his- change from sum of posting- period-end DATE-value of
|
--his- change from sum of posting- period-end DATE-value of
|
||||||
torical journal start to date market val- value of change change from
|
torical journal start to date market val- value of change change from
|
||||||
/-H period end (his- ues from journal from journal journal start
|
/-H period end (his- ues from journal from journal journal start
|
||||||
@ -5033,7 +5044,8 @@ JOURNAL FORMAT
|
|||||||
|
|
||||||
You can make a stronger "total" balance assertion by writing a double
|
You can make a stronger "total" balance assertion by writing a double
|
||||||
equals sign (== EXPECTEDBALANCE). This asserts that there are no other
|
equals sign (== EXPECTEDBALANCE). This asserts that there are no other
|
||||||
unasserted commodities in the account (or, that their balance is 0).
|
commodities in the account besides the asserted one (or at least, that
|
||||||
|
their balance is 0).
|
||||||
|
|
||||||
2013/1/1
|
2013/1/1
|
||||||
a $1
|
a $1
|
||||||
@ -5171,8 +5183,6 @@ JOURNAL FORMAT
|
|||||||
parsing comment, D, Y
|
parsing comment, D, Y
|
||||||
Inline extra data files include multiple
|
Inline extra data files include multiple
|
||||||
-f/--file's
|
-f/--file's
|
||||||
|
|
||||||
|
|
||||||
Generate extra transactions or ~
|
Generate extra transactions or ~
|
||||||
budget goals
|
budget goals
|
||||||
Generate extra postings =
|
Generate extra postings =
|
||||||
@ -5458,18 +5468,18 @@ JOURNAL FORMAT
|
|||||||
o They can document your intended chart of accounts, providing a refer-
|
o They can document your intended chart of accounts, providing a refer-
|
||||||
ence.
|
ence.
|
||||||
|
|
||||||
|
o They control account display order in reports, allowing non-alpha-
|
||||||
|
betic sorting (eg Revenues to appear above Expenses).
|
||||||
|
|
||||||
o They can help hledger know your accounts' types (asset, liability,
|
o They can help hledger know your accounts' types (asset, liability,
|
||||||
equity, revenue, expense), useful for reports like balancesheet and
|
equity, revenue, expense), useful for reports like balancesheet and
|
||||||
incomestatement.
|
incomestatement.
|
||||||
|
|
||||||
o They control account display order in reports, allowing non-alpha-
|
o They can store other account information, as comments or as tags
|
||||||
betic sorting (eg Revenues to appear above Expenses).
|
which can be used to filter reports.
|
||||||
|
|
||||||
o They can store extra information about accounts (account numbers,
|
o They help with account name completion (in hledger add, hledger-web,
|
||||||
notes, etc.)
|
hledger-iadd, ledger-mode, etc.)
|
||||||
|
|
||||||
o They help with account name completion in the add command, hledger-
|
|
||||||
iadd, hledger-web, ledger-mode etc.
|
|
||||||
|
|
||||||
o In strict mode, they restrict which accounts may be posted to by
|
o In strict mode, they restrict which accounts may be posted to by
|
||||||
transactions, which helps detect typos.
|
transactions, which helps detect typos.
|
||||||
@ -5516,11 +5526,12 @@ JOURNAL FORMAT
|
|||||||
|
|
||||||
An example of both:
|
An example of both:
|
||||||
|
|
||||||
account assets:bank:checking ; same-line comment, note 2+ spaces before ;
|
account assets:bank:checking ; same-line comment, note 2+ spaces required before ;
|
||||||
; next-line comment
|
; next-line comment
|
||||||
; another with tag, acctno:12345 (not used yet)
|
; some tags, type:A, acctnum:12345
|
||||||
|
|
||||||
Same-line comments are not supported by Ledger, or hledger <1.13.
|
Compatibility note: same-line comments are not supported by Ledger or
|
||||||
|
hledger <1.13.
|
||||||
|
|
||||||
Account subdirectives
|
Account subdirectives
|
||||||
We also allow (and ignore) Ledger-style indented subdirectives, just
|
We also allow (and ignore) Ledger-style indented subdirectives, just
|
||||||
@ -5531,35 +5542,43 @@ JOURNAL FORMAT
|
|||||||
|
|
||||||
Here is the full syntax of account directives:
|
Here is the full syntax of account directives:
|
||||||
|
|
||||||
account ACCTNAME [ACCTTYPE] [;COMMENT]
|
account ACCTNAME [;type:ACCTTYPE] [COMMENT]
|
||||||
[;COMMENTS]
|
[;COMMENTS]
|
||||||
[LEDGER-STYLE SUBDIRECTIVES, IGNORED]
|
[LEDGER-STYLE SUBDIRECTIVES, IGNORED]
|
||||||
|
|
||||||
Account types
|
Account types
|
||||||
By adding a type tag to the account directive, with value A, L, E, R,
|
hledger knows that accounts come in several types: assets, liabilities,
|
||||||
X, C, V (or if you prefer: Asset, Liability, Equity, Revenue, Expense,
|
expenses and so on. This enables easy reports like balancesheet and
|
||||||
Cash, Conversion), you can declare hledger accounts to be of a certain
|
incomestatement, and filtering by account type with the type: query.
|
||||||
type:
|
|
||||||
|
|
||||||
o asset, liability, equity, revenue, expense
|
As a convenience, hledger will detect these account types automatically
|
||||||
the standard types in accounting, or
|
if you are using common english-language top-level account names
|
||||||
|
(described below). But generally we recommend you declare types
|
||||||
|
explicitly, by adding a type: tag to your top-level account directives.
|
||||||
|
Subaccounts will inherit the type of their parent. The tag's value
|
||||||
|
should be one of the five main account types:
|
||||||
|
|
||||||
o cash
|
o A or Asset (things you own)
|
||||||
a subtype of asset, used for liquid assets.
|
|
||||||
|
|
||||||
o conversion
|
o L or Liability (things you owe)
|
||||||
a subtype of equity, used for conversion postings
|
|
||||||
|
|
||||||
Declaring account types is a good idea, since it helps enable the easy
|
o E or Equity (investment/ownership; balanced counterpart of assets &
|
||||||
balancesheet, balancesheetequity, incomestatement and cashflow reports,
|
liabilities)
|
||||||
and probably other things in future. As a convenience, when account
|
|
||||||
types are not declared, hledger will try to guess them based on
|
|
||||||
english-language account names.
|
|
||||||
|
|
||||||
Here is a typical set of top-level account declarations (because of the
|
o R or Revenue (what you received money from, AKA income; technically
|
||||||
aforementioned, with these account names the type tags are not strictly
|
part of Equity)
|
||||||
needed, but with non-english or non-standard account names, they will
|
|
||||||
be):
|
o X or Expense (what you spend money on; technically part of Equity)
|
||||||
|
|
||||||
|
or, it can be (these are used less often):
|
||||||
|
|
||||||
|
o C or Cash (a subtype of Asset, indicating liquid assets for the cash-
|
||||||
|
flow report)
|
||||||
|
|
||||||
|
o V or Conversion (a subtype of Equity, for conversions (see CONVERSION
|
||||||
|
& COST).)
|
||||||
|
|
||||||
|
Here is a typical set of account type declarations:
|
||||||
|
|
||||||
account assets ; type: A
|
account assets ; type: A
|
||||||
account liabilities ; type: L
|
account liabilities ; type: L
|
||||||
@ -5570,31 +5589,53 @@ JOURNAL FORMAT
|
|||||||
account assets:bank ; type: C
|
account assets:bank ; type: C
|
||||||
account assets:cash ; type: C
|
account assets:cash ; type: C
|
||||||
|
|
||||||
It's not necessary to declare the type of subaccounts. (You can, if
|
account equity:conversion ; type: V
|
||||||
they are different from the parent, but this is not common.)
|
|
||||||
|
|
||||||
Auto-detected account types
|
Here are some tips for working with account types.
|
||||||
More about "guessing" account types: hledger tries to find at least one
|
|
||||||
top level account in each of the six account types (Asset, Liability,
|
|
||||||
Equity, Revenue, Expense, Cash). When no accounts have been declared
|
|
||||||
for a particular type, it tries to auto-detect some accounts by name,
|
|
||||||
using the regular expressions below. Note: if you declare any
|
|
||||||
account's type, it's a good idea to declare an account for all six
|
|
||||||
types, because a mix of declared and auto-detected types can cause con-
|
|
||||||
fusing results.
|
|
||||||
|
|
||||||
The auto-detection rules are:
|
o The rules for inferring types from account names are as follows.
|
||||||
|
These are just a convenience that sometimes help new users get going;
|
||||||
|
if they don't work for you, just ignore them and declare your account
|
||||||
|
types. See also Regular expressions. Note the Cash regexp changed
|
||||||
|
in hledger 1.24.99.2.
|
||||||
|
|
||||||
If account's name matches this case insensitive regular expression:| its type is:
|
If account's name contains this (CI) regular expression: | its type is:
|
||||||
------------------------------------------------------------------- | ------------
|
--------------------------------------------------------------------|-------------
|
||||||
^assets?(:|$) |
|
^assets?(:.+)?:(cash|bank|che(ck|que?)(ing)?|savings?|current)(:|$) | Cash
|
||||||
and does not contain regexp (investment|receivable|:A/R|:fixed) | Cash
|
^assets?(:|$) | Asset
|
||||||
otherwise | Asset
|
|
||||||
^(debts?|liabilit(y|ies))(:|$) | Liability
|
^(debts?|liabilit(y|ies))(:|$) | Liability
|
||||||
|
^equity:(trad(e|ing)|conversion)s?(:|$) | Conversion
|
||||||
^equity(:|$) | Equity
|
^equity(:|$) | Equity
|
||||||
^(income|revenue)s?(:|$) | Revenue
|
^(income|revenue)s?(:|$) | Revenue
|
||||||
^expenses?(:|$) | Expense
|
^expenses?(:|$) | Expense
|
||||||
|
|
||||||
|
o If you declare any account types, it's a good idea to declare an
|
||||||
|
account for each of them, because a mixture of declared and name-
|
||||||
|
inferred types can disrupt certain reports.
|
||||||
|
|
||||||
|
o Certain uses of account aliases can disrupt account types. See
|
||||||
|
Rewriting accounts > Aliases and account types.
|
||||||
|
|
||||||
|
o As mentioned above, subaccounts will inherit a type from their parent
|
||||||
|
account. To be precise, an account's type is decided by the first of
|
||||||
|
these that exists:
|
||||||
|
|
||||||
|
1. A type: declaration for this account.
|
||||||
|
|
||||||
|
2. A type: declaration in the parent accounts above it, preferring
|
||||||
|
the nearest.
|
||||||
|
|
||||||
|
3. An account type inferred from this account's name.
|
||||||
|
|
||||||
|
4. An account type inferred from a parent account's name, preferring
|
||||||
|
the nearest parent.
|
||||||
|
|
||||||
|
5. Otherwise, it will have no type.
|
||||||
|
|
||||||
|
o For troubleshooting, you can list accounts and their types with:
|
||||||
|
|
||||||
|
$ hledger accounts --types [ACCTPAT] [-DEPTH] [type:TYPECODES]
|
||||||
|
|
||||||
Account display order
|
Account display order
|
||||||
Account directives also set the order in which accounts are displayed,
|
Account directives also set the order in which accounts are displayed,
|
||||||
eg in reports, the hledger-ui accounts screen, and the hledger-web
|
eg in reports, the hledger-ui accounts screen, and the hledger-web
|
||||||
@ -5791,6 +5832,24 @@ JOURNAL FORMAT
|
|||||||
new USD 1
|
new USD 1
|
||||||
other
|
other
|
||||||
|
|
||||||
|
Aliases and account types
|
||||||
|
If an account with a type declaration (see Declaring accounts > Account
|
||||||
|
types) is renamed by an alias, normally the account type remains in
|
||||||
|
effect.
|
||||||
|
|
||||||
|
However, renaming in a way that reshapes the account tree (eg renaming
|
||||||
|
parent accounts but not their children, or vice versa) could prevent
|
||||||
|
child accounts from inheriting the account type of their parents.
|
||||||
|
|
||||||
|
Secondly, if an account's type is being inferred from its name, renam-
|
||||||
|
ing it by an alias could prevent or alter that.
|
||||||
|
|
||||||
|
If you are using account aliases and the type: query is not matching
|
||||||
|
accounts as you expect, try troubleshooting with the accounts command,
|
||||||
|
eg something like:
|
||||||
|
|
||||||
|
$ hledger accounts --alias assets=bassetts type:a
|
||||||
|
|
||||||
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
|
||||||
@ -6137,6 +6196,7 @@ CSV FORMAT
|
|||||||
if table apply some rules to CSV records matched by
|
if table apply some rules to CSV records matched by
|
||||||
patterns, alternate syntax
|
patterns, alternate syntax
|
||||||
end skip the remaining CSV records
|
end skip the remaining CSV records
|
||||||
|
|
||||||
date-format how to parse dates in CSV records
|
date-format how to parse dates in CSV records
|
||||||
decimal-mark the decimal mark used in CSV amounts, if
|
decimal-mark the decimal mark used in CSV amounts, if
|
||||||
ambiguous
|
ambiguous
|
||||||
@ -7843,4 +7903,4 @@ SEE ALSO
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
hledger-1.24.99 December 2021 HLEDGER(1)
|
hledger-1.25.99 December 2021 HLEDGER(1)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user