doc: regenerate doc files

This commit is contained in:
Simon Michael 2017-03-27 05:12:03 -07:00
parent b56799d209
commit 59704dcb6b
13 changed files with 250 additions and 239 deletions

View File

@ -1,4 +1,4 @@
This is hledger-api.1.info, produced by makeinfo version 5.2 from stdin. This is hledger-api.1.info, produced by makeinfo version 6.0 from stdin.
 
File: hledger-api.1.info, Node: Top, Next: OPTIONS, Up: (dir) File: hledger-api.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -1,4 +1,4 @@
This is hledger_csv.5.info, produced by makeinfo version 5.2 from stdin. This is hledger_csv.5.info, produced by makeinfo version 6.0 from stdin.
 
File: hledger_csv.5.info, Node: Top, Next: CSV RULES, Up: (dir) File: hledger_csv.5.info, Node: Top, Next: CSV RULES, Up: (dir)

View File

@ -124,27 +124,27 @@ CSV RULES
include common.rules include common.rules
TIPS TIPS
Each generated journal entry will have two postings, to account1 and Each generated journal entry will have two postings, to account1 and
account2 respectively. Currently it's not possible to generate entries account2 respectively. Currently it's not possible to generate entries
with more than two postings. with more than two postings.
If the CSV has debit/credit amounts in separate fields, assign to the If the CSV has debit/credit amounts in separate fields, assign to the
amount-in and amount-out pseudo fields instead of amount. amount-in and amount-out pseudo fields instead of amount.
If the CSV has the currency in a separate field, assign that to the If the CSV has the currency in a separate field, assign that to the
currency pseudo field which will be automatically prepended to the currency pseudo field which will be automatically prepended to the
amount. (Or you can do the same thing with a field assignment.) amount. (Or you can do the same thing with a field assignment.)
If an amount value is parenthesised, it will be de-parenthesised and If an amount value is parenthesised, it will be de-parenthesised and
sign-flipped automatically. sign-flipped automatically.
The generated journal entries will be sorted by date. The original The generated journal entries will be sorted by date. The original
order of same-day entries will be preserved, usually. order of same-day entries will be preserved, usually.
REPORTING BUGS REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list) or hledger mail list)
@ -158,7 +158,7 @@ COPYRIGHT
SEE ALSO SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1) dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger_journal.5.info, produced by makeinfo version 5.2 from This is hledger_journal.5.info, produced by makeinfo version 6.0 from
stdin. stdin.
 

View File

