Skip to content

Commit

Permalink
;doc:cost/lot notations: clarify
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Jan 22, 2025
1 parent b7deaea commit 8d886ef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hledger/hledger.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -3093,7 +3093,9 @@ See also <https://hledger.org/ledger.html> for a detailed hledger/Ledger syntax

### Other cost/lot notations

A slight digression for Ledger and Beancount users. Ledger has a number of cost/lot-related notations:
A slight digression for Ledger and Beancount users.

**Ledger** has a number of cost/lot-related notations:

- `@ UNITCOST` and `@@ TOTALCOST`
- expresses a conversion rate, as in hledger
Expand Down Expand Up @@ -3130,15 +3132,15 @@ Currently, hledger
[ledger: lot dates]: https://www.ledger-cli.org/3.0/doc/ledger3.html#Lot-dates
[ledger: lot notes]: https://www.ledger-cli.org/3.0/doc/ledger3.html#Lot-notes

Beancount has different [notation][beancount: costs and prices] and [behaviour][beancount: how inventories work]:
**Beancount** has different [notation][beancount: costs and prices] and [behaviour][beancount: how inventories work]:

- `@ UNITCOST` and `@@ TOTALCOST`
- expresses a cost without creating a lot, as in hledger
- when buying (augmenting) or selling (reducing) a lot, combined with `{...}`: documents the cost/selling price (not used for transaction balancing)
- when buying (acquiring) or selling (disposing of) a lot, combined with `{...}`: documents the cost/selling price (not used for transaction balancing)

- `{UNITCOST}` and `{{{{TOTALCOST}}}}`
- when buying (augmenting), expresses the cost for transaction balancing, and also creates a lot with this cost basis attached
- when selling (reducing),
- when buying, expresses the cost for transaction balancing, and also creates a lot with this cost basis attached
- when selling,
- selects a lot by its cost basis
- raises an error if that lot is not present or can not be selected unambiguously (depending on booking method configured)
- expresses the selling price for transaction balancing
Expand Down

0 comments on commit 8d886ef

Please sign in to comment.