;doc: update manuals

This commit is contained in:
Simon Michael 2024-04-18 13:35:28 -10:00
parent 0edf99350a
commit 4ae62a1833
13 changed files with 2064 additions and 1981 deletions

View File

@ -1,2 +1,2 @@
m4_dnl Date to show in man pages. Updated by "Shake manuals" m4_dnl Date to show in man pages. Updated by "Shake manuals"
m4_define({{_monthyear_}}, {{March 2024}})m4_dnl m4_define({{_monthyear_}}, {{April 2024}})m4_dnl

View File

@ -1,2 +1,2 @@
m4_dnl Date to show in man pages. Updated by "Shake manuals" m4_dnl Date to show in man pages. Updated by "Shake manuals"
m4_define({{_monthyear_}}, {{March 2024}})m4_dnl m4_define({{_monthyear_}}, {{April 2024}})m4_dnl

View File

@ -1,5 +1,5 @@
.TH "HLEDGER\-UI" "1" "March 2024" "hledger-ui-1.32.99 " "hledger User Manuals" .TH "HLEDGER\-UI" "1" "April 2024" "hledger-ui-1.33.99 " "hledger User Manuals"
@ -12,7 +12,7 @@ hledger\-ui \- robust, friendly plain text accounting (TUI version)
.PD .PD
\f[CR]hledger ui \-\- [OPTS] [QUERYARGS]\f[R] \f[CR]hledger ui \-\- [OPTS] [QUERYARGS]\f[R]
.SH DESCRIPTION .SH DESCRIPTION
This manual is for hledger\[aq]s terminal interface, version 1.32.99. This manual is for hledger\[aq]s terminal interface, version 1.33.99.
See also the hledger manual for common concepts and file formats. See also the hledger manual for common concepts and file formats.
.PP .PP
hledger is a robust, user\-friendly, cross\-platform set of programs for hledger is a robust, user\-friendly, cross\-platform set of programs for

View File

@ -16,7 +16,7 @@ hledger-ui - robust, friendly plain text accounting (TUI version)
'hledger-ui [OPTS] [QUERYARGS]' 'hledger-ui [OPTS] [QUERYARGS]'
'hledger ui -- [OPTS] [QUERYARGS]' 'hledger ui -- [OPTS] [QUERYARGS]'
This manual is for hledger's terminal interface, version 1.32.99. This manual is for hledger's terminal interface, version 1.33.99.
See also the hledger manual for common concepts and file formats. See also the hledger manual for common concepts and file formats.
hledger is a robust, user-friendly, cross-platform set of programs hledger is a robust, user-friendly, cross-platform set of programs

View File

@ -9,7 +9,7 @@ SYNOPSIS
hledger ui -- [OPTS] [QUERYARGS] hledger ui -- [OPTS] [QUERYARGS]
DESCRIPTION DESCRIPTION
This manual is for hledger's terminal interface, version 1.32.99. See This manual is for hledger's terminal interface, version 1.33.99. See
also the hledger manual for common concepts and file formats. also the hledger manual for common concepts and file formats.
hledger is a robust, user-friendly, cross-platform set of programs for hledger is a robust, user-friendly, cross-platform set of programs for
@ -535,4 +535,4 @@ LICENSE
SEE ALSO SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), ledger(1) hledger(1), hledger-ui(1), hledger-web(1), ledger(1)
hledger-ui-1.32.99 March 2024 HLEDGER-UI(1) hledger-ui-1.33.99 April 2024 HLEDGER-UI(1)

View File

@ -1,2 +1,2 @@
m4_dnl Date to show in man pages. Updated by "Shake manuals" m4_dnl Date to show in man pages. Updated by "Shake manuals"
m4_define({{_monthyear_}}, {{March 2024}})m4_dnl m4_define({{_monthyear_}}, {{April 2024}})m4_dnl

View File

@ -1,5 +1,5 @@
.TH "HLEDGER\-WEB" "1" "March 2024" "hledger-web-1.32.99 " "hledger User Manuals" .TH "HLEDGER\-WEB" "1" "April 2024" "hledger-web-1.33.99 " "hledger User Manuals"
@ -12,7 +12,7 @@ hledger\-web \- robust, friendly plain text accounting (Web version)
.PD .PD
\f[CR]hledger web \-\- [\-\-serve|\-\-serve\-api] [OPTS] [ARGS]\f[R] \f[CR]hledger web \-\- [\-\-serve|\-\-serve\-api] [OPTS] [ARGS]\f[R]
.SH DESCRIPTION .SH DESCRIPTION
This manual is for hledger\[aq]s web interface, version 1.32.99. This manual is for hledger\[aq]s web interface, version 1.33.99.
See also the hledger manual for common concepts and file formats. See also the hledger manual for common concepts and file formats.
.PP .PP
hledger is a robust, user\-friendly, cross\-platform set of programs for hledger is a robust, user\-friendly, cross\-platform set of programs for