@ -7,23 +7,23 @@ NAME
Journal - hledger's default file format, representing a General Journal Journal - hledger's default file format, representing a General Journal
DESCRIPTION DESCRIPTION
hledger's usual data source is a plain text file containing journal hledger's usual data source is a plain text file containing journal
entries in hledger journal format. This file represents a standard entries in hledger journal format. This file represents a standard
accounting general journal. I use file names ending in .journal, but accounting general journal. I use file names ending in .journal, but
that's not required. The journal file contains a number of transaction that's not required. The journal file contains a number of transaction
entries, each describing a transfer of money (or any commodity) between entries, each describing a transfer of money (or any commodity) between
two or more named accounts, in a simple format readable by both hledger two or more named accounts, in a simple format readable by both hledger
and humans. and humans.
hledger's journal format is a compatible subset, mostly, of ledger's hledger's journal format is a compatible subset, mostly, of ledger's
journal format, so hledger can work with compatible ledger journal journal format, so hledger can work with compatible ledger journal
files as well. It's safe, and encouraged, to run both hledger and files as well. It's safe, and encouraged, to run both hledger and
ledger on the same journal file, eg to validate the results you're get- ledger on the same journal file, eg to validate the results you're get-
ting. ting.
You can use hledger without learning any more about this file; just use You can use hledger without learning any more about this file; just use
the add or web commands to create and update it. Many users, though, the add or web commands to create and update it. Many users, though,
also edit the journal file directly with a text editor, perhaps also edit the journal file directly with a text editor, perhaps
assisted by the helper modes for emacs or vim. assisted by the helper modes for emacs or vim.
Here's an example: Here's an example:
@ -53,18 +53,18 @@ DESCRIPTION
FILE FORMAT FILE FORMAT
Transactions Transactions
Transactions are represented by journal entries. Each begins with a Transactions are represented by journal entries. Each begins with a
simple date in column 0, followed by three optional fields with spaces simple date in column 0, followed by three optional fields with spaces
between them: between them:
o a status flag, which can be empty or ! or * (meaning "uncleared", o a status flag, which can be empty or ! or * (meaning "uncleared",
"pending" and "cleared", or whatever you want) "pending" and "cleared", or whatever you want)
o a transaction code (eg a check number), o a transaction code (eg a check number),
o and/or a description o and/or a description
then some number of postings, of some amount to some account. Each then some number of postings, of some amount to some account. Each
posting is on its own line, consisting of: posting is on its own line, consisting of:
o indentation of one or more spaces (or tabs) o indentation of one or more spaces (or tabs)
@ -76,34 +76,34 @@ FILE FORMAT
o optionally, two or more spaces or tabs followed by an amount o optionally, two or more spaces or tabs followed by an amount
Usually there are two or more postings, though one or none is also pos- Usually there are two or more postings, though one or none is also pos-
sible. The posting amounts within a transaction must always balance, sible. The posting amounts within a transaction must always balance,
ie add up to 0. Optionally one amount can be left blank, in which case ie add up to 0. Optionally one amount can be left blank, in which case
it will be inferred. it will be inferred.
Dates Dates
Simple dates Simple dates
Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D) Within a journal file, transaction dates use Y/M/D (or Y-M-D or Y.M.D)
Leading zeros are optional. The year may be omitted, in which case it Leading zeros are optional. The year may be omitted, in which case it
will be inferred from the context - the current transaction, the will be inferred from the context - the current transaction, the
default year set with a default year directive, or the current date default year set with a default year directive, or the current date
when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31, when the command is run. Some examples: 2010/01/31, 1/31, 2010-01-31,
2010.1.31. 2010.1.31.
Secondary dates Secondary dates
Real-life transactions sometimes involve more than one date - eg the Real-life transactions sometimes involve more than one date - eg the
date you write a cheque, and the date it clears in your bank. When you date you write a cheque, and the date it clears in your bank. When you
want to model this, eg for more accurate balances, you can specify want to model this, eg for more accurate balances, you can specify
individual posting dates, which I recommend. Or, you can use the sec- individual posting dates, which I recommend. Or, you can use the sec-
ondary dates (aka auxiliary/effective dates) feature, supported for ondary dates (aka auxiliary/effective dates) feature, supported for
compatibility with Ledger. compatibility with Ledger.
A secondary date can be written after the primary date, separated by an A secondary date can be written after the primary date, separated by an
equals sign. The primary date, on the left, is used by default; the equals sign. The primary date, on the left, is used by default; the
secondary date, on the right, is used when the --date2 flag is speci- secondary date, on the right, is used when the --date2 flag is speci-
fied (--aux-date or --effective also work). fied (--aux-date or --effective also work).
The meaning of secondary dates is up to you, but it's best to follow a The meaning of secondary dates is up to you, but it's best to follow a
consistent rule. Eg write the bank's clearing date as primary, and consistent rule. Eg write the bank's clearing date as primary, and
when needed, the date the transaction was initiated as secondary. when needed, the date the transaction was initiated as secondary.
Here's an example. Note that a secondary date will use the year of the Here's an example. Note that a secondary date will use the year of the
@ -119,18 +119,18 @@ FILE FORMAT
$ hledger register checking --date2 $ hledger register checking --date2
2010/02/19 movie ticket assets:checking $-10 $-10 2010/02/19 movie ticket assets:checking $-10 $-10
Secondary dates require some effort; you must use them consistently in Secondary dates require some effort; you must use them consistently in
your journal entries and remember whether to use or not use the --date2 your journal entries and remember whether to use or not use the --date2
flag for your reports. They are included in hledger for Ledger compat- flag for your reports. They are included in hledger for Ledger compat-
ibility, but posting dates are a more powerful and less confusing ibility, but posting dates are a more powerful and less confusing
alternative. alternative.
Posting dates Posting dates
You can give individual postings a different date from their parent You can give individual postings a different date from their parent
transaction, by adding a posting comment containing a tag (see below) transaction, by adding a posting comment containing a tag (see below)
like date:DATE. This is probably the best way to control posting dates like date:DATE. This is probably the best way to control posting dates
precisely. Eg in this example the expense should appear in May precisely. Eg in this example the expense should appear in May
reports, and the deduction from checking should be reported on 6/1 for reports, and the deduction from checking should be reported on 6/1 for
easy bank reconciliation: easy bank reconciliation:
2015/5/30 2015/5/30
@ -143,23 +143,23 @@ FILE FORMAT
$ hledger -f t.j register checking $ hledger -f t.j register checking
2015/06/01 assets:checking $-10 $-10 2015/06/01 assets:checking $-10 $-10
DATE should be a simple date; if the year is not specified it will use DATE should be a simple date; if the year is not specified it will use
the year of the transaction's date. You can set the secondary date the year of the transaction's date. You can set the secondary date
similarly, with date2:DATE2. The date: or date2: tags must have a similarly, with date2:DATE2. The date: or date2: tags must have a
valid simple date value if they are present, eg a date: tag with no valid simple date value if they are present, eg a date: tag with no
value is not allowed. value is not allowed.
Ledger's earlier, more compact bracketed date syntax is also supported: Ledger's earlier, more compact bracketed date syntax is also supported:
[DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any [DATE], [DATE=DATE2] or [=DATE2]. hledger will attempt to parse any
square-bracketed sequence of the 0123456789/-.= characters in this way. square-bracketed sequence of the 0123456789/-.= characters in this way.
With this syntax, DATE infers its year from the transaction and DATE2 With this syntax, DATE infers its year from the transaction and DATE2
infers its year from DATE. infers its year from DATE.
Account names Account names
Account names typically have several parts separated by a full colon, Account names typically have several parts separated by a full colon,
from which hledger derives a hierarchical chart of accounts. They can from which hledger derives a hierarchical chart of accounts. They can
be anything you like, but in finance there are traditionally five be anything you like, but in finance there are traditionally five
top-level accounts: assets, liabilities, income, expenses, and equity. top-level accounts: assets, liabilities, income, expenses, and equity.
Account names may contain single spaces, eg: assets:accounts receiv- Account names may contain single spaces, eg: assets:accounts receiv-
able. Because of this, they must always be followed by two or more able. Because of this, they must always be followed by two or more
@ -206,31 +206,31 @@ FILE FORMAT
o if there is a commodity directive specifying the format, that is used o if there is a commodity directive specifying the format, that is used
o otherwise the format is inferred from the first posting amount in o otherwise the format is inferred from the first posting amount in
that commodity in the journal, and the precision (number of decimal that commodity in the journal, and the precision (number of decimal
places) will be the maximum from all posting amounts in that commmod- places) will be the maximum from all posting amounts in that commmod-
ity ity
o or if there are no such amounts in the journal, a default format is o or if there are no such amounts in the journal, a default format is
used (like $1000.00). used (like $1000.00).
Price amounts and amounts in D directives usually don't affect amount Price amounts and amounts in D directives usually don't affect amount
format inference, but in some situations they can do so indirectly. format inference, but in some situations they can do so indirectly.
(Eg when D's default commodity is applied to a commodity-less amount, (Eg when D's default commodity is applied to a commodity-less amount,
or when an amountless posting is balanced using a price's commodity, or or when an amountless posting is balanced using a price's commodity, or
when -V is used.) If you find this causing problems, set the desired when -V is used.) If you find this causing problems, set the desired
format with a commodity directive. format with a commodity directive.
Virtual Postings Virtual Postings
When you parenthesise the account name in a posting, we call that a When you parenthesise the account name in a posting, we call that a
virtual posting, which means: virtual posting, which means:
o it is ignored when checking that the transaction is balanced o it is ignored when checking that the transaction is balanced
o it is excluded from reports when the --real/-R flag is used, or the o it is excluded from reports when the --real/-R flag is used, or the
real:1 query. real:1 query.
You could use this, eg, to set an account's opening balance without You could use this, eg, to set an account's opening balance without
needing to use the equity:opening balances account: needing to use the equity:opening balances account:
1/1 special unbalanced posting to set initial balance 1/1 special unbalanced posting to set initial balance
@ -238,8 +238,8 @@ FILE FORMAT
When the account name is bracketed, we call it a balanced virtual post- When the account name is bracketed, we call it a balanced virtual post-
ing. This is like an ordinary virtual posting except the balanced vir- ing. This is like an ordinary virtual posting except the balanced vir-
tual postings in a transaction must balance to 0, like the real post- tual postings in a transaction must balance to 0, like the real post-
ings (but separately from them). Balanced virtual postings are also ings (but separately from them). Balanced virtual postings are also
excluded by --real/-R or real:1. excluded by --real/-R or real:1.
1/1 buy food with cash, and update some budget-tracking subaccounts elsewhere 1/1 buy food with cash, and update some budget-tracking subaccounts elsewhere
@ -249,13 +249,13 @@ FILE FORMAT
[assets:checking:budget:food] $-10 [assets:checking:budget:food] $-10
Virtual postings have some legitimate uses, but those are few. You can Virtual postings have some legitimate uses, but those are few. You can
usually find an equivalent journal entry using real postings, which is usually find an equivalent journal entry using real postings, which is
more correct and provides better error checking. more correct and provides better error checking.
Balance Assertions Balance Assertions
hledger supports Ledger-style balance assertions in journal files. hledger supports Ledger-style balance assertions in journal files.
These look like =EXPECTEDBALANCE following a posting's amount. Eg in These look like =EXPECTEDBALANCE following a posting's amount. Eg in
this example we assert the expected dollar balance in accounts a and b this example we assert the expected dollar balance in accounts a and b
after each posting: after each posting:
2013/1/1 2013/1/1
@ -267,31 +267,31 @@ FILE FORMAT
b $-1 =$-2 b $-1 =$-2
After reading a journal file, hledger will check all balance assertions After reading a journal file, hledger will check all balance assertions
and report an error if any of them fail. Balance assertions can pro- and report an error if any of them fail. Balance assertions can pro-
tect you from, eg, inadvertently disrupting reconciled balances while tect you from, eg, inadvertently disrupting reconciled balances while
cleaning up old entries. You can disable them temporarily with the cleaning up old entries. You can disable them temporarily with the
--ignore-assertions flag, which can be useful for troubleshooting or --ignore-assertions flag, which can be useful for troubleshooting or
for reading Ledger files. for reading Ledger files.
Assertions and ordering Assertions and ordering
hledger sorts an account's postings and assertions first by date and hledger sorts an account's postings and assertions first by date and
then (for postings on the same day) by parse order. Note this is dif- then (for postings on the same day) by parse order. Note this is dif-
ferent from Ledger, which sorts assertions only by parse order. (Also, ferent from Ledger, which sorts assertions only by parse order. (Also,
Ledger assertions do not see the accumulated effect of repeated post- Ledger assertions do not see the accumulated effect of repeated post-
ings to the same account within a transaction.) ings to the same account within a transaction.)
So, hledger balance assertions keep working if you reorder differ- So, hledger balance assertions keep working if you reorder differ-
ently-dated transactions within the journal. But if you reorder ently-dated transactions within the journal. But if you reorder
same-dated transactions or postings, assertions might break and require same-dated transactions or postings, assertions might break and require
updating. This order dependence does bring an advantage: precise con- updating. This order dependence does bring an advantage: precise con-
trol over the order of postings and assertions within a day, so you can trol over the order of postings and assertions within a day, so you can
assert intra-day balances. assert intra-day balances.
Assertions and included files Assertions and included files
With included files, things are a little more complicated. Including With included files, things are a little more complicated. Including
preserves the ordering of postings and assertions. If you have multi- preserves the ordering of postings and assertions. If you have multi-
ple postings to an account on the same day, split across different ple postings to an account on the same day, split across different
files, and you also want to assert the account's balance on the same files, and you also want to assert the account's balance on the same
day, you'll have to put the assertion in the right file. day, you'll have to put the assertion in the right file.
Assertions and multiple -f options Assertions and multiple -f options
@ -299,21 +299,21 @@ FILE FORMAT
-f options. Use include or concatenate the files instead. -f options. Use include or concatenate the files instead.
Assertions and commodities Assertions and commodities
The asserted balance must be a simple single-commodity amount, and in The asserted balance must be a simple single-commodity amount, and in
fact the assertion checks only this commodity's balance within the fact the assertion checks only this commodity's balance within the
(possibly multi-commodity) account balance. We could call this a par- (possibly multi-commodity) account balance. We could call this a par-
tial balance assertion. This is compatible with Ledger, and makes it tial balance assertion. This is compatible with Ledger, and makes it
possible to make assertions about accounts containing multiple commodi- possible to make assertions about accounts containing multiple commodi-
ties. ties.
To assert each commodity's balance in such a multi-commodity account, To assert each commodity's balance in such a multi-commodity account,
you can add multiple postings (with amount 0 if necessary). But note you can add multiple postings (with amount 0 if necessary). But note
that no matter how many assertions you add, you can't be sure the that no matter how many assertions you add, you can't be sure the
account does not contain some unexpected commodity. (We'll add support account does not contain some unexpected commodity. (We'll add support
for this kind of total balance assertion if there's demand.) for this kind of total balance assertion if there's demand.)
Assertions and subaccounts Assertions and subaccounts
Balance assertions do not count the balance from subaccounts; they Balance assertions do not count the balance from subaccounts; they
check the posted account's exclusive balance. For example: check the posted account's exclusive balance. For example:
1/1 1/1
@ -321,7 +321,7 @@ FILE FORMAT
checking 1 = 1 ; post to the parent account, its exclusive balance is now 1 checking 1 = 1 ; post to the parent account, its exclusive balance is now 1
equity equity
The balance report's flat mode shows these exclusive balances more The balance report's flat mode shows these exclusive balances more
clearly: clearly:
$ hledger bal checking --flat $ hledger bal checking --flat
@ -335,10 +335,10 @@ FILE FORMAT
tual. They are not affected by the --real/-R flag or real: query. tual. They are not affected by the --real/-R flag or real: query.
Balance Assignments Balance Assignments
Ledger-style balance assignments are also supported. These are like Ledger-style balance assignments are also supported. These are like
balance assertions, but with no posting amount on the left side of the balance assertions, but with no posting amount on the left side of the
equals sign; instead it is calculated automatically so as to satisfy equals sign; instead it is calculated automatically so as to satisfy
the assertion. This can be a convenience during data entry, eg when the assertion. This can be a convenience during data entry, eg when
setting opening balances: setting opening balances:
; starting a new journal, set asset account balances ; starting a new journal, set asset account balances
@ -356,27 +356,27 @@ FILE FORMAT
expenses:misc expenses:misc
The calculated amount depends on the account's balance in the commodity The calculated amount depends on the account's balance in the commodity
at that point (which depends on the previously-dated postings of the at that point (which depends on the previously-dated postings of the
commodity to that account since the last balance assertion or assign- commodity to that account since the last balance assertion or assign-
ment). Note that using balance assignments makes your journal a little ment). Note that using balance assignments makes your journal a little
less explicit; to know the exact amount posted, you have to run hledger less explicit; to know the exact amount posted, you have to run hledger
or do the calculations yourself, instead of just reading it. or do the calculations yourself, instead of just reading it.
Prices Prices
Transaction prices Transaction prices
Within a transaction posting, you can record an amount's price in Within a transaction posting, you can record an amount's price in
another commodity. This can be used to document the cost (for a pur- another commodity. This can be used to document the cost (for a pur-
chase), or selling price (for a sale), or the exchange rate that was chase), or selling price (for a sale), or the exchange rate that was
used, for this transaction. These transaction prices are fixed, and do used, for this transaction. These transaction prices are fixed, and do
not change over time. not change over time.
Amounts with transaction prices can be displayed in the transaction Amounts with transaction prices can be displayed in the transaction
price's commodity, by using the --cost/-B flag supported by most price's commodity, by using the --cost/-B flag supported by most
hledger commands (mnemonic: "cost Basis"). hledger commands (mnemonic: "cost Basis").
There are several ways to record a transaction price: There are several ways to record a transaction price:
1. Write the unit price (aka exchange rate), as @ UNITPRICE after the 1. Write the unit price (aka exchange rate), as @ UNITPRICE after the
amount: amount:
2009/1/1 2009/1/1
@ -390,7 +390,7 @@ FILE FORMAT
assets:cash assets:cash
3. Or let hledger infer the price so as to balance the transaction. To 3. Or let hledger infer the price so as to balance the transaction. To
permit this, you must fully specify all posting amounts, and their permit this, you must fully specify all posting amounts, and their
sum must have a non-zero amount in exactly two commodities: sum must have a non-zero amount in exactly two commodities:
2009/1/1 2009/1/1
@ -404,38 +404,38 @@ FILE FORMAT
assets:foreign currency $135.00 assets:foreign currency $135.00
assets:cash $-135.00 assets:cash $-135.00
Example use for transaction prices: recording the effective conversion Example use for transaction prices: recording the effective conversion
rate of purchases made in a foreign currency. rate of purchases made in a foreign currency.
Market prices Market prices
Market prices are not tied to a particular transaction; they represent Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. Some commands (balance, cur- exchange or the foreign exchange market. Some commands (balance, cur-
rently) can use this information to show the market value of things at rently) can use this information to show the market value of things at
a given date. a given date.
To record market prices, use P directives in the main journal or in an To record market prices, use P directives in the main journal or in an
included file. Their format is: included file. Their format is:
P DATE COMMODITYBEINGPRICED UNITPRICE P DATE COMMODITYBEINGPRICED UNITPRICE
DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of
the commodity being priced. UNITPRICE is an ordinary amount (symbol the commodity being priced. UNITPRICE is an ordinary amount (symbol
and quantity) in a second commodity, specifying the unit price or con- 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 version rate for the first commodity in terms of the second, on the
given date. given date.
For example, the following directives say that one euro was worth 1.35 For example, the following directives say that one euro was worth 1.35
US dollars during 2009, and $1.40 from 2010 onward: US dollars during 2009, and $1.40 from 2010 onward:
P 2009/1/1 $1.35 P 2009/1/1 $1.35
P 2010/1/1 $1.40 P 2010/1/1 $1.40
Comments Comments
Lines in the journal beginning with a semicolon (;) or hash (#) or Lines in the journal beginning with a semicolon (;) or hash (#) or
asterisk (*) are comments, and will be ignored. (Asterisk comments asterisk (*) are comments, and will be ignored. (Asterisk comments
make it easy to treat your journal like an org-mode outline in emacs.) make it easy to treat your journal like an org-mode outline in emacs.)
Also, anything between comment and end comment directives is a Also, anything between comment and end comment directives is a
(multi-line) comment. If there is no end comment, the comment extends (multi-line) comment. If there is no end comment, the comment extends
@ -551,27 +551,27 @@ FILE FORMAT
Or, you can use the --alias 'OLD=NEW' option on the command line. This Or, you can use the --alias 'OLD=NEW' option on the command line. This
affects all entries. It's useful for trying out aliases interactively. affects all entries. It's useful for trying out aliases interactively.
OLD and NEW are full account names. hledger will replace any occur- OLD and NEW are full account names. hledger will replace any occur-
rence of the old account name with the new one. Subaccounts are also rence of the old account name with the new one. Subaccounts are also
affected. Eg: affected. Eg:
alias checking = assets:bank:wells fargo:checking alias checking = assets:bank:wells fargo:checking
# rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a" # rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a"
Regex aliases Regex aliases
There is also a more powerful variant that uses a regular expression, There is also a more powerful variant that uses a regular expression,
indicated by the forward slashes. (This was the default behaviour in indicated by the forward slashes. (This was the default behaviour in
hledger 0.24-0.25): hledger 0.24-0.25):
alias /REGEX/ = REPLACEMENT alias /REGEX/ = REPLACEMENT
or --alias '/REGEX/=REPLACEMENT'. or --alias '/REGEX/=REPLACEMENT'.
REGEX is a case-insensitive regular expression. Anywhere it matches REGEX is a case-insensitive regular expression. Anywhere it matches
inside an account name, the matched part will be replaced by REPLACE- inside an account name, the matched part will be replaced by REPLACE-
MENT. If REGEX contains parenthesised match groups, these can be ref- MENT. If REGEX contains parenthesised match groups, these can be ref-
erenced by the usual numeric backreferences in REPLACEMENT. Note, cur- erenced by the usual numeric backreferences in REPLACEMENT. Note, cur-
rently regular expression aliases may cause noticeable slow-downs. rently regular expression aliases may cause noticeable slow-downs.
(And if you use Ledger on your hledger file, they will be ignored.) Eg: (And if you use Ledger on your hledger file, they will be ignored.) Eg:
alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3
@ -730,6 +730,7 @@ EDITOR SUPPORT
These were written with Ledger in mind, but also work with hledger These were written with Ledger in mind, but also work with hledger
files: files:
Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html
Vim https://github.com/ledger/ledger/wiki/Get- Vim https://github.com/ledger/ledger/wiki/Get-
ting-started ting-started

View File

@ -1,4 +1,4 @@
This is hledger_timeclock.5.info, produced by makeinfo version 5.2 from This is hledger_timeclock.5.info, produced by makeinfo version 6.0 from
stdin. stdin.
 

View File

@ -7,11 +7,11 @@ NAME
Timeclock - the time logging format of timeclock.el, as read by hledger Timeclock - the time logging format of timeclock.el, as read by hledger
DESCRIPTION DESCRIPTION
hledger can read timeclock files. As with Ledger, these are (a subset hledger can read timeclock files. As with Ledger, these are (a subset
of) timeclock.el's format, containing clock-in and clock-out entries as of) timeclock.el's format, containing clock-in and clock-out entries as
in the example below. The date is a simple date. The time format is in the example below. The date is a simple date. The time format is
HH:MM[:SS][+-ZZZZ]. Seconds and timezone are optional. The timezone, HH:MM[:SS][+-ZZZZ]. Seconds and timezone are optional. The timezone,
if present, must be four digits and is ignored (currently the time is if present, must be four digits and is ignored (currently the time is
always interpreted as a local time). always interpreted as a local time).
i 2015/03/30 09:00:00 some:account name optional description after two spaces i 2015/03/30 09:00:00 some:account name optional description after two spaces
@ -19,9 +19,9 @@ DESCRIPTION
i 2015/03/31 22:21:45 another account i 2015/03/31 22:21:45 another account
o 2015/04/01 02:00:34 o 2015/04/01 02:00:34
hledger treats each clock-in/clock-out pair as a transaction posting hledger treats each clock-in/clock-out pair as a transaction posting
some number of hours to an account. Or if the session spans more than some number of hours to an account. Or if the session spans more than
one day, it is split into several transactions, one for each day. For one day, it is split into several transactions, one for each day. For
the above time log, hledger print generates these journal entries: the above time log, hledger print generates these journal entries:
$ hledger -f t.timeclock print $ hledger -f t.timeclock print
@ -42,7 +42,7 @@ DESCRIPTION
To generate time logs, ie to clock in and clock out, you could: To generate time logs, ie to clock in and clock out, you could:
o use emacs and the built-in timeclock.el, or the extended time- o use emacs and the built-in timeclock.el, or the extended time-
clock-x.el and perhaps the extras in ledgerutils.el clock-x.el and perhaps the extras in ledgerutils.el
o at the command line, use these bash aliases: o at the command line, use these bash aliases:
@ -51,13 +51,13 @@ DESCRIPTION
alias to="echo o `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG" alias to="echo o `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG"
o or use the old ti and to scripts in the ledger 2.x repository. These o or use the old ti and to scripts in the ledger 2.x repository. These
rely on a "timeclock" executable which I think is just the ledger 2 rely on a "timeclock" executable which I think is just the ledger 2
executable renamed. executable renamed.
REPORTING BUGS REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list) or hledger mail list)
@ -71,7 +71,7 @@ COPYRIGHT
SEE ALSO SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1) dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger_timedot.5.info, produced by makeinfo version 5.2 from This is hledger_timedot.5.info, produced by makeinfo version 6.0 from
stdin. stdin.
 

