docs: actual/effective -> primary/secondary

This commit is contained in:
Simon Michael 2012-12-06 04:44:31 +00:00
parent 621a91807e
commit f0c97937b0

View File

@ -238,31 +238,26 @@ transactions, like so:
1/31 ; equivalent to 2010/1/31 1/31 ; equivalent to 2010/1/31
... ...
### Actual & effective dates ### Primary & secondary dates
Most of the time, a simple transaction date is all you need. However Most of the time, a simple transaction date is all you need. However
real-life transactions sometimes involve more than one date. For example, real-life transactions sometimes involve more than one date. Eg, cheque
you buy a movie ticket on friday with a debit card, and the transaction is writing and clearing dates. When you want to model this, eg so that your
charged to your bank account on monday. Or you write a cheque to someone daily checking account balance is more accurate, write both dates,
and they deposit it weeks later. separated by an equals sign. The *primary date* goes on the left, and is
used by default; the *secondary date* goes on the right, and is used when
the `--date2` flag is provided. (You can also spell this `--aux-date`,
like ledger, or `--effective` like older versions).
When you don't care about this, just pick one date for your journal These used to be called "actual" and "effective" dates. Their meaning is
transaction; either will do. But when you want to model reality more up to you, but it's best to follow a consistent rule. I write the bank's
accurately (eg: to match your daily bank balance), write both dates, clearing date as primary, and the date I initiated the transaction as
separated by an equals sign. Following ledger's convention, the *actual secondary (if needed).
date* (or "bank date") goes on the left, and is used by default, the
*effective date* (or "your date") goes on the right, and is used when the
`--effective` flag is provided. Here are some mnemonics to prevent confusion:
- ACTUAL=EFFECTIVE. The actual date is (by definition) the one on the left. A before E.
- BANKDATE=MYDATE. You can usually think "actual is bank's, effective is mine".
- LATER=EARLIER. The effective date is usually the chronologically earlier one.
- "The cheque took EFFECT then, but ACTUALLY cleared weeks later."
Example: Example:
; ACTUAL=EFFECTIVE ; PRIMARY=SECONDARY
; The effective date's year is optional, defaulting to the actual date's ; The secondary date's year is optional, defaulting to the primary's
2010/2/23=2/19 movie ticket 2010/2/23=2/19 movie ticket
expenses:cinema $10 expenses:cinema $10
assets:checking assets:checking
@ -270,7 +265,7 @@ Example:
$ hledger register checking $ hledger register checking
2010/02/23 movie ticket assets:checking $-10 $-10 2010/02/23 movie ticket assets:checking $-10 $-10
$ hledger register checking --effective $ hledger register checking --date2
2010/02/19 movie ticket assets:checking $-10 $-10 2010/02/19 movie ticket assets:checking $-10 $-10
### Default commodity ### Default commodity
@ -404,12 +399,12 @@ a tag with `tag:NAME`.
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 tag]("tags") like `date:DATE` where transaction, by adding a [posting tag]("tags") like `date:DATE` where
DATE is a [simple date](#simple-dates). The effective date can be set DATE is a [simple date](#simple-dates). The secondary date can be set
with `date2:DATE`. If present, these dates will take precedence in with `date2:DATE2`. If present, these dates will take precedence in
reports. reports.
Ledger's bracketed posting date syntax (`[ACTUALDATE]`, Ledger's bracketed posting date syntax (`[DATE]`,
`[ACTUALDATE=EFFECTIVEDATE]` or `[=EFFECTIVEDATE]` in a posting comment) `[DATE=DATE2]` or `[=DATE2]` in a posting comment)
is also supported, as an alternate spelling of the date tags. is also supported, as an alternate spelling of the date tags.
### Including other files ### Including other files
@ -630,9 +625,9 @@ results.)
> >
> description-field %(1) - %(3) > description-field %(1) - %(3)
`effective-date-field` `date2-field`
> Which field contains the transaction's [effective date](#actual-effective-dates). > Which field contains the transaction's [secondary date](#primary-secondary-dates).
`status-field` `status-field`
@ -942,7 +937,7 @@ the following:
- `acct:REGEX` - same as above - `acct:REGEX` - same as above
- `desc:REGEX` - match transaction descriptions by regular expression - `desc:REGEX` - match transaction descriptions by regular expression
- `date:PERIODEXPR` - match dates within the specified [period](#period-expressions) - `date:PERIODEXPR` - match dates within the specified [period](#period-expressions)
- `edate:PERIODEXPR` - as above, but match effective dates - `edate:PERIODEXPR` - as above, but match secondary dates
- `status:1` or `status:0` - match cleared/uncleared transactions - `status:1` or `status:0` - match cleared/uncleared transactions
- `tag:NAME[=REGEX]` - match by exact [tag](#tags) name, and optionally match the tag value by regular expression - `tag:NAME[=REGEX]` - match by exact [tag](#tags) name, and optionally match the tag value by regular expression
- `depth:N` - match (or display, depending on command) accounts at or above this [depth](#depth-limiting) - `depth:N` - match (or display, depending on command) accounts at or above this [depth](#depth-limiting)
@ -1337,8 +1332,8 @@ entries, and the following c++ ledger options and commands:
amounts which have them. (This means that it does not currently print amounts which have them. (This means that it does not currently print
multi-commodity transactions in valid journal format.) multi-commodity transactions in valid journal format.)
- hledger print ignores the --effective flag, always showing both dates. - hledger print ignores the --date2 flag, always showing both dates.
ledger print shows only the effective date with --effective, but not ledger print shows only the secondary date with --aux-date, but not
vice versa. vice versa.
- hledger's default commodity directive (D) sets the commodity for - hledger's default commodity directive (D) sets the commodity for