View File

@ -16,7 +16,7 @@ hledger-web - robust, friendly plain text accounting (Web version)
'hledger-web [--serve|--serve-api] [OPTS] [ARGS]' 'hledger-web [--serve|--serve-api] [OPTS] [ARGS]'
'hledger web -- [--serve|--serve-api] [OPTS] [ARGS]' 'hledger web -- [--serve|--serve-api] [OPTS] [ARGS]'
This manual is for hledger's web interface, version 1.32.99. See This manual is for hledger's web interface, version 1.33.99. See
also the hledger manual for common concepts and file formats. also the hledger manual for common concepts and file formats.
hledger is a robust, user-friendly, cross-platform set of programs hledger is a robust, user-friendly, cross-platform set of programs

View File

@ -9,7 +9,7 @@ SYNOPSIS
hledger web -- [--serve|--serve-api] [OPTS] [ARGS] hledger web -- [--serve|--serve-api] [OPTS] [ARGS]
DESCRIPTION DESCRIPTION
This manual is for hledger's web interface, version 1.32.99. See also This manual is for hledger's web interface, version 1.33.99. See also
the hledger manual for common concepts and file formats. the hledger manual for common concepts and file formats.
hledger is a robust, user-friendly, cross-platform set of programs for hledger is a robust, user-friendly, cross-platform set of programs for
@ -558,4 +558,4 @@ LICENSE
SEE ALSO SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), ledger(1) hledger(1), hledger-ui(1), hledger-web(1), ledger(1)
hledger-web-1.32.99 March 2024 HLEDGER-WEB(1) hledger-web-1.33.99 April 2024 HLEDGER-WEB(1)

View File

@ -1,2 +1,2 @@
m4_dnl Date to show in man pages. Updated by "Shake manuals" m4_dnl Date to show in man pages. Updated by "Shake manuals"
m4_define({{_monthyear_}}, {{March 2024}})m4_dnl m4_define({{_monthyear_}}, {{April 2024}})m4_dnl

View File