View File

@ -1,4 +1,4 @@
This is hledger-ui.1.info, produced by makeinfo version 5.2 from stdin. This is hledger-ui.1.info, produced by makeinfo version 6.0 from stdin.
 
File: hledger-ui.1.info, Node: Top, Next: OPTIONS, Up: (dir) File: hledger-ui.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -1,4 +1,4 @@
This is hledger-web.1.info, produced by makeinfo version 5.2 from stdin. This is hledger-web.1.info, produced by makeinfo version 6.0 from stdin.
 
File: hledger-web.1.info, Node: Top, Next: OPTIONS, Up: (dir) File: hledger-web.1.info, Node: Top, Next: OPTIONS, Up: (dir)

View File

@ -57,22 +57,22 @@ DESCRIPTION
With --file-url you can set a different base url for static files, eg With --file-url you can set a different base url for static files, eg
for better caching or cookie-less serving on high performance websites. for better caching or cookie-less serving on high performance websites.
Note there is no built-in access control (aside from listening on Note there is no built-in access control (aside from listening on
127.0.0.1 by default). So you will need to hide hledger-web behind an 127.0.0.1 by default). So you will need to hide hledger-web behind an
authenticating proxy (such as apache or nginx) if you want to restrict authenticating proxy (such as apache or nginx) if you want to restrict
who can see and add entries to your journal. who can see and add entries to your journal.
Command-line options and arguments may be used to set an initial filter Command-line options and arguments may be used to set an initial filter
on the data. This is not shown in the web UI, but it will be applied on the data. This is not shown in the web UI, but it will be applied
in addition to any search query entered there. in addition to any search query entered there.
With journal and timeclock files (but not CSV files, currently) the web With journal and timeclock files (but not CSV files, currently) the web
app detects changes made by other means and will show the new data on app detects changes made by other means and will show the new data on
the next request. If a change makes the file unparseable, hledger-web the next request. If a change makes the file unparseable, hledger-web
will show an error until the file has been fixed. will show an error until the file has been fixed.
OPTIONS OPTIONS
Note: if invoking hledger-web as a hledger subcommand, write -- before Note: if invoking hledger-web as a hledger subcommand, write -- before
options as shown above. options as shown above.
--serve --serve
@ -85,21 +85,21 @@ OPTIONS
listen on this TCP port (default: 5000) listen on this TCP port (default: 5000)
--base-url=URL --base-url=URL
set the base url (default: http://IPADDR:PORT). You would set the base url (default: http://IPADDR:PORT). You would
change this when sharing over the network, or integrating within change this when sharing over the network, or integrating within
a larger website. a larger website.
--file-url=URL --file-url=URL
set the static files url (default: BASEURL/static). hledger-web set the static files url (default: BASEURL/static). hledger-web
normally serves static files itself, but if you wanted to serve normally serves static files itself, but if you wanted to serve
them from another server for efficiency, you would set the url them from another server for efficiency, you would set the url
with this. with this.
hledger general options: hledger general options:
-h show general usage (or after COMMAND, the command's usage) -h show general usage (or after COMMAND, the command's usage)
--help show the current program's manual as plain text (or after an --help show the current program's manual as plain text (or after an
add-on COMMAND, the add-on's manual) add-on COMMAND, the add-on's manual)
--man show the current program's manual with man --man show the current program's manual with man
@ -116,7 +116,7 @@ OPTIONS
use a different input file. For stdin, use - use a different input file. For stdin, use -
--rules-file=RULESFILE --rules-file=RULESFILE
Conversion rules file to use when reading CSV (default: Conversion rules file to use when reading CSV (default:
FILE.rules) FILE.rules)
--alias=OLD=NEW --alias=OLD=NEW
@ -149,7 +149,7 @@ OPTIONS
multiperiod/multicolumn report by year multiperiod/multicolumn report by year
-p --period=PERIODEXP -p --period=PERIODEXP
set start date, end date, and/or reporting interval all at once set start date, end date, and/or reporting interval all at once
(overrides the flags above) (overrides the flags above)
--date2 --date2
@ -174,11 +174,11 @@ OPTIONS
show items with zero amount, normally hidden show items with zero amount, normally hidden
-B --cost -B --cost
convert amounts to their cost at transaction time (using the convert amounts to their cost at transaction time (using the
transaction price, if any) transaction price, if any)
-V --value -V --value
convert amounts to their market value on the report end date convert amounts to their market value on the report end date
(using the most recent applicable market price, if any) (using the most recent applicable market price, if any)
--pivot TAGNAME --pivot TAGNAME
@ -188,17 +188,17 @@ OPTIONS
ENVIRONMENT ENVIRONMENT
LEDGER_FILE The journal file path when not specified with -f. Default: LEDGER_FILE The journal file path when not specified with -f. Default:
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
nal). nal).
FILES FILES
Reads data from one or more files in hledger journal, timeclock, time- Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps $HOME/.hledger.journal (on windows, perhaps
C:/Users/USER/.hledger.journal). C:/Users/USER/.hledger.journal).
BUGS BUGS
The need to precede options with -- when invoked from hledger is awk- The need to precede options with -- when invoked from hledger is awk-
ward. ward.
-f- doesn't work (hledger-web can't read from stdin). -f- doesn't work (hledger-web can't read from stdin).
@ -212,7 +212,7 @@ BUGS
REPORTING BUGS REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list) or hledger mail list)
@ -226,7 +226,7 @@ COPYRIGHT
SEE ALSO SEE ALSO
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time-
dot(5), ledger(1) dot(5), ledger(1)

View File

@ -1,4 +1,4 @@
This is hledger.1.info, produced by makeinfo version 5.2 from stdin. This is hledger.1.info, produced by makeinfo version 6.0 from stdin.
 
File: hledger.1.info, Node: Top, Next: EXAMPLES, Up: (dir) File: hledger.1.info, Node: Top, Next: EXAMPLES, Up: (dir)

View File

@ -121,33 +121,33 @@ OPTIONS
hledger COMMAND -h shows these. Eg: hledger register --cleared. hledger COMMAND -h shows these. Eg: hledger register --cleared.
o Command-specific options are also provided by some commands. o Command-specific options are also provided by some commands.
hledger COMMAND -h shows these too. Eg: hledger register --average. hledger COMMAND -h shows these too. Eg: hledger register --average.
o Some hledger commands come from separate add-on executables, which o Some hledger commands come from separate add-on executables, which
have their own options. hledger COMMAND -h shows these, as usual. have their own options. hledger COMMAND -h shows these, as usual.
Such options, if not also supported by hledger, should be written Such options, if not also supported by hledger, should be written
following a double hyphen argument (--) so that hledger's option following a double hyphen argument (--) so that hledger's option
parser does not complain. Eg: hledger ui -- --register=checking. parser does not complain. Eg: hledger ui -- --register=checking.
Or, you can just run the add-on directly: hledger-ui --regis- Or, you can just run the add-on directly: hledger-ui --regis-
ter=checking. ter=checking.
Command arguments may also follow the command name. In most cases Command arguments may also follow the command name. In most cases
these specify a query which filters the data. Command options and these specify a query which filters the data. Command options and
arguments can be intermixed. arguments can be intermixed.
Option and argument values containing problematic characters should be Option and argument values containing problematic characters should be
escaped with double quotes, backslashes, or (best) single quotes. This escaped with double quotes, backslashes, or (best) single quotes. This
means spaces, but also characters which are significant to your command means spaces, but also characters which are significant to your command
shell, such as less-than/greater-than. Eg: hledger regis- shell, such as less-than/greater-than. Eg: hledger regis-
ter -p 'last year' "accounts receivable (receiv- ter -p 'last year' "accounts receivable (receiv-
able|payable)" amt:\>100. able|payable)" amt:\>100.
Characters which are significant to the shell and also in regular Characters which are significant to the shell and also in regular
expressions, like parentheses, the pipe symbol and the dollar sign, expressions, like parentheses, the pipe symbol and the dollar sign,
must sometimes be double-escaped. Eg, to match the dollar symbol: must sometimes be double-escaped. Eg, to match the dollar symbol:
hledger balance cur:'\$' or hledger balance cur:\\$. hledger balance cur:'\$' or hledger balance cur:\\$.
There's more.. options and arguments being passed by hledger to an There's more.. options and arguments being passed by hledger to an
add-on executable get de-escaped once in the process. In this case you add-on executable get de-escaped once in the process. In this case you
might need triple-escaping. Eg: hledger ui cur:'\\$' or might need triple-escaping. Eg: hledger ui cur:'\\$' or
hledger ui cur:\\\\$. hledger ui cur:\\\\$.
@ -169,7 +169,7 @@ OPTIONS
-h show general usage (or after COMMAND, the command's usage) -h show general usage (or after COMMAND, the command's usage)
--help show the current program's manual as plain text (or after an --help show the current program's manual as plain text (or after an
add-on COMMAND, the add-on's manual) add-on COMMAND, the add-on's manual)
--man show the current program's manual with man --man show the current program's manual with man
@ -186,7 +186,7 @@ OPTIONS
use a different input file. For stdin, use - use a different input file. For stdin, use -
--rules-file=RULESFILE --rules-file=RULESFILE
Conversion rules file to use when reading CSV (default: Conversion rules file to use when reading CSV (default:
FILE.rules) FILE.rules)
--alias=OLD=NEW --alias=OLD=NEW
@ -220,7 +220,7 @@ OPTIONS
multiperiod/multicolumn report by year multiperiod/multicolumn report by year
-p --period=PERIODEXP -p --period=PERIODEXP
set start date, end date, and/or reporting interval all at once set start date, end date, and/or reporting interval all at once
(overrides the flags above) (overrides the flags above)
--date2 --date2
@ -245,11 +245,11 @@ OPTIONS
show items with zero amount, normally hidden show items with zero amount, normally hidden
-B --cost -B --cost
convert amounts to their cost at transaction time (using the convert amounts to their cost at transaction time (using the
transaction price, if any) transaction price, if any)
-V --value -V --value
convert amounts to their market value on the report end date convert amounts to their market value on the report end date
(using the most recent applicable market price, if any) (using the most recent applicable market price, if any)
--pivot TAGNAME --pivot TAGNAME
@ -257,13 +257,13 @@ OPTIONS
--anon show anonymized accounts and payees --anon show anonymized accounts and payees
If a reporting option occurs more than once on the command line, the If a reporting option occurs more than once on the command line, the
last one takes precedence. Eg -p jan -p feb is equivalent to -p feb. last one takes precedence. Eg -p jan -p feb is equivalent to -p feb.
Input files Input files
hledger reads transactions from a data file (and the add command writes hledger reads transactions from a data file (and the add command writes
to it). By default this file is $HOME/.hledger.journal (or on Windows, to it). By default this file is $HOME/.hledger.journal (or on Windows,
something like C:/Users/USER/.hledger.journal). You can override this something like C:/Users/USER/.hledger.journal). You can override this
with the $LEDGER_FILE environment variable: with the $LEDGER_FILE environment variable:
$ setenv LEDGER_FILE ~/finance/2016.journal $ setenv LEDGER_FILE ~/finance/2016.journal
@ -277,24 +277,25 @@ OPTIONS
$ cat some.journal | hledger -f- $ cat some.journal | hledger -f-
Usually the data file is in hledger's journal format, but it can also Usually the data file is in hledger's journal format, but it can also
be one of several other formats, listed below. hledger detects the be one of several other formats, listed below. hledger detects the
format automatically based on the file extension, or if that is not format automatically based on the file extension, or if that is not
recognised, by trying each built-in "reader" in turn: recognised, by trying each built-in "reader" in turn:
Reader: Reads: Used for file extensions: Reader: Reads: Used for file extensions:
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
journal hledger's journal format, also .journal .j .hledger journal hledger's journal format, also .journal .j .hledger
some Ledger journals .ledger some Ledger journals .ledger
timeclock timeclock files (precise time .timeclock timeclock timeclock files (precise time .timeclock
logging) logging)
timedot timedot files (approximate time .timedot timedot timedot files (approximate time .timedot
logging) logging)
csv comma-separated values (data .csv csv comma-separated values (data .csv
interchange) interchange)
If needed (eg to ensure correct error messages when a file has the If needed (eg to ensure correct error messages when a file has the
"wrong" extension), you can force a specific reader/format by prepend- "wrong" extension), you can force a specific reader/format by prepend-
ing it to the file path with a colon. Examples: ing it to the file path with a colon. Examples:
$ hledger -f csv:/some/csv-file.dat stats $ hledger -f csv:/some/csv-file.dat stats
@ -305,7 +306,7 @@ OPTIONS
o directives in one file will not affect the other files o directives in one file will not affect the other files
o balance assertions will not see any account balances from previous o balance assertions will not see any account balances from previous
files files
If you need those, either use the include directive, or concatenate the If you need those, either use the include directive, or concatenate the
@ -313,15 +314,16 @@ OPTIONS
Smart dates Smart dates
hledger's user interfaces accept a flexible "smart date" syntax (unlike hledger's user interfaces accept a flexible "smart date" syntax (unlike
dates in the journal file). Smart dates allow some english words, can dates in the journal file). Smart dates allow some english words, can
be relative to today's date, and can have less-significant date parts be relative to today's date, and can have less-significant date parts
omitted (defaulting to 1). omitted (defaulting to 1).
Examples: Examples:
2009/1/1, 2009/01/01, simple dates, several sep- 2009/1/1, 2009/01/01, simple dates, several sep-
2009-1-1, 2009.1.1 arators allowed 2009-1-1, 2009.1.1 arators allowed
2009/1, 2009 same as above - a missing 2009/1, 2009 same as above - a missing
day or month defaults to 1 day or month defaults to 1
1/1, january, jan, relative dates, meaning 1/1, january, jan, relative dates, meaning
this year january 1 of the current this year january 1 of the current
@ -330,35 +332,37 @@ OPTIONS
this month the 1st of the current this month the 1st of the current
month month
this week the most recent monday this week the most recent monday
last week the monday of the week last week the monday of the week
before this one before this one
lastweek spaces are optional lastweek spaces are optional
today, yesterday, tomorrow today, yesterday, tomorrow
Report start & end date Report start & end date
Most hledger reports show the full span of time represented by the Most hledger reports show the full span of time represented by the
journal data, by default. So, the effective report start and end dates journal data, by default. So, the effective report start and end dates
will be the earliest and latest transaction or posting dates found in will be the earliest and latest transaction or posting dates found in
the journal. the journal.
Often you will want to see a shorter time span, such as the current Often you will want to see a shorter time span, such as the current
month. You can specify a start and/or end date using -b/--begin, month. You can specify a start and/or end date using -b/--begin,
-e/--end, -p/--period or a date: query (described below). All of these -e/--end, -p/--period or a date: query (described below). All of these
accept the smart date syntax. One important thing to be aware of when accept the smart date syntax. One important thing to be aware of when
specifying end dates: as in Ledger, end dates are exclusive, so you specifying end dates: as in Ledger, end dates are exclusive, so you
need to write the date after the last day you want to include. need to write the date after the last day you want to include.
Examples: Examples:
-b 2016/3/17 begin on St. Patrick's -b 2016/3/17 begin on St. Patrick's
day 2016 day 2016
-e 12/1 end at the start of decem- -e 12/1 end at the start of decem-
ber 1st of the current ber 1st of the current
year (11/30 will be the year (11/30 will be the
last date included) last date included)
-b thismonth all transactions on or -b thismonth all transactions on or
after the 1st of the cur- after the 1st of the cur-
rent month rent month
-p thismonth all transactions in the -p thismonth all transactions in the
current month current month
@ -370,15 +374,15 @@ OPTIONS
Report intervals Report intervals
A report interval can be specified so that commands like register, bal- A report interval can be specified so that commands like register, bal-
ance and activity will divide their reports into multiple subperiods. ance and activity will divide their reports into multiple subperiods.
The basic intervals can be selected with one of -D/--daily, The basic intervals can be selected with one of -D/--daily,
-W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com- -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-
plex intervals may be specified with a period expression. Report plex intervals may be specified with a period expression. Report
intervals can not be specified with a query, currently. intervals can not be specified with a query, currently.
Period expressions Period expressions
The -p/--period option accepts period expressions, a shorthand way of The -p/--period option accepts period expressions, a shorthand way of
expressing a start date, end date, and/or report interval all at once. expressing a start date, end date, and/or report interval all at once.
Here's a basic period expression specifying the first quarter of 2009. Here's a basic period expression specifying the first quarter of 2009.
Note, hledger always treats start dates as inclusive and end dates as Note, hledger always treats start dates as inclusive and end dates as
@ -390,6 +394,7 @@ OPTIONS
long as you don't run two dates together. "to" can also be written as long as you don't run two dates together. "to" can also be written as
"-". These are equivalent to the above: "-". These are equivalent to the above:
-p "2009/1/1 2009/4/1" -p "2009/1/1 2009/4/1"
-p2009/1/1to2009/4/1 -p2009/1/1to2009/4/1
-p2009/1/1-2009/4/1 -p2009/1/1-2009/4/1
@ -397,6 +402,7 @@ OPTIONS
Dates are smart dates, so if the current year is 2009, the above can Dates are smart dates, so if the current year is 2009, the above can
also be written as: also be written as:
-p "1/1 4/1" -p "1/1 4/1"
-p "january-apr" -p "january-apr"
-p "this year to 4/1" -p "this year to 4/1"
@ -404,6 +410,7 @@ OPTIONS
If you specify only one date, the missing start or end date will be the If you specify only one date, the missing start or end date will be the
earliest or latest transaction in your journal: earliest or latest transaction in your journal:
-p "from 2009/1/1" everything after january -p "from 2009/1/1" everything after january
1, 2009 1, 2009
-p "from 2009/1" the same -p "from 2009/1" the same
@ -414,6 +421,7 @@ OPTIONS
A single date with no "from" or "to" defines both the start and end A single date with no "from" or "to" defines both the start and end
date like so: date like so:
-p "2009" the year 2009; equivalent -p "2009" the year 2009; equivalent
to "2009/1/1 to 2010/1/1" to "2009/1/1 to 2010/1/1"
-p "2009/1" the month of jan; equiva- -p "2009/1" the month of jan; equiva-
@ -428,6 +436,7 @@ OPTIONS
-Y flags. Between report interval and start/end dates (if any), the -Y flags. Between report interval and start/end dates (if any), the
word in is optional. Examples: word in is optional. Examples:
-p "weekly from 2009/1/1 to 2009/4/1" -p "weekly from 2009/1/1 to 2009/4/1"
-p "monthly in 2008" -p "monthly in 2008"
-p "quarterly" -p "quarterly"
@ -438,6 +447,7 @@ OPTIONS
Examples: Examples:
-p "bimonthly from 2008" -p "bimonthly from 2008"
-p "every 2 weeks" -p "every 2 weeks"
-p "every 5 days from 1/3" -p "every 5 days from 1/3"
@ -1053,13 +1063,13 @@ COMMANDS
$ hledger -f t.j bal euros -V -e 2016/12/21 $ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros $103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P direc- Currently, hledger's -V only uses market prices recorded with P direc-
tives, not transaction prices (unlike Ledger). tives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed. Using -B and -V together is allowed.
Custom balance output Custom balance output
In simple (non-multi-column) balance reports, you can customise the In simple (non-multi-column) balance reports, you can customise the
output with --format FMT: output with --format FMT:
$ hledger balance --format "%20(account) %12(total)" $ hledger balance --format "%20(account) %12(total)"
@ -1077,7 +1087,7 @@ COMMANDS
0 0
The FMT format string (plus a newline) specifies the formatting applied The FMT format string (plus a newline) specifies the formatting applied
to each account/balance pair. It may contain any suitable text, with to each account/balance pair. It may contain any suitable text, with
data fields interpolated like so: data fields interpolated like so:
%[MIN][.MAX](FIELDNAME) %[MIN][.MAX](FIELDNAME)
@ -1088,14 +1098,14 @@ COMMANDS
o FIELDNAME must be enclosed in parentheses, and can be one of: o FIELDNAME must be enclosed in parentheses, and can be one of:
o depth_spacer - a number of spaces equal to the account's depth, or o depth_spacer - a number of spaces equal to the account's depth, or
if MIN is specified, MIN * depth spaces. if MIN is specified, MIN * depth spaces.
o account - the account's name o account - the account's name
o total - the account's balance/posted total, right justified o total - the account's balance/posted total, right justified
Also, FMT can begin with an optional prefix to control how multi-com- Also, FMT can begin with an optional prefix to control how multi-com-
modity amounts are rendered: modity amounts are rendered:
o %_ - render on multiple lines, bottom-aligned (the default) o %_ - render on multiple lines, bottom-aligned (the default)
@ -1104,7 +1114,7 @@ COMMANDS
o %, - render on one line, comma-separated o %, - render on one line, comma-separated
There are some quirks. Eg in one-line mode, %(depth_spacer) has no There are some quirks. Eg in one-line mode, %(depth_spacer) has no
effect, instead %(account) has indentation built in. effect, instead %(account) has indentation built in.
Experimentation may be needed to get pleasing results. Experimentation may be needed to get pleasing results.
@ -1112,19 +1122,19 @@ COMMANDS
o %(total) - the account's total o %(total) - the account's total
o %-20.20(account) - the account's name, left justified, padded to 20 o %-20.20(account) - the account's name, left justified, padded to 20
characters and clipped at 20 characters characters and clipped at 20 characters
o %,%-50(account) %25(total) - account name padded to 50 characters, o %,%-50(account) %25(total) - account name padded to 50 characters,
total padded to 20 characters, with multiple commodities rendered on total padded to 20 characters, with multiple commodities rendered on
one line one line
o %20(total) %2(depth_spacer)%-(account) - the default format for the o %20(total) %2(depth_spacer)%-(account) - the default format for the
single-column balance report single-column balance report
Output destination Output destination
The balance, print, register and stats commands can write their output The balance, print, register and stats commands can write their output
to a destination other than the console. This is controlled by the to a destination other than the console. This is controlled by the
-o/--output-file option. -o/--output-file option.
$ hledger balance -o - # write to stdout (the default) $ hledger balance -o - # write to stdout (the default)
@ -1132,8 +1142,8 @@ COMMANDS
CSV output CSV output
The balance, print and register commands can write their output as CSV. The balance, print and register commands can write their output as CSV.
This is useful for exporting data to other applications, eg to make This is useful for exporting data to other applications, eg to make
charts in a spreadsheet. This is controlled by the -O/--output-format charts in a spreadsheet. This is controlled by the -O/--output-format
option, or by specifying a .csv file extension with -o/--output-file. option, or by specifying a .csv file extension with -o/--output-file.
$ hledger balance -O csv # write CSV to stdout $ hledger balance -O csv # write CSV to stdout
@ -1156,8 +1166,8 @@ COMMANDS
--format=LINEFORMAT --format=LINEFORMAT
in single-column balance reports: use this custom line format in single-column balance reports: use this custom line format
This command displays a simple balance sheet. It currently assumes This command displays a simple balance sheet. It currently assumes
that you have top-level accounts named asset and liability (plural that you have top-level accounts named asset and liability (plural
forms also allowed.) forms also allowed.)
$ hledger balancesheet $ hledger balancesheet
@ -1196,9 +1206,9 @@ COMMANDS
--format=LINEFORMAT --format=LINEFORMAT
in single-column balance reports: use this custom line format in single-column balance reports: use this custom line format
This command displays a simple cashflow statement It shows the change This command displays a simple cashflow statement It shows the change
in all "cash" (ie, liquid assets) accounts for the period. It cur- in all "cash" (ie, liquid assets) accounts for the period. It cur-
rently assumes that cash accounts are under a top-level account named rently assumes that cash accounts are under a top-level account named
asset and do not contain receivable or A/R (plural forms also allowed.) asset and do not contain receivable or A/R (plural forms also allowed.)
$ hledger cashflow $ hledger cashflow
@ -1643,14 +1653,14 @@ ADD-ON COMMANDS
hledger-dupes.hs checks for account names sharing the same leaf name. hledger-dupes.hs checks for account names sharing the same leaf name.
equity equity
hledger-equity.hs prints balance-resetting transactions, useful for hledger-equity.hs prints balance-resetting transactions, useful for
bringing account balances across file boundaries. bringing account balances across file boundaries.
prices prices
hledger-prices.hs prints all prices from the journal. hledger-prices.hs prints all prices from the journal.
print-unique print-unique
hledger-print-unique.hs prints transactions which do not reuse an hledger-print-unique.hs prints transactions which do not reuse an
already-seen description. already-seen description.
register-match register-match
@ -1663,13 +1673,13 @@ ADD-ON COMMANDS
TROUBLESHOOTING TROUBLESHOOTING
Run-time problems Run-time problems
Here are some issues you might encounter when you run hledger (and Here are some issues you might encounter when you run hledger (and
remember you can also seek help from the IRC channel, mail list or bug remember you can also seek help from the IRC channel, mail list or bug
tracker): tracker):
Successfully installed, but "No command 'hledger' found" Successfully installed, but "No command 'hledger' found"
stack and cabal install binaries into a special directory, which should stack and cabal install binaries into a special directory, which should
be added to your PATH environment variable. Eg on unix-like systems, be added to your PATH environment variable. Eg on unix-like systems,
that is ~/.local/bin and ~/.cabal/bin respectively. that is ~/.local/bin and ~/.cabal/bin respectively.
I set a custom LEDGER_FILE, but hledger is still using the default file I set a custom LEDGER_FILE, but hledger is still using the default file