Skip to content

Commit 3c1b980

Browse files
committed
;doc:Reduction methods: edits
1 parent 6c6df57 commit 3c1b980

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

hledger/hledger.m4.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7062,20 +7062,22 @@ $ hledger print --lots desc:sell
70627062

70637063
## Reduction methods
70647064

7065-
When a disposal or transfer doesn't specify a particular lot (eg the amount is `-5 AAPL` or `-5 AAPL {}`),
7066-
hledger selects lot(s) automatically using a reduction method. The available methods are:
7067-
7068-
| Method | Lots selected | Disposal cost basis |
7069-
|--------------------|--------------------|---------------------------|
7070-
| **FIFO** (default) | oldest first | each lot's cost |
7071-
| **LIFO** | newest first | each lot's cost |
7072-
| **HIFO** | highest cost first | each lot's cost |
7073-
| **AVERAGE** | oldest first | weighted average cost |
7074-
| **FIFOALL** | oldest first | each lot's cost |
7075-
| **LIFOALL** | newest first | each lot's cost |
7076-
| **HIFOALL** | highest cost first | each lot's cost |
7077-
| **AVERAGEALL** | oldest first | global weighted avg cost |
7078-
| **SPECID** | one specified lot | specified lot's cost |
7065+
When a disposal or transfer doesn't specify a particular lot (eg the amount is like `-5 AAPL {}`, or just `-5 AAPL`),
7066+
hledger selects lot(s) automatically using a reduction method.
7067+
This is configured by giving the commodity's (or account's) `lots:` tag a value.
7068+
The available methods are:
7069+
7070+
| Method | Lots selected | Disposal cost basis | Error checking
7071+
|--------------------|--------------------|---------------------------|---------------------------------------
7072+
| **FIFO** (default) | oldest first | each lot's cost | Sufficient lot(s) exist in the specified account.
7073+
| **LIFO** | newest first | each lot's cost | "
7074+
| **HIFO** | highest cost first | each lot's cost | "
7075+
| **AVERAGE** | oldest first | weighted average cost | "
7076+
| **FIFOALL** | oldest first | each lot's cost | Sufficient lot(s) exist in the account, and are highest priority across all accounts.
7077+
| **LIFOALL** | newest first | each lot's cost | "
7078+
| **HIFOALL** | highest cost first | each lot's cost | "
7079+
| **AVERAGEALL** | oldest first | global weighted avg cost | "
7080+
| **SPECID** | one specified lot | specified lot's cost | This lot exists in the account, and has sufficient balance.
70797081

70807082
**HIFO** (highest-in-first-out) selects the lot with the highest per-unit cost first,
70817083
which can be useful for tax optimization.
@@ -7085,7 +7087,8 @@ disposal cost basis, rather than each lot's individual cost.
70857087
This is required in some jurisdictions (eg Canada's Adjusted Cost Base, France's PMPA, UK's S104 pools).
70867088
Lots are still consumed in FIFO order for bookkeeping purposes.
70877089

7088-
**SPECID** (specific identification) is in use if a journal entry contains explicit lot selectors like `{2026-01-15, $50}` or `{$50}`,
7090+
**SPECID** (specific identification) is what you're using if the journal entry contains
7091+
explicit lot selectors like `{2026-01-15, $50}` or `{$50}`,
70897092
or an explicit lot subaccount like `assets:broker:{2026-01-15, $50}`.
70907093

70917094
### All-accounts reduction

0 commit comments

Comments
 (0)