@ -1,6 +1,6 @@
.\"t .\"t
.TH "HLEDGER" "1" "March 2024" "hledger-1.32.99 " "hledger User Manuals" .TH "HLEDGER" "1" "April 2024" "hledger-1.33.99 " "hledger User Manuals"
@ -24,7 +24,7 @@ hledger is inspired by and largely compatible with ledger(1), and
largely interconvertible with beancount(1). largely interconvertible with beancount(1).
.PP .PP
This manual is for hledger\[aq]s command line interface, version This manual is for hledger\[aq]s command line interface, version
1.32.99. 1.33.99.
It also describes the common options, file formats and concepts used by It also describes the common options, file formats and concepts used by
all hledger programs. all hledger programs.
It might accidentally teach you some bookkeeping/accounting as well! It might accidentally teach you some bookkeeping/accounting as well!
@ -123,6 +123,9 @@ For more about how to do that on your system, see Common tasks > Setting
LEDGER_FILE. LEDGER_FILE.
.SS Text encoding .SS Text encoding
Data files containing non\-ascii characters must use UTF\-8 encoding. Data files containing non\-ascii characters must use UTF\-8 encoding.
An optional byte order mark (BOM) is allowed, at the beginning of the
file (only).
.PP
Also, your system should be configured with a locale that can decode Also, your system should be configured with a locale that can decode
UTF\-8 text. UTF\-8 text.
On some unix systems, you may need set the \f[CR]LANG\f[R] environment On some unix systems, you may need set the \f[CR]LANG\f[R] environment
@ -1805,12 +1808,12 @@ each posting:
.IP .IP
.EX .EX
2013/1/1 2013/1/1
a $1 =$1 a $1 = $1
b =$\-1 b = $\-1
2013/1/2 2013/1/2
a $1 =$2 a $1 = $2
b $\-1 =$\-2 b $\-1 = $\-2
.EE .EE
.PP .PP
After reading a journal file, hledger will check all balance assertions After reading a journal file, hledger will check all balance assertions
@ -1823,20 +1826,17 @@ troubleshooting or for reading Ledger files.
(Note: this flag currently does not disable balance assignments, (Note: this flag currently does not disable balance assignments,
described below). described below).
.SS Assertions and ordering .SS Assertions and ordering
hledger sorts an account\[aq]s postings and assertions first by date and hledger calculates and checks an account\[aq]s balance assertions in
then (for postings on the same day) by parse order. date order (and when there are multiple assertions on the same day, in
Note this is different from Ledger, which sorts assertions only by parse parse order).
order. Note this is different from Ledger, which checks assertions always in
(Also, Ledger assertions do not see the accumulated effect of repeated parse order, ignoring dates.
postings to the same account within a transaction.)
.PP .PP
So, hledger balance assertions keep working if you reorder This means in hledger you can freely reorder transactions, postings, or
differently\-dated transactions within the journal. files, and balance assertions will usually keep working.
But if you reorder same\-dated transactions or postings, assertions The exception is when you reorder multiple postings on the same day, to
might break and require updating. the same account, which have balance assertions; those will likely need
This order dependence does bring an advantage: precise control over the updating.
order of postings and assertions within a day, so you can assert
intra\-day balances.
.SS Assertions and multiple included files .SS Assertions and multiple included files
Multiple files included with the \f[CR]include\f[R] directive are Multiple files included with the \f[CR]include\f[R] directive are
processed as if concatenated into one file, preserving their order and processed as if concatenated into one file, preserving their order and
@ -1857,53 +1857,6 @@ disrupt valid assertions in later files.
.PP .PP
If you do want assertions to see balance from earlier files, use If you do want assertions to see balance from earlier files, use
\f[CR]include\f[R], or concatenate the files temporarily. \f[CR]include\f[R], or concatenate the files temporarily.
.SS Assertions and commodities
The asserted balance must be a simple single\-commodity amount, and in
fact the assertion checks only this commodity\[aq]s balance within the
(possibly multi\-commodity) account balance.
This is how assertions work in Ledger also.
We could call this a \[dq]partial\[dq] balance assertion.
.PP
To assert the balance of more than one commodity in an account, you can
write multiple postings, each asserting one commodity\[aq]s balance.
.PP
You can make a stronger \[dq]total\[dq] balance assertion by writing a
double equals sign (\f[CR]== EXPECTEDBALANCE\f[R]).
This asserts that there are no other commodities in the account besides
the asserted one (or at least, that their balance is 0).
.IP
.EX
2013/1/1
a $1
a 1€
b $\-1
c \-1€
2013/1/2 ; These assertions succeed
a 0 = $1
a 0 = 1€
b 0 == $\-1
c 0 == \-1€
2013/1/3 ; This assertion fails as \[aq]a\[aq] also contains 1€
a 0 == $1
.EE
.PP
It\[aq]s not yet possible to make a complete assertion about a balance
that has multiple commodities.
One workaround is to isolate each commodity into its own subaccount:
.IP
.EX
2013/1/1
a:usd $1
a:euro 1€
b
2013/1/2
a 0 == 0
a:usd 0 == $1
a:euro 0 == 1€
.EE
.SS Assertions and costs .SS Assertions and costs
Balance assertions ignore costs, and should normally be written without Balance assertions ignore costs, and should normally be written without
one: one:
@ -1919,19 +1872,75 @@ passes or fails.
This is for backward compatibility (hledger\[aq]s close command used to This is for backward compatibility (hledger\[aq]s close command used to
generate balance assertions with costs), and because balance generate balance assertions with costs), and because balance
\f[I]assignments\f[R] do use costs (see below). \f[I]assignments\f[R] do use costs (see below).
.SS Assertions and commodities
The balance assertions described so far are \[dq]\f[B]single commodity
balance assertions\f[R]\[dq]: they assert and check the balance in one
commodity, ignoring any others that may be present.
This is how balance assertions work in Ledger also.
.PP
If an account contains multiple commodities, you can assert their
balances by writing multiple postings with balance assertions, one for
each commodity:
.IP
.EX
2013/1/1
usd $\-1
eur €\-1
both
2013/1/2
both 0 = $1
both 0 = €1
.EE
.PP
In hledger you can make a stronger \[dq]\f[B]sole commodity balance
assertion\f[R]\[dq] by writing two equals signs
(\f[CR]== EXPECTEDBALANCE\f[R]).
This also asserts that there are no other commodities in the account
besides the asserted one (or at least, that their current balance is
zero):
.IP
.EX
2013/1/1
usd $\-1 == $\-1 ; these sole commodity assertions succeed
eur €\-1 == €\-1
both ;== $1 ; this one would fail because \[aq]both\[aq] contains $ and €
.EE
.PP
It\[aq]s less easy to make a \[dq]\f[B]sole commodities balance
assertion\f[R]\[dq] (note the plural) \- ie, asserting that an account
contains two or more specified commodities and no others.
It can be done by
.IP "1." 3
isolating each commodity in a subaccount, and asserting those
.IP "2." 3
and also asserting there are no commodities in the parent account
itself:
.IP
.EX
2013/1/1
usd $\-1
eur €\-1
both 0 == 0 ; nothing up my sleeve
both:usd $1 == $1 ; a dollar here
both:eur €1 == €1 ; a euro there
.EE
.SS Assertions and subaccounts .SS Assertions and subaccounts
The balance assertions above (\f[CR]=\f[R] and \f[CR]==\f[R]) do not All of the balance assertions above (both \f[CR]=\f[R] and
count the balance from subaccounts; they check the account\[aq]s \f[CR]==\f[R]) are \[dq]\f[B]subaccount\-exclusive balance
exclusive balance only. assertions\f[R]\[dq]; they ignore any balances that exist in deeper
You can assert the balance including subaccounts by writing subaccounts.
\f[CR]=*\f[R] or \f[CR]==*\f[R], eg: .PP
In hledger you can make \[dq]\f[B]subaccount\-inclusive balance
assertions\f[R]\[dq] by adding a star after the equals (\f[CR]=*\f[R] or
\f[CR]==*\f[R]):
.IP .IP
.EX .EX
2019/1/1 2019/1/1
equity:opening balances equity:start
checking:a 5 assets:checking $10
checking:b 5 assets:savings $10
checking 1 ==* 11 assets $0 ==* $20 ; assets + subaccounts contains $20 and nothing else
.EE .EE
.SS Assertions and virtual postings .SS Assertions and virtual postings
Balance assertions always consider both real and virtual postings; they Balance assertions always consider both real and virtual postings; they
@ -3362,7 +3371,7 @@ This directive sets a default commodity, to be used for any subsequent
commodityless amounts (ie, plain numbers) seen while parsing the commodityless amounts (ie, plain numbers) seen while parsing the
journal. journal.
This effect lasts until the next \f[CR]D\f[R] directive, or the end of This effect lasts until the next \f[CR]D\f[R] directive, or the end of
the journal. the current file.
.PP .PP
For compatibility/historical reasons, \f[CR]D\f[R] also acts like a For compatibility/historical reasons, \f[CR]D\f[R] also acts like a
\f[CR]commodity\f[R] directive (setting the commodity\[aq]s decimal mark \f[CR]commodity\f[R] directive (setting the commodity\[aq]s decimal mark
@ -3509,10 +3518,10 @@ Ledger allows a valuation function or value to be written in double
parentheses after an amount. parentheses after an amount.
hledger ignores these. hledger ignores these.
.SS Virtual postings .SS Virtual postings
A posting with parentheses around the account name A posting with parentheses around the account name, like
(\f[CR](some:account)\f[R]) is called a \f[I]unbalanced virtual \f[CR](some:account) 10\f[R], is called an \f[I]unbalanced virtual
posting\f[R]. posting\f[R].
Such postings do not participate in transaction balancing. These postings do not participate in transaction balancing.
(And if you write them without an amount, a zero amount is always (And if you write them without an amount, a zero amount is always
inferred.) inferred.)
These can occasionally be convenient for special circumstances, but they These can occasionally be convenient for special circumstances, but they
@ -6460,34 +6469,45 @@ match all the other terms.
.PP .PP
We also support more complex boolean queries with the \f[CR]expr:\f[R] We also support more complex boolean queries with the \f[CR]expr:\f[R]
prefix. prefix.
This allows one to combine queries using \f[CR]AND\f[R], \f[CR]OR\f[R], This allows one to combine query terms using \f[CR]and\f[R],
and \f[CR]NOT\f[R]. \f[CR]or\f[R], \f[CR]not\f[R] keywords (case insensitive), and to group
(\f[CR]NOT\f[R] is equivalent to the \f[CR]not:\f[R] prefix.) them by enclosing in parentheses.
.PP
Some examples: Some examples:
.IP \[bu] 2 .IP \[bu] 2
Match transactions with \[aq]cool\[aq] in the description AND with the Exclude account names containing \[aq]food\[aq]:
\[aq]A\[aq] tag
.RS 2 .RS 2
.PP .PP
\f[CR]expr:\[dq]desc:cool AND tag:A\[dq]\f[R] \f[CR]expr:\[dq]not food\[dq]\f[R] (\f[CR]not:food\f[R] is equivalent)
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Match transactions NOT to the \[aq]expenses:food\[aq] account OR with Match things which have \[aq]cool\[aq] in the description and the
the \[aq]A\[aq] tag \[aq]A\[aq] tag:
.RS 2 .RS 2
.PP .PP
\f[CR]expr:\[dq]NOT expenses:food OR tag:A\[dq]\f[R] \f[CR]expr:\[dq]desc:cool and tag:A\[dq]\f[R]
(\f[CR]expr:\[dq]desc:cool tag:A\[dq]\f[R] is equivalent)
.RE .RE
.IP \[bu] 2 .IP \[bu] 2
Match transactions NOT involving the \[aq]expenses:food\[aq] account OR Match things which either do not reference the \[aq]expenses:food\[aq]
with the \[aq]A\[aq] tag AND involving the \[aq]expenses:drink\[aq] account, or do have the \[aq]A\[aq] tag:
account.
(the AND is implicitly added by space\-separation, following the rules
above)
.RS 2 .RS 2
.PP .PP
\f[CR]expr:\[dq]expenses:food OR (tag:A expenses:drink)\[dq]\f[R] \f[CR]expr:\[dq]not expenses:food or tag:A\[dq]\f[R]
.RE .RE
.IP \[bu] 2
Match things which either do not reference the \[aq]expenses:food\[aq]
account, or which reference the \[aq]expenses:drink\[aq] account and
also have the \[aq]A\[aq] tag:
.RS 2
.PP
\f[CR]expr:\[dq]expenses:food or (expenses:drink and tag:A)\[dq]\f[R]
.RE
.PP
\f[CR]expr:\f[R] has a restriction: \f[CR]date:\f[R] queries may not be
used inside \f[CR]or\f[R] expressions.
That would allow disjoint report periods or disjoint result sets, with
unclear semantics for our reports.
.SS Queries and command options .SS Queries and command options
Some queries can also be expressed as command\-line options: Some queries can also be expressed as command\-line options:
\f[CR]depth:2\f[R] is equivalent to \f[CR]\-\-depth 2\f[R], \f[CR]depth:2\f[R] is equivalent to \f[CR]\-\-depth 2\f[R],
@ -9226,23 +9246,24 @@ Example:
.IP .IP
.EX .EX
$ hledger balancesheet $ hledger balancesheet
Balance Sheet Balance Sheet 2008\-12\-31
Assets: || 2008\-12\-31
$\-1 assets ====================++============
$1 bank:saving Assets ||
$\-2 cash \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- assets:bank:saving || $1
$\-1 assets:cash || $\-2
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
Liabilities: || $\-1
$1 liabilities:debts ====================++============
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Liabilities ||
$1 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
liabilities:debts || $\-1
Total: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- || $\-1
0 ====================++============
Net: || 0
.EE .EE
.PP .PP
This command is a higher\-level variant of the \f[CR]balance\f[R] This command is a higher\-level variant of the \f[CR]balance\f[R]
@ -9275,28 +9296,29 @@ Example:
.IP .IP
.EX .EX
$ hledger balancesheetequity $ hledger balancesheetequity
Balance Sheet With Equity Balance Sheet With Equity 2008\-12\-31
Assets: || 2008\-12\-31
$\-2 assets ====================++============
$1 bank:saving Assets ||
$\-3 cash \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- assets:bank:saving || $1
$\-2 assets:cash || $\-2
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
Liabilities: || $\-1
$1 liabilities:debts ====================++============
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Liabilities ||
$1 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
liabilities:debts || $\-1
Equity: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
$1 equity:owner || $\-1
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- ====================++============
$1 Equity ||
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
Total: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- || 0
0 ====================++============
Net: || 0
.EE .EE
.PP .PP
This command is a higher\-level variant of the \f[CR]balance\f[R] This command is a higher\-level variant of the \f[CR]balance\f[R]
@ -9307,14 +9329,19 @@ It is similar to
smarter account detection, and liabilities/equity displayed with their smarter account detection, and liabilities/equity displayed with their
sign flipped. sign flipped.
.PP .PP
This report is the easiest way to see if the accounting equation (A+L+E
= 0) is satisfied (after you have done a \f[CR]close \-\-retain\f[R] to
merge revenues and expenses with equity, and perhaps added
\f[CR]\-\-infer\-equity\f[R] to balance your commodity conversions).
.PP
This command also supports the output destination and output format This command also supports the output destination and output format
options The output formats supported are \f[CR]txt\f[R], \f[CR]csv\f[R], options The output formats supported are \f[CR]txt\f[R], \f[CR]csv\f[R],
\f[CR]tsv\f[R], \f[CR]html\f[R], and \f[CR]json\f[R]. \f[CR]tsv\f[R], \f[CR]html\f[R], and \f[CR]json\f[R].
.SS cashflow .SS cashflow
(cf) (cf)
.PP .PP
This command displays a cashflow statement, showing the inflows and This command displays a (simple) cashflow statement, showing the inflows
outflows affecting \[dq]cash\[dq] (ie, liquid, easily convertible) and outflows affecting \[dq]cash\[dq] (ie, liquid, easily convertible)
assets. assets.
Amounts are shown with normal positive sign, as in conventional Amounts are shown with normal positive sign, as in conventional
financial statements. financial statements.
@ -9340,18 +9367,16 @@ An example cashflow report:
.IP .IP
.EX .EX
$ hledger cashflow $ hledger cashflow
Cashflow Statement Cashflow Statement 2008
Cash flows: || 2008
$\-1 assets ====================++======
$1 bank:saving Cash flows ||
$\-2 cash \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- assets:bank:saving || $1
$\-1 assets:cash || $\-2
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
Total: || $\-1
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
$\-1
.EE .EE
.PP .PP
This command is a higher\-level variant of the \f[CR]balance\f[R] This command is a higher\-level variant of the \f[CR]balance\f[R]
@ -9866,18 +9891,18 @@ files to your main journal, you will run
.PP .PP
Note you can import from any file format, though CSV files are the most Note you can import from any file format, though CSV files are the most
common import source, and these docs focus on that case. common import source, and these docs focus on that case.
.SS Skipping .SS Deduplication
\f[CR]import\f[R] tries to import only the transactions which are new \f[CR]import\f[R] tries to import only the transactions which are new
since the last import, \[dq]skipping over\[dq] any that it saw last since the last import, ignoring any that it has seen in previous runs.
time.
So if your bank\[aq]s CSV includes the last three months of data, you So if your bank\[aq]s CSV includes the last three months of data, you
can download and \f[CR]import\f[R] it every month (or week, or day) and can download and \f[CR]import\f[R] it every month (or week, or day) and
only the new transactions will be imported each time. only the new transactions will be imported each time.
.PP .PP
It works as follows. It works as follows.
For each imported \f[CR]FILE\f[R]: For each imported \f[CR]FILE\f[R] (usually CSV, but they could be any of
hledger\[aq]s input formats):
.IP \[bu] 2 .IP \[bu] 2
It tries to find the latest date seen previously, by reading it from a It tries to recall the latest date seen previously, reading it from a
hidden \f[CR].latest.FILE\f[R] in the same directory. hidden \f[CR].latest.FILE\f[R] in the same directory.
.IP \[bu] 2 .IP \[bu] 2
Then it processes \f[CR]FILE\f[R], ignoring any transactions on or Then it processes \f[CR]FILE\f[R], ignoring any transactions on or
@ -9886,36 +9911,44 @@ before the \[dq]latest seen\[dq] date.
And after a successful import, it updates the \f[CR].latest.FILE\f[R](s) And after a successful import, it updates the \f[CR].latest.FILE\f[R](s)
for next time (unless \f[CR]\-\-dry\-run\f[R] was used). for next time (unless \f[CR]\-\-dry\-run\f[R] was used).
.PP .PP
This is simple system that works fairly well for transaction data This is a limited kind of deduplication, let\[aq]s call it \[dq]date
(usually CSV, but it could be any of hledger\[aq]s input formats). skipping\[dq].
It assumes: Within each input file, it avoids reprocessing the same dates across
successive runs.
This is a simple system that works for most real\-world CSV files; it
assumes these are true, or true enough:
.IP "1." 3 .IP "1." 3
new items always have the newest dates new items always have the newest dates
.IP "2." 3 .IP "2." 3
item dates are stable across successive CSV downloads item dates are stable across successive downloads
.IP "3." 3 .IP "3." 3
the order of same\-date items is stable across CSV downloads the order of same\-date items is stable across downloads
.IP "4." 3
the name of the input file is stable across downloads
.PP .PP
These are true of most CSV files representing transactions, or true If you have a bank whose CSV dates or ordering occasionally change, you
enough.
If you have a bank whose CSV dates or ordering occasionally changes, you
can reduce the chance of this happening in new transactions by importing can reduce the chance of this happening in new transactions by importing
more often (and in old transactions it doesn\[aq]t matter). more often, and in old transactions it doesn\[aq]t matter.
And remember you can use CSV rules files as input, which is one way to
ensure a stable file name.
.PP .PP
Note, \f[CR]import\f[R] avoids reprocessing the same dates across \f[CR]import\f[R] doesn\[aq]t detect other kinds of duplication, such as
successive runs, but it does not detect transactions that are duplicated duplicate transactions within a single run.
within a single run. (In part, because legitimate duplicate transactions can easily occur in
I\[aq]ll call these \[dq]skipping\[dq] and \[dq]deduplication\[dq]. real\-world data.)
.PP So, say you downloaded but forgot to import \f[CR]bank.1.csv\f[R], and a
So for example, say you downloaded but did not import week later you downloaded \f[CR]bank.2.csv\f[R] with overlapping data.
\f[CR]bank.1.csv\f[R], and later downloaded \f[CR]bank.2.csv\f[R] with Now you should not import both of these at once
overlapping data. (\f[CR]hledger import bank.1.csv bank.2.csv\f[R]); the overlapping
Then you should not import both of them at once transactions which appear twice would not be deduplicated since this is
(\f[CR]hledger import bank.1.csv bank.2.csv\f[R]), as the overlapping considered a single import.
data would appear twice and not be deduplicated. Instead, import these files one at a time, and also use the same
Instead, import them one at a time filename each time for a common \[dq]latest seen\[dq] state:
(\f[CR]hledger import bank.1.csv; hledger import bank.2.csv\f[R]), and .IP
the second import will skip the overlapping data. .EX
$ mv bank.1.csv bank.csv; hledger import bank.csv
$ mv bank.2.csv bank.csv; hledger import bank.csv
.EE
.PP .PP
Normally you can ignore the \f[CR].latest.*\f[R] files, but if needed, Normally you can ignore the \f[CR].latest.*\f[R] files, but if needed,
you can delete them (to make all transactions unseen), or you can delete them (to make all transactions unseen), or
@ -9925,8 +9958,8 @@ possibly repeated on multiple lines.
It means \[dq]I have seen transactions up to this date, and this many of It means \[dq]I have seen transactions up to this date, and this many of
them occurring on that date\[dq]. them occurring on that date\[dq].
.PP .PP
(\f[CR]hledger print \-\-new\f[R] also uses and updates these \f[CR]hledger print \-\-new\f[R] also uses and updates these
\f[CR].latest.*\f[R] files, but it is less often used.) \f[CR].latest.*\f[R] files, but it is less often used.
.PP .PP
Related: CSV > Working with CSV > Deduplicating, importing. Related: CSV > Working with CSV > Deduplicating, importing.
.SS Import testing .SS Import testing
@ -9991,25 +10024,25 @@ Example:
.IP .IP
.EX .EX
$ hledger incomestatement $ hledger incomestatement
Income Statement Income Statement 2008
Revenues: || 2008
$\-2 income ===================++======
$\-1 gifts Revenues ||
$\-1 salary \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- income:gifts || $1
$\-2 income:salary || $1
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
Expenses: || $2
$2 expenses ===================++======
$1 food Expenses ||
$1 supplies \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- expenses:food || $1
$2 expenses:supplies || $1
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-++\-\-\-\-\-\-
Total: || $2
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- ===================++======
0 Net: || 0
.EE .EE
.PP .PP
This command is a higher\-level variant of the \f[CR]balance\f[R] This command is a higher\-level variant of the \f[CR]balance\f[R]